Class VipFields<M>

java.lang.Object
cl.netswitch.iso.vip8583.VipFields<M>
Type Parameters:
M - the type of the VIP message.

public class VipFields<M> extends Object
Definition of all data elements of a VIP message.
  • Constructor Details

    • VipFields

      public VipFields(int maxFieldIndex)
      Constructs a new VipFields instance.
      Parameters:
      maxFieldIndex - the maximum field index of a message.
      Throws:
      IllegalArgumentException - if maxFieldIndex is negative.
  • Method Details

    • get

      public final VipField<M,?> get(int index)
      Returns the field indexed by the specified ID.
      Parameters:
      index - the index of the required field.
      Returns:
      the field or null if not defined.
      Throws:
      IndexOutOfBoundsException - if index is out-of-bounds.
    • add

      public final void add(VipField<M,?> field)
      Adds a field to the collection of fields.
      Parameters:
      field - the field to be added to be collection.
      Throws:
      NullPointerException - if field is null.
      IndexOutOfBoundsException - if field index is out-of-bounds.
      IllegalArgumentException - if field index is already defined.
    • add

      public final void add(VipField<M,?> field, VipObfuscate obfuscate)
      Adds a field to the collection of fields with obfuscate option.
      Parameters:
      field - the field to be added to be collection.
      obfuscate - the obfuscate option of the field.
      Throws:
      NullPointerException - if an argument is null.
      IndexOutOfBoundsException - if field index is out-of-bounds.
      IllegalArgumentException - if field index is already defined.
    • writeClass

      public final void writeClass(String name, PrintStream writer)
      Generates a class that implements a message for defined fields.
      Parameters:
      name - the name of the class to be generated.
      writer - the writer used to write the generated class.
      Throws:
      NullPointerException - if an argument is null.
    • writeClass

      public final void writeClass(String name, String dePrefix, PrintStream writer)
      Generates a class that implements a message for defined fields and prefix.
      Parameters:
      name - the name of the class to be generated.
      dePrefix - the data element (DE) prefix (can be null).
      writer - the writer used to write the generated class.
      Throws:
      NullPointerException - if an argument is null.