Example #1
0
 /**
  * Iterates through block4 fields and return the first one whose name matches 72, or <code>null
  * </code> if none is found.<br>
  * The first occurrence of field 72 at MT291 is expected to be the only one.
  *
  * @return a Field72 object or <code>null</code> if the field is not found
  * @see SwiftTagListBlock#getTagByName(String)
  * @throws IllegalStateException if SwiftMessage object is not initialized
  */
 public Field72 getField72() {
   if (getSwiftMessage() == null) {
     throw new IllegalStateException("SwiftMessage was not initialized");
   }
   if (getSwiftMessage().getBlock4() == null) {
     log.info("block4 is null");
     return null;
   } else {
     final Tag t = getSwiftMessage().getBlock4().getTagByName("72");
     if (t == null) {
       log.fine("field 72 not found");
       return null;
     } else {
       return new Field72(t.getValue());
     }
   }
 }
Example #2
0
 /**
  * Iterates through block4 fields and return all occurrences of fields whose names matches 97A, or
  * <code>Collections.emptyList()</code> if none is found.<br>
  * Multiple occurrences of field 97A at MT370 are expected at one sequence or across several
  * sequences.
  *
  * @return a List of Field97A objects or <code>Collections.emptyList()</code> if none is not found
  * @see SwiftTagListBlock#getTagsByName(String)
  * @throws IllegalStateException if SwiftMessage object is not initialized
  */
 public List<Field97A> getField97A() {
   if (getSwiftMessage() == null) {
     throw new IllegalStateException("SwiftMessage was not initialized");
   }
   if (getSwiftMessage().getBlock4() == null) {
     log.info("block4 is null");
     return Collections.emptyList();
   } else {
     final Tag[] tags = getSwiftMessage().getBlock4().getTagsByName("97A");
     final List<Field97A> result = new ArrayList<Field97A>();
     for (int i = 0; i < tags.length; i++) {
       result.add(new Field97A(tags[i].getValue()));
     }
     return result;
   }
 }
Example #3
0
/**
 * MT 291<br>
 * Request for Payment of Charges, Interest and Other Expenses<br>
 * <em>SRU 2014</em><br>
 * <em>NOTE: this source code has been generated from template</em>
 *
 * @author www.prowidesoftware.com
 */
public class MT291 extends AbstractMT implements Serializable {
  private static final long serialVersionUID = 1L;
  /** Constant for MT name, this is part of the classname, after <code>MT</code> */
  public static final String NAME = "291";
  // begin qualifiers constants
  // end qualifiers constants
  private static final transient java.util.logging.Logger log =
      java.util.logging.Logger.getLogger(MT291.class.getName());

  /**
   * Creates an MT291 initialized with the parameter SwiftMessage
   *
   * @param m swift message with the MT291 content
   */
  public MT291(SwiftMessage m) {
    super(m);
    // TODO issue warning if incorrect message type or illegal argument if different
  }

  /**
   * Creates an MT291 initialized with the parameter MtSwiftMessage
   *
   * @param m swift message with the MT291 content
   */
  public MT291(MtSwiftMessage m) {
    super(m);
    // TODO issue warning if incorrect message type or illegal argument if different
  }

  /**
   * Creates and initializes a new MT291 input message setting TEST BICS as sender and receiver.<br>
   * All mandatory header attributes are completed with default values.
   *
   * @since 7.6
   */
  public MT291() {
    super(291);
  }

  /**
   * Creates and initializes a new MT291 input message from sender to receiver.<br>
   * All mandatory header attributes are completed with default values. In particular the sender and
   * receiver addresses will be filled with proper default LT identifier and branch codes if not
   * provided,
   *
   * @param messageType message type to create
   * @param sender the sender address as a bic8, bic11 or full logical terminal consisting of 12
   *     characters
   * @param receiver the receiver address as a bic8, bic11 or full logical terminal consisting of 12
   *     characters
   * @since 7.6
   */
  public MT291(final int messageType, final String sender, final String receiver) {
    super(291, sender, receiver);
  }

  /**
   * Returns this MT number
   *
   * @return the message type number of this MT
   * @since 6.4
   */
  @Override
  public String getMessageType() {
    return "291";
  }

  /**
   * Add all tags from block to the end of the block4.
   *
   * @param block to append
   * @return this object to allow method chaining
   * @since 7.6
   */
  @Override
  public MT291 append(final SwiftTagListBlock block) {
    super.append(block);
    return this;
  }

  /**
   * Add all tags to the end of the block4.
   *
   * @param tags to append
   * @return this object to allow method chaining
   * @since 7.6
   */
  @Override
  public MT291 append(final Tag... tags) {
    super.append(tags);
    return this;
  }

  /**
   * Add all the fields to the end of the block4.
   *
   * @param fields to append
   * @return this object to allow method chaining
   * @since 7.6
   */
  @Override
  public MT291 append(final Field... fields) {
    super.append(fields);
    return this;
  }

  /**
   * Iterates through block4 fields and return the first one whose name matches 20, or <code>null
   * </code> if none is found.<br>
   * The first occurrence of field 20 at MT291 is expected to be the only one.
   *
   * @return a Field20 object or <code>null</code> if the field is not found
   * @see SwiftTagListBlock#getTagByName(String)
   * @throws IllegalStateException if SwiftMessage object is not initialized
   */
  public Field20 getField20() {
    if (getSwiftMessage() == null) {
      throw new IllegalStateException("SwiftMessage was not initialized");
    }
    if (getSwiftMessage().getBlock4() == null) {
      log.info("block4 is null");
      return null;
    } else {
      final Tag t = getSwiftMessage().getBlock4().getTagByName("20");
      if (t == null) {
        log.fine("field 20 not found");
        return null;
      } else {
        return new Field20(t.getValue());
      }
    }
  }

  /**
   * Iterates through block4 fields and return the first one whose name matches 21, or <code>null
   * </code> if none is found.<br>
   * The first occurrence of field 21 at MT291 is expected to be the only one.
   *
   * @return a Field21 object or <code>null</code> if the field is not found
   * @see SwiftTagListBlock#getTagByName(String)
   * @throws IllegalStateException if SwiftMessage object is not initialized
   */
  public Field21 getField21() {
    if (getSwiftMessage() == null) {
      throw new IllegalStateException("SwiftMessage was not initialized");
    }
    if (getSwiftMessage().getBlock4() == null) {
      log.info("block4 is null");
      return null;
    } else {
      final Tag t = getSwiftMessage().getBlock4().getTagByName("21");
      if (t == null) {
        log.fine("field 21 not found");
        return null;
      } else {
        return new Field21(t.getValue());
      }
    }
  }

  /**
   * Iterates through block4 fields and return the first one whose name matches 32B, or <code>null
   * </code> if none is found.<br>
   * The first occurrence of field 32B at MT291 is expected to be the only one.
   *
   * @return a Field32B object or <code>null</code> if the field is not found
   * @see SwiftTagListBlock#getTagByName(String)
   * @throws IllegalStateException if SwiftMessage object is not initialized
   */
  public Field32B getField32B() {
    if (getSwiftMessage() == null) {
      throw new IllegalStateException("SwiftMessage was not initialized");
    }
    if (getSwiftMessage().getBlock4() == null) {
      log.info("block4 is null");
      return null;
    } else {
      final Tag t = getSwiftMessage().getBlock4().getTagByName("32B");
      if (t == null) {
        log.fine("field 32B not found");
        return null;
      } else {
        return new Field32B(t.getValue());
      }
    }
  }

  /**
   * Iterates through block4 fields and return the first one whose name matches 52A, or <code>null
   * </code> if none is found.<br>
   * The first occurrence of field 52A at MT291 is expected to be the only one.
   *
   * @return a Field52A object or <code>null</code> if the field is not found
   * @see SwiftTagListBlock#getTagByName(String)
   * @throws IllegalStateException if SwiftMessage object is not initialized
   */
  public Field52A getField52A() {
    if (getSwiftMessage() == null) {
      throw new IllegalStateException("SwiftMessage was not initialized");
    }
    if (getSwiftMessage().getBlock4() == null) {
      log.info("block4 is null");
      return null;
    } else {
      final Tag t = getSwiftMessage().getBlock4().getTagByName("52A");
      if (t == null) {
        log.fine("field 52A not found");
        return null;
      } else {
        return new Field52A(t.getValue());
      }
    }
  }

  /**
   * Iterates through block4 fields and return the first one whose name matches 52D, or <code>null
   * </code> if none is found.<br>
   * The first occurrence of field 52D at MT291 is expected to be the only one.
   *
   * @return a Field52D object or <code>null</code> if the field is not found
   * @see SwiftTagListBlock#getTagByName(String)
   * @throws IllegalStateException if SwiftMessage object is not initialized
   */
  public Field52D getField52D() {
    if (getSwiftMessage() == null) {
      throw new IllegalStateException("SwiftMessage was not initialized");
    }
    if (getSwiftMessage().getBlock4() == null) {
      log.info("block4 is null");
      return null;
    } else {
      final Tag t = getSwiftMessage().getBlock4().getTagByName("52D");
      if (t == null) {
        log.fine("field 52D not found");
        return null;
      } else {
        return new Field52D(t.getValue());
      }
    }
  }

  /**
   * Iterates through block4 fields and return the first one whose name matches 57A, or <code>null
   * </code> if none is found.<br>
   * The first occurrence of field 57A at MT291 is expected to be the only one.
   *
   * @return a Field57A object or <code>null</code> if the field is not found
   * @see SwiftTagListBlock#getTagByName(String)
   * @throws IllegalStateException if SwiftMessage object is not initialized
   */
  public Field57A getField57A() {
    if (getSwiftMessage() == null) {
      throw new IllegalStateException("SwiftMessage was not initialized");
    }
    if (getSwiftMessage().getBlock4() == null) {
      log.info("block4 is null");
      return null;
    } else {
      final Tag t = getSwiftMessage().getBlock4().getTagByName("57A");
      if (t == null) {
        log.fine("field 57A not found");
        return null;
      } else {
        return new Field57A(t.getValue());
      }
    }
  }

  /**
   * Iterates through block4 fields and return the first one whose name matches 57B, or <code>null
   * </code> if none is found.<br>
   * The first occurrence of field 57B at MT291 is expected to be the only one.
   *
   * @return a Field57B object or <code>null</code> if the field is not found
   * @see SwiftTagListBlock#getTagByName(String)
   * @throws IllegalStateException if SwiftMessage object is not initialized
   */
  public Field57B getField57B() {
    if (getSwiftMessage() == null) {
      throw new IllegalStateException("SwiftMessage was not initialized");
    }
    if (getSwiftMessage().getBlock4() == null) {
      log.info("block4 is null");
      return null;
    } else {
      final Tag t = getSwiftMessage().getBlock4().getTagByName("57B");
      if (t == null) {
        log.fine("field 57B not found");
        return null;
      } else {
        return new Field57B(t.getValue());
      }
    }
  }

  /**
   * Iterates through block4 fields and return the first one whose name matches 57D, or <code>null
   * </code> if none is found.<br>
   * The first occurrence of field 57D at MT291 is expected to be the only one.
   *
   * @return a Field57D object or <code>null</code> if the field is not found
   * @see SwiftTagListBlock#getTagByName(String)
   * @throws IllegalStateException if SwiftMessage object is not initialized
   */
  public Field57D getField57D() {
    if (getSwiftMessage() == null) {
      throw new IllegalStateException("SwiftMessage was not initialized");
    }
    if (getSwiftMessage().getBlock4() == null) {
      log.info("block4 is null");
      return null;
    } else {
      final Tag t = getSwiftMessage().getBlock4().getTagByName("57D");
      if (t == null) {
        log.fine("field 57D not found");
        return null;
      } else {
        return new Field57D(t.getValue());
      }
    }
  }

  /**
   * Iterates through block4 fields and return the first one whose name matches 71B, or <code>null
   * </code> if none is found.<br>
   * The first occurrence of field 71B at MT291 is expected to be the only one.
   *
   * @return a Field71B object or <code>null</code> if the field is not found
   * @see SwiftTagListBlock#getTagByName(String)
   * @throws IllegalStateException if SwiftMessage object is not initialized
   */
  public Field71B getField71B() {
    if (getSwiftMessage() == null) {
      throw new IllegalStateException("SwiftMessage was not initialized");
    }
    if (getSwiftMessage().getBlock4() == null) {
      log.info("block4 is null");
      return null;
    } else {
      final Tag t = getSwiftMessage().getBlock4().getTagByName("71B");
      if (t == null) {
        log.fine("field 71B not found");
        return null;
      } else {
        return new Field71B(t.getValue());
      }
    }
  }

  /**
   * Iterates through block4 fields and return the first one whose name matches 72, or <code>null
   * </code> if none is found.<br>
   * The first occurrence of field 72 at MT291 is expected to be the only one.
   *
   * @return a Field72 object or <code>null</code> if the field is not found
   * @see SwiftTagListBlock#getTagByName(String)
   * @throws IllegalStateException if SwiftMessage object is not initialized
   */
  public Field72 getField72() {
    if (getSwiftMessage() == null) {
      throw new IllegalStateException("SwiftMessage was not initialized");
    }
    if (getSwiftMessage().getBlock4() == null) {
      log.info("block4 is null");
      return null;
    } else {
      final Tag t = getSwiftMessage().getBlock4().getTagByName("72");
      if (t == null) {
        log.fine("field 72 not found");
        return null;
      } else {
        return new Field72(t.getValue());
      }
    }
  }

  /*
   * sequences code
   *
   */

}
Example #4
0
/**
 * MT 370<br>
 * Netting Position Advice<br>
 * <em>SRU 2014</em><br>
 * <em>NOTE: this source code has been generated from template</em>
 *
 * @author www.prowidesoftware.com
 */
public class MT370 extends AbstractMT implements Serializable {
  private static final long serialVersionUID = 1L;
  /** Constant for MT name, this is part of the classname, after <code>MT</code> */
  public static final String NAME = "370";
  // begin qualifiers constants

  /** Constant for qualifier with value ACCW */
  public static final String ACCW = "ACCW";

  /** Constant for qualifier with value ADTX */
  public static final String ADTX = "ADTX";

  /** Constant for qualifier with value BENM */
  public static final String BENM = "BENM";

  /** Constant for qualifier with value CASH */
  public static final String CASH = "CASH";

  /** Constant for qualifier with value CSHPRTY */
  public static final String CSHPRTY = "CSHPRTY";

  /** Constant for qualifier with value GENL */
  public static final String GENL = "GENL";

  /** Constant for qualifier with value INT1 */
  public static final String INT1 = "INT1";

  /** Constant for qualifier with value INT2 */
  public static final String INT2 = "INT2";

  /** Constant for qualifier with value LINK */
  public static final String LINK = "LINK";

  /** Constant for qualifier with value NETPOS */
  public static final String NETPOS = "NETPOS";

  /** Constant for qualifier with value NETT */
  public static final String NETT = "NETT";

  /** Constant for qualifier with value PREP */
  public static final String PREP = "PREP";

  /** Constant for qualifier with value PREV */
  public static final String PREV = "PREV";

  /** Constant for qualifier with value PTYA */
  public static final String PTYA = "PTYA";

  /** Constant for qualifier with value PTYB */
  public static final String PTYB = "PTYB";

  /** Constant for qualifier with value RECP */
  public static final String RECP = "RECP";

  /** Constant for qualifier with value RELA */
  public static final String RELA = "RELA";

  /** Constant for qualifier with value SEME */
  public static final String SEME = "SEME";

  /** Constant for qualifier with value TRAD */
  public static final String TRAD = "TRAD";

  /** Constant for qualifier with value TRAN */
  public static final String TRAN = "TRAN";

  /** Constant for qualifier with value VALU */
  public static final String VALU = "VALU";
  // end qualifiers constants
  private static final transient java.util.logging.Logger log =
      java.util.logging.Logger.getLogger(MT370.class.getName());

  /**
   * Creates an MT370 initialized with the parameter SwiftMessage
   *
   * @param m swift message with the MT370 content
   */
  public MT370(SwiftMessage m) {
    super(m);
    // TODO issue warning if incorrect message type or illegal argument if different
  }

  /**
   * Creates an MT370 initialized with the parameter MtSwiftMessage
   *
   * @param m swift message with the MT370 content
   */
  public MT370(MtSwiftMessage m) {
    super(m);
    // TODO issue warning if incorrect message type or illegal argument if different
  }

  /**
   * Creates and initializes a new MT370 input message setting TEST BICS as sender and receiver.<br>
   * All mandatory header attributes are completed with default values.
   *
   * @since 7.6
   */
  public MT370() {
    super(370);
  }

  /**
   * Creates and initializes a new MT370 input message from sender to receiver.<br>
   * All mandatory header attributes are completed with default values. In particular the sender and
   * receiver addresses will be filled with proper default LT identifier and branch codes if not
   * provided,
   *
   * @param messageType message type to create
   * @param sender the sender address as a bic8, bic11 or full logical terminal consisting of 12
   *     characters
   * @param receiver the receiver address as a bic8, bic11 or full logical terminal consisting of 12
   *     characters
   * @since 7.6
   */
  public MT370(final int messageType, final String sender, final String receiver) {
    super(370, sender, receiver);
  }

  /**
   * Returns this MT number
   *
   * @return the message type number of this MT
   * @since 6.4
   */
  @Override
  public String getMessageType() {
    return "370";
  }

  /**
   * Add all tags from block to the end of the block4.
   *
   * @param block to append
   * @return this object to allow method chaining
   * @since 7.6
   */
  @Override
  public MT370 append(final SwiftTagListBlock block) {
    super.append(block);
    return this;
  }

  /**
   * Add all tags to the end of the block4.
   *
   * @param tags to append
   * @return this object to allow method chaining
   * @since 7.6
   */
  @Override
  public MT370 append(final Tag... tags) {
    super.append(tags);
    return this;
  }

  /**
   * Add all the fields to the end of the block4.
   *
   * @param fields to append
   * @return this object to allow method chaining
   * @since 7.6
   */
  @Override
  public MT370 append(final Field... fields) {
    super.append(fields);
    return this;
  }

  /**
   * Iterates through block4 fields and return the first one whose name matches 23G, or <code>null
   * </code> if none is found.<br>
   * The first occurrence of field 23G at MT370 is expected to be the only one.
   *
   * @return a Field23G object or <code>null</code> if the field is not found
   * @see SwiftTagListBlock#getTagByName(String)
   * @throws IllegalStateException if SwiftMessage object is not initialized
   */
  public Field23G getField23G() {
    if (getSwiftMessage() == null) {
      throw new IllegalStateException("SwiftMessage was not initialized");
    }
    if (getSwiftMessage().getBlock4() == null) {
      log.info("block4 is null");
      return null;
    } else {
      final Tag t = getSwiftMessage().getBlock4().getTagByName("23G");
      if (t == null) {
        log.fine("field 23G not found");
        return null;
      } else {
        return new Field23G(t.getValue());
      }
    }
  }

  /**
   * Iterates through block4 fields and return the first one whose name matches 98E, or <code>null
   * </code> if none is found.<br>
   * The first occurrence of field 98E at MT370 is expected to be the only one.
   *
   * @return a Field98E object or <code>null</code> if the field is not found
   * @see SwiftTagListBlock#getTagByName(String)
   * @throws IllegalStateException if SwiftMessage object is not initialized
   */
  public Field98E getField98E() {
    if (getSwiftMessage() == null) {
      throw new IllegalStateException("SwiftMessage was not initialized");
    }
    if (getSwiftMessage().getBlock4() == null) {
      log.info("block4 is null");
      return null;
    } else {
      final Tag t = getSwiftMessage().getBlock4().getTagByName("98E");
      if (t == null) {
        log.fine("field 98E not found");
        return null;
      } else {
        return new Field98E(t.getValue());
      }
    }
  }

  /**
   * Iterates through block4 fields and return the first one whose name matches 19A, or <code>null
   * </code> if none is found.<br>
   * The first occurrence of field 19A at MT370 is expected to be the only one.
   *
   * @return a Field19A object or <code>null</code> if the field is not found
   * @see SwiftTagListBlock#getTagByName(String)
   * @throws IllegalStateException if SwiftMessage object is not initialized
   */
  public Field19A getField19A() {
    if (getSwiftMessage() == null) {
      throw new IllegalStateException("SwiftMessage was not initialized");
    }
    if (getSwiftMessage().getBlock4() == null) {
      log.info("block4 is null");
      return null;
    } else {
      final Tag t = getSwiftMessage().getBlock4().getTagByName("19A");
      if (t == null) {
        log.fine("field 19A not found");
        return null;
      } else {
        return new Field19A(t.getValue());
      }
    }
  }

  /**
   * Iterates through block4 fields and return the first one whose name matches 22H, or <code>null
   * </code> if none is found.<br>
   * The first occurrence of field 22H at MT370 is expected to be the only one.
   *
   * @return a Field22H object or <code>null</code> if the field is not found
   * @see SwiftTagListBlock#getTagByName(String)
   * @throws IllegalStateException if SwiftMessage object is not initialized
   */
  public Field22H getField22H() {
    if (getSwiftMessage() == null) {
      throw new IllegalStateException("SwiftMessage was not initialized");
    }
    if (getSwiftMessage().getBlock4() == null) {
      log.info("block4 is null");
      return null;
    } else {
      final Tag t = getSwiftMessage().getBlock4().getTagByName("22H");
      if (t == null) {
        log.fine("field 22H not found");
        return null;
      } else {
        return new Field22H(t.getValue());
      }
    }
  }

  /**
   * Iterates through block4 fields and return the first one whose name matches 99A, or <code>null
   * </code> if none is found.<br>
   * The first occurrence of field 99A at MT370 is expected to be the only one.
   *
   * @return a Field99A object or <code>null</code> if the field is not found
   * @see SwiftTagListBlock#getTagByName(String)
   * @throws IllegalStateException if SwiftMessage object is not initialized
   */
  public Field99A getField99A() {
    if (getSwiftMessage() == null) {
      throw new IllegalStateException("SwiftMessage was not initialized");
    }
    if (getSwiftMessage().getBlock4() == null) {
      log.info("block4 is null");
      return null;
    } else {
      final Tag t = getSwiftMessage().getBlock4().getTagByName("99A");
      if (t == null) {
        log.fine("field 99A not found");
        return null;
      } else {
        return new Field99A(t.getValue());
      }
    }
  }

  /**
   * Iterates through block4 fields and return the first one whose name matches 99C, or <code>null
   * </code> if none is found.<br>
   * The first occurrence of field 99C at MT370 is expected to be the only one.
   *
   * @return a Field99C object or <code>null</code> if the field is not found
   * @see SwiftTagListBlock#getTagByName(String)
   * @throws IllegalStateException if SwiftMessage object is not initialized
   */
  public Field99C getField99C() {
    if (getSwiftMessage() == null) {
      throw new IllegalStateException("SwiftMessage was not initialized");
    }
    if (getSwiftMessage().getBlock4() == null) {
      log.info("block4 is null");
      return null;
    } else {
      final Tag t = getSwiftMessage().getBlock4().getTagByName("99C");
      if (t == null) {
        log.fine("field 99C not found");
        return null;
      } else {
        return new Field99C(t.getValue());
      }
    }
  }

  /**
   * Iterates through block4 fields and return all occurrences of fields whose names matches 16R, or
   * <code>Collections.emptyList()</code> if none is found.<br>
   * Multiple occurrences of field 16R at MT370 are expected at one sequence or across several
   * sequences.
   *
   * @return a List of Field16R objects or <code>Collections.emptyList()</code> if none is not found
   * @see SwiftTagListBlock#getTagsByName(String)
   * @throws IllegalStateException if SwiftMessage object is not initialized
   */
  public List<Field16R> getField16R() {
    if (getSwiftMessage() == null) {
      throw new IllegalStateException("SwiftMessage was not initialized");
    }
    if (getSwiftMessage().getBlock4() == null) {
      log.info("block4 is null");
      return Collections.emptyList();
    } else {
      final Tag[] tags = getSwiftMessage().getBlock4().getTagsByName("16R");
      final List<Field16R> result = new ArrayList<Field16R>();
      for (int i = 0; i < tags.length; i++) {
        result.add(new Field16R(tags[i].getValue()));
      }
      return result;
    }
  }

  /**
   * Iterates through block4 fields and return all occurrences of fields whose names matches 20C, or
   * <code>Collections.emptyList()</code> if none is found.<br>
   * Multiple occurrences of field 20C at MT370 are expected at one sequence or across several
   * sequences.
   *
   * @return a List of Field20C objects or <code>Collections.emptyList()</code> if none is not found
   * @see SwiftTagListBlock#getTagsByName(String)
   * @throws IllegalStateException if SwiftMessage object is not initialized
   */
  public List<Field20C> getField20C() {
    if (getSwiftMessage() == null) {
      throw new IllegalStateException("SwiftMessage was not initialized");
    }
    if (getSwiftMessage().getBlock4() == null) {
      log.info("block4 is null");
      return Collections.emptyList();
    } else {
      final Tag[] tags = getSwiftMessage().getBlock4().getTagsByName("20C");
      final List<Field20C> result = new ArrayList<Field20C>();
      for (int i = 0; i < tags.length; i++) {
        result.add(new Field20C(tags[i].getValue()));
      }
      return result;
    }
  }

  /**
   * Iterates through block4 fields and return all occurrences of fields whose names matches 16S, or
   * <code>Collections.emptyList()</code> if none is found.<br>
   * Multiple occurrences of field 16S at MT370 are expected at one sequence or across several
   * sequences.
   *
   * @return a List of Field16S objects or <code>Collections.emptyList()</code> if none is not found
   * @see SwiftTagListBlock#getTagsByName(String)
   * @throws IllegalStateException if SwiftMessage object is not initialized
   */
  public List<Field16S> getField16S() {
    if (getSwiftMessage() == null) {
      throw new IllegalStateException("SwiftMessage was not initialized");
    }
    if (getSwiftMessage().getBlock4() == null) {
      log.info("block4 is null");
      return Collections.emptyList();
    } else {
      final Tag[] tags = getSwiftMessage().getBlock4().getTagsByName("16S");
      final List<Field16S> result = new ArrayList<Field16S>();
      for (int i = 0; i < tags.length; i++) {
        result.add(new Field16S(tags[i].getValue()));
      }
      return result;
    }
  }

  /**
   * Iterates through block4 fields and return all occurrences of fields whose names matches 95P, or
   * <code>Collections.emptyList()</code> if none is found.<br>
   * Multiple occurrences of field 95P at MT370 are expected at one sequence or across several
   * sequences.
   *
   * @return a List of Field95P objects or <code>Collections.emptyList()</code> if none is not found
   * @see SwiftTagListBlock#getTagsByName(String)
   * @throws IllegalStateException if SwiftMessage object is not initialized
   */
  public List<Field95P> getField95P() {
    if (getSwiftMessage() == null) {
      throw new IllegalStateException("SwiftMessage was not initialized");
    }
    if (getSwiftMessage().getBlock4() == null) {
      log.info("block4 is null");
      return Collections.emptyList();
    } else {
      final Tag[] tags = getSwiftMessage().getBlock4().getTagsByName("95P");
      final List<Field95P> result = new ArrayList<Field95P>();
      for (int i = 0; i < tags.length; i++) {
        result.add(new Field95P(tags[i].getValue()));
      }
      return result;
    }
  }

  /**
   * Iterates through block4 fields and return all occurrences of fields whose names matches 98A, or
   * <code>Collections.emptyList()</code> if none is found.<br>
   * Multiple occurrences of field 98A at MT370 are expected at one sequence or across several
   * sequences.
   *
   * @return a List of Field98A objects or <code>Collections.emptyList()</code> if none is not found
   * @see SwiftTagListBlock#getTagsByName(String)
   * @throws IllegalStateException if SwiftMessage object is not initialized
   */
  public List<Field98A> getField98A() {
    if (getSwiftMessage() == null) {
      throw new IllegalStateException("SwiftMessage was not initialized");
    }
    if (getSwiftMessage().getBlock4() == null) {
      log.info("block4 is null");
      return Collections.emptyList();
    } else {
      final Tag[] tags = getSwiftMessage().getBlock4().getTagsByName("98A");
      final List<Field98A> result = new ArrayList<Field98A>();
      for (int i = 0; i < tags.length; i++) {
        result.add(new Field98A(tags[i].getValue()));
      }
      return result;
    }
  }

  /**
   * Iterates through block4 fields and return all occurrences of fields whose names matches 98C, or
   * <code>Collections.emptyList()</code> if none is found.<br>
   * Multiple occurrences of field 98C at MT370 are expected at one sequence or across several
   * sequences.
   *
   * @return a List of Field98C objects or <code>Collections.emptyList()</code> if none is not found
   * @see SwiftTagListBlock#getTagsByName(String)
   * @throws IllegalStateException if SwiftMessage object is not initialized
   */
  public List<Field98C> getField98C() {
    if (getSwiftMessage() == null) {
      throw new IllegalStateException("SwiftMessage was not initialized");
    }
    if (getSwiftMessage().getBlock4() == null) {
      log.info("block4 is null");
      return Collections.emptyList();
    } else {
      final Tag[] tags = getSwiftMessage().getBlock4().getTagsByName("98C");
      final List<Field98C> result = new ArrayList<Field98C>();
      for (int i = 0; i < tags.length; i++) {
        result.add(new Field98C(tags[i].getValue()));
      }
      return result;
    }
  }

  /**
   * Iterates through block4 fields and return all occurrences of fields whose names matches 22F, or
   * <code>Collections.emptyList()</code> if none is found.<br>
   * Multiple occurrences of field 22F at MT370 are expected at one sequence or across several
   * sequences.
   *
   * @return a List of Field22F objects or <code>Collections.emptyList()</code> if none is not found
   * @see SwiftTagListBlock#getTagsByName(String)
   * @throws IllegalStateException if SwiftMessage object is not initialized
   */
  public List<Field22F> getField22F() {
    if (getSwiftMessage() == null) {
      throw new IllegalStateException("SwiftMessage was not initialized");
    }
    if (getSwiftMessage().getBlock4() == null) {
      log.info("block4 is null");
      return Collections.emptyList();
    } else {
      final Tag[] tags = getSwiftMessage().getBlock4().getTagsByName("22F");
      final List<Field22F> result = new ArrayList<Field22F>();
      for (int i = 0; i < tags.length; i++) {
        result.add(new Field22F(tags[i].getValue()));
      }
      return result;
    }
  }

  /**
   * Iterates through block4 fields and return all occurrences of fields whose names matches 70E, or
   * <code>Collections.emptyList()</code> if none is found.<br>
   * Multiple occurrences of field 70E at MT370 are expected at one sequence or across several
   * sequences.
   *
   * @return a List of Field70E objects or <code>Collections.emptyList()</code> if none is not found
   * @see SwiftTagListBlock#getTagsByName(String)
   * @throws IllegalStateException if SwiftMessage object is not initialized
   */
  public List<Field70E> getField70E() {
    if (getSwiftMessage() == null) {
      throw new IllegalStateException("SwiftMessage was not initialized");
    }
    if (getSwiftMessage().getBlock4() == null) {
      log.info("block4 is null");
      return Collections.emptyList();
    } else {
      final Tag[] tags = getSwiftMessage().getBlock4().getTagsByName("70E");
      final List<Field70E> result = new ArrayList<Field70E>();
      for (int i = 0; i < tags.length; i++) {
        result.add(new Field70E(tags[i].getValue()));
      }
      return result;
    }
  }

  /**
   * Iterates through block4 fields and return all occurrences of fields whose names matches 95Q, or
   * <code>Collections.emptyList()</code> if none is found.<br>
   * Multiple occurrences of field 95Q at MT370 are expected at one sequence or across several
   * sequences.
   *
   * @return a List of Field95Q objects or <code>Collections.emptyList()</code> if none is not found
   * @see SwiftTagListBlock#getTagsByName(String)
   * @throws IllegalStateException if SwiftMessage object is not initialized
   */
  public List<Field95Q> getField95Q() {
    if (getSwiftMessage() == null) {
      throw new IllegalStateException("SwiftMessage was not initialized");
    }
    if (getSwiftMessage().getBlock4() == null) {
      log.info("block4 is null");
      return Collections.emptyList();
    } else {
      final Tag[] tags = getSwiftMessage().getBlock4().getTagsByName("95Q");
      final List<Field95Q> result = new ArrayList<Field95Q>();
      for (int i = 0; i < tags.length; i++) {
        result.add(new Field95Q(tags[i].getValue()));
      }
      return result;
    }
  }

  /**
   * Iterates through block4 fields and return all occurrences of fields whose names matches 95R, or
   * <code>Collections.emptyList()</code> if none is found.<br>
   * Multiple occurrences of field 95R at MT370 are expected at one sequence or across several
   * sequences.
   *
   * @return a List of Field95R objects or <code>Collections.emptyList()</code> if none is not found
   * @see SwiftTagListBlock#getTagsByName(String)
   * @throws IllegalStateException if SwiftMessage object is not initialized
   */
  public List<Field95R> getField95R() {
    if (getSwiftMessage() == null) {
      throw new IllegalStateException("SwiftMessage was not initialized");
    }
    if (getSwiftMessage().getBlock4() == null) {
      log.info("block4 is null");
      return Collections.emptyList();
    } else {
      final Tag[] tags = getSwiftMessage().getBlock4().getTagsByName("95R");
      final List<Field95R> result = new ArrayList<Field95R>();
      for (int i = 0; i < tags.length; i++) {
        result.add(new Field95R(tags[i].getValue()));
      }
      return result;
    }
  }

  /**
   * Iterates through block4 fields and return all occurrences of fields whose names matches 97A, or
   * <code>Collections.emptyList()</code> if none is found.<br>
   * Multiple occurrences of field 97A at MT370 are expected at one sequence or across several
   * sequences.
   *
   * @return a List of Field97A objects or <code>Collections.emptyList()</code> if none is not found
   * @see SwiftTagListBlock#getTagsByName(String)
   * @throws IllegalStateException if SwiftMessage object is not initialized
   */
  public List<Field97A> getField97A() {
    if (getSwiftMessage() == null) {
      throw new IllegalStateException("SwiftMessage was not initialized");
    }
    if (getSwiftMessage().getBlock4() == null) {
      log.info("block4 is null");
      return Collections.emptyList();
    } else {
      final Tag[] tags = getSwiftMessage().getBlock4().getTagsByName("97A");
      final List<Field97A> result = new ArrayList<Field97A>();
      for (int i = 0; i < tags.length; i++) {
        result.add(new Field97A(tags[i].getValue()));
      }
      return result;
    }
  }

  /*
   * sequences code
   *
   */

  // BaseSequenceCodeGenerator [seq=A]
  public static class SequenceA extends SwiftTagListBlock {
    private static final long serialVersionUID = 1L;

    /** Constructs an empty sequence */
    private SequenceA() {
      super(new ArrayList<Tag>());
    }
    /**
     * Creates a sequence with the given content.
     *
     * @see SwiftTagListBlock
     */
    private SequenceA(final SwiftTagListBlock content) {
      super(content.getTags());
    }
    /**
     * Value for the qualifier of the 16R / 16S tag that indicates start and end of this sequence
     * <em>GENL</em>
     */
    public static final String START_END_16RS = "GENL";

    public static final Tag START_TAG = new Tag(Field16R.NAME, START_END_16RS);
    public static final Tag END_TAG = new Tag(Field16S.NAME, START_END_16RS);
    /**
     * Creates a new instance of this sequence with the given tags inside.
     *
     * @param tags may be null, an empty sequence containing only start and end sequence tags will
     *     be returned
     */
    @SequenceStyle(Type.GENERATED_16RS)
    public static SequenceA newInstance(final Tag... tags) {
      final SequenceA result = new SequenceA();

      result.addTag(START_TAG);

      if (tags != null && tags.length > 0) {
        for (final Tag t : tags) {
          result.addTag(t);
        }
      }

      result.addTag(END_TAG);

      return result;
    }

    /**
     * Create an empty $sequenceClassname. This method is intended to avoid disambiguation for the
     * newInstance() with variable list of blocks or tags
     *
     * @since 7.6
     */
    public static SequenceA newInstance() {
      final SequenceA result = new SequenceA();

      result.addTag(START_TAG);

      result.addTag(END_TAG);

      return result;
    }

    /**
     * Create a new instance of $sequenceClassname and add the contents of all sequences given
     * inside. Mainly intended to create a sequence by adding subsequences
     *
     * @since 7.6
     */
    public static SequenceA newInstance(final SwiftTagListBlock... sequences) {
      final SequenceA result = new SequenceA();

      result.addTag(START_TAG);

      if (sequences != null && sequences.length > 0) {
        for (final SwiftTagListBlock s : sequences) {
          result.addTags(s.getTags());
        }
      }

      result.addTag(END_TAG);

      return result;
    }

    @SequenceStyle(Type.GENERATED_16RS)
    private SequenceA(final SwiftMessage m) {
      super(m.getBlock4().getSubBlock(START_END_16RS).getTags());
    }
  }
  /**
   * Get the single occurrence of SequenceA delimited by 16R/16S the value of
   * SequenceA#START_END_16RS. The presence of this methods indicates that this sequence can occur
   * only once according to the Standard. <em>NOTE: this method never returns <code>null</code>. If
   * the sequence is not found an empty instance of <code>SequenceA</code> is returned</em>
   *
   * @see SequenceA#START_END_16RS
   */
  @SequenceStyle(Type.GENERATED_16RS)
  public SequenceA getSequenceA() {
    return new SequenceA(this.getSwiftMessage());
  }
  // Slice debug: com.prowidesoftware.swift.codegen.DelimitedSequenceCodeGenerator
  // Slice debug: $s.isSliceHeuristic()

  // BaseSequenceCodeGenerator [seq=A1]
  public static class SequenceA1 extends SwiftTagListBlock {
    private static final long serialVersionUID = 1L;

    /** Constructs an empty sequence */
    private SequenceA1() {
      super(new ArrayList<Tag>());
    }
    /**
     * Creates a sequence with the given content.
     *
     * @see SwiftTagListBlock
     */
    private SequenceA1(final SwiftTagListBlock content) {
      super(content.getTags());
    }
    /**
     * Value for the qualifier of the 16R / 16S tag that indicates start and end of this sequence
     * <em>LINK</em>
     */
    public static final String START_END_16RS = "LINK";

    public static final Tag START_TAG = new Tag(Field16R.NAME, START_END_16RS);
    public static final Tag END_TAG = new Tag(Field16S.NAME, START_END_16RS);
    /**
     * Creates a new instance of this sequence with the given tags inside.
     *
     * @param tags may be null, an empty sequence containing only start and end sequence tags will
     *     be returned
     */
    @SequenceStyle(Type.GENERATED_16RS)
    public static SequenceA1 newInstance(final Tag... tags) {
      final SequenceA1 result = new SequenceA1();

      result.addTag(START_TAG);

      if (tags != null && tags.length > 0) {
        for (final Tag t : tags) {
          result.addTag(t);
        }
      }

      result.addTag(END_TAG);

      return result;
    }

    /**
     * Create an empty $sequenceClassname. This method is intended to avoid disambiguation for the
     * newInstance() with variable list of blocks or tags
     *
     * @since 7.6
     */
    public static SequenceA1 newInstance() {
      final SequenceA1 result = new SequenceA1();

      result.addTag(START_TAG);

      result.addTag(END_TAG);

      return result;
    }

    /**
     * Create a new instance of $sequenceClassname and add the contents of all sequences given
     * inside. Mainly intended to create a sequence by adding subsequences
     *
     * @since 7.6
     */
    public static SequenceA1 newInstance(final SwiftTagListBlock... sequences) {
      final SequenceA1 result = new SequenceA1();

      result.addTag(START_TAG);

      if (sequences != null && sequences.length > 0) {
        for (final SwiftTagListBlock s : sequences) {
          result.addTags(s.getTags());
        }
      }

      result.addTag(END_TAG);

      return result;
    }

    @SequenceStyle(Type.GENERATED_16RS)
    private SequenceA1(final SwiftMessage m) {
      super(m.getBlock4().getSubBlock(START_END_16RS).getTags());
    }
  }
  /**
   * Get the list of SequenceA1 delimited by 16R/16S with value specified in
   * SequenceA1#START_END_16RS The presence of this methods indicates that this sequence can occur
   * more than once according to the Standard. If message is empty or nor sequences are found <em>an
   * empty list</em> is returned.
   *
   * @see SequenceA1#START_END_16RS
   */
  @SequenceStyle(Type.GENERATED_16RS)
  public List<SequenceA1> getSequenceA1List() {
    final List<SwiftTagListBlock> blocks =
        getSwiftMessage().getBlock4().getSubBlocks(SequenceA1.START_END_16RS);
    if (blocks != null && !blocks.isEmpty()) {
      final List<SequenceA1> result = new ArrayList<SequenceA1>(blocks.size());
      for (final SwiftTagListBlock b : blocks) {
        result.add(new SequenceA1(b));
      }
      return result;
    }
    // TODO if is is mandatory issue a warning log
    return Collections.emptyList();
  }
  // Slice debug: com.prowidesoftware.swift.codegen.DelimitedSequenceCodeGenerator
  // Slice debug: $s.isSliceHeuristic()

  // BaseSequenceCodeGenerator [seq=B]
  public static class SequenceB extends SwiftTagListBlock {
    private static final long serialVersionUID = 1L;

    /** Constructs an empty sequence */
    private SequenceB() {
      super(new ArrayList<Tag>());
    }
    /**
     * Creates a sequence with the given content.
     *
     * @see SwiftTagListBlock
     */
    private SequenceB(final SwiftTagListBlock content) {
      super(content.getTags());
    }
    /**
     * Value for the qualifier of the 16R / 16S tag that indicates start and end of this sequence
     * <em>NETPOS</em>
     */
    public static final String START_END_16RS = "NETPOS";

    public static final Tag START_TAG = new Tag(Field16R.NAME, START_END_16RS);
    public static final Tag END_TAG = new Tag(Field16S.NAME, START_END_16RS);
    /**
     * Creates a new instance of this sequence with the given tags inside.
     *
     * @param tags may be null, an empty sequence containing only start and end sequence tags will
     *     be returned
     */
    @SequenceStyle(Type.GENERATED_16RS)
    public static SequenceB newInstance(final Tag... tags) {
      final SequenceB result = new SequenceB();

      result.addTag(START_TAG);

      if (tags != null && tags.length > 0) {
        for (final Tag t : tags) {
          result.addTag(t);
        }
      }

      result.addTag(END_TAG);

      return result;
    }

    /**
     * Create an empty $sequenceClassname. This method is intended to avoid disambiguation for the
     * newInstance() with variable list of blocks or tags
     *
     * @since 7.6
     */
    public static SequenceB newInstance() {
      final SequenceB result = new SequenceB();

      result.addTag(START_TAG);

      result.addTag(END_TAG);

      return result;
    }

    /**
     * Create a new instance of $sequenceClassname and add the contents of all sequences given
     * inside. Mainly intended to create a sequence by adding subsequences
     *
     * @since 7.6
     */
    public static SequenceB newInstance(final SwiftTagListBlock... sequences) {
      final SequenceB result = new SequenceB();

      result.addTag(START_TAG);

      if (sequences != null && sequences.length > 0) {
        for (final SwiftTagListBlock s : sequences) {
          result.addTags(s.getTags());
        }
      }

      result.addTag(END_TAG);

      return result;
    }

    @SequenceStyle(Type.GENERATED_16RS)
    private SequenceB(final SwiftMessage m) {
      super(m.getBlock4().getSubBlock(START_END_16RS).getTags());
    }
  }
  /**
   * Get the single occurrence of SequenceB delimited by 16R/16S the value of
   * SequenceB#START_END_16RS. The presence of this methods indicates that this sequence can occur
   * only once according to the Standard. <em>NOTE: this method never returns <code>null</code>. If
   * the sequence is not found an empty instance of <code>SequenceB</code> is returned</em>
   *
   * @see SequenceB#START_END_16RS
   */
  @SequenceStyle(Type.GENERATED_16RS)
  public SequenceB getSequenceB() {
    return new SequenceB(this.getSwiftMessage());
  }
  // Slice debug: com.prowidesoftware.swift.codegen.DelimitedSequenceCodeGenerator
  // Slice debug: $s.isSliceHeuristic()

  // BaseSequenceCodeGenerator [seq=B1]
  public static class SequenceB1 extends SwiftTagListBlock {
    private static final long serialVersionUID = 1L;

    /** Constructs an empty sequence */
    private SequenceB1() {
      super(new ArrayList<Tag>());
    }
    /**
     * Creates a sequence with the given content.
     *
     * @see SwiftTagListBlock
     */
    private SequenceB1(final SwiftTagListBlock content) {
      super(content.getTags());
    }
    /**
     * Value for the qualifier of the 16R / 16S tag that indicates start and end of this sequence
     * <em>CSHPRTY</em>
     */
    public static final String START_END_16RS = "CSHPRTY";

    public static final Tag START_TAG = new Tag(Field16R.NAME, START_END_16RS);
    public static final Tag END_TAG = new Tag(Field16S.NAME, START_END_16RS);
    /**
     * Creates a new instance of this sequence with the given tags inside.
     *
     * @param tags may be null, an empty sequence containing only start and end sequence tags will
     *     be returned
     */
    @SequenceStyle(Type.GENERATED_16RS)
    public static SequenceB1 newInstance(final Tag... tags) {
      final SequenceB1 result = new SequenceB1();

      result.addTag(START_TAG);

      if (tags != null && tags.length > 0) {
        for (final Tag t : tags) {
          result.addTag(t);
        }
      }

      result.addTag(END_TAG);

      return result;
    }

    /**
     * Create an empty $sequenceClassname. This method is intended to avoid disambiguation for the
     * newInstance() with variable list of blocks or tags
     *
     * @since 7.6
     */
    public static SequenceB1 newInstance() {
      final SequenceB1 result = new SequenceB1();

      result.addTag(START_TAG);

      result.addTag(END_TAG);

      return result;
    }

    /**
     * Create a new instance of $sequenceClassname and add the contents of all sequences given
     * inside. Mainly intended to create a sequence by adding subsequences
     *
     * @since 7.6
     */
    public static SequenceB1 newInstance(final SwiftTagListBlock... sequences) {
      final SequenceB1 result = new SequenceB1();

      result.addTag(START_TAG);

      if (sequences != null && sequences.length > 0) {
        for (final SwiftTagListBlock s : sequences) {
          result.addTags(s.getTags());
        }
      }

      result.addTag(END_TAG);

      return result;
    }

    @SequenceStyle(Type.GENERATED_16RS)
    private SequenceB1(final SwiftMessage m) {
      super(m.getBlock4().getSubBlock(START_END_16RS).getTags());
    }
  }
  /**
   * Get the list of SequenceB1 delimited by 16R/16S with value specified in
   * SequenceB1#START_END_16RS The presence of this methods indicates that this sequence can occur
   * more than once according to the Standard. If message is empty or nor sequences are found <em>an
   * empty list</em> is returned.
   *
   * @see SequenceB1#START_END_16RS
   */
  @SequenceStyle(Type.GENERATED_16RS)
  public List<SequenceB1> getSequenceB1List() {
    final List<SwiftTagListBlock> blocks =
        getSwiftMessage().getBlock4().getSubBlocks(SequenceB1.START_END_16RS);
    if (blocks != null && !blocks.isEmpty()) {
      final List<SequenceB1> result = new ArrayList<SequenceB1>(blocks.size());
      for (final SwiftTagListBlock b : blocks) {
        result.add(new SequenceB1(b));
      }
      return result;
    }
    // TODO if is is mandatory issue a warning log
    return Collections.emptyList();
  }
  // Slice debug: com.prowidesoftware.swift.codegen.DelimitedSequenceCodeGenerator
  // Slice debug: $s.isSliceHeuristic()

}
Example #5
0
/**
 * MT 691<br>
 * <br>
 * <em>NOTE: this source code has been generated from template</em>
 *
 * @author www.prowidesoftware.com
 */
public class MT691 extends AbstractMT implements Serializable {
  private static final long serialVersionUID = 1L;
  /** Constant for MT name, this is part of the classname, after <code>MT</code> */
  public static final String NAME = "691";
  // begin qualifiers constants
  // end qualifiers constants
  private static final transient java.util.logging.Logger log =
      java.util.logging.Logger.getLogger(MT691.class.getName());

  /**
   * Creates an MT691 initialized with the parameter SwiftMessage
   *
   * @param m swift message with the MT691 content
   */
  public MT691(SwiftMessage m) {
    super(m);
  }

  /**
   * Creates an MT691 initialized with the parameter MtSwiftMessage
   *
   * @param m swift message with the MT691 content
   */
  public MT691(MtSwiftMessage m) {
    super(m);
  }

  /** Creates an MT691 initialized with a new SwiftMessage */
  /*
  public MT691() {
  	super();
  }
  */

  /**
   * Returns this MT number
   *
   * @return the message type number of this MT
   * @since 6.4
   */
  @Override
  public String getMessageType() {
    return "691";
  }

  /**
   * Iterates through block4 fields and return the first one whose name matches 20, or <code>null
   * </code> if none is found.<br>
   * The first occurrence of field 20 at MT691 is expected to be the only one.
   *
   * @return a Field20 object or <code>null</code> if the field is not found
   * @see SwiftTagListBlock#getTagByName(String)
   * @throws IllegalStateException if SwiftMessage object is not initialized
   */
  public Field20 getField20() {
    if (getSwiftMessage() == null) {
      throw new IllegalStateException("SwiftMessage was not initialized");
    }
    if (getSwiftMessage().getBlock4() == null) {
      log.info("block4 is null");
      return null;
    } else {
      final Tag t = getSwiftMessage().getBlock4().getTagByName("20");
      if (t == null) {
        log.fine("field 20 not found");
        return null;
      } else {
        return new Field20(t.getValue());
      }
    }
  }

  /**
   * Iterates through block4 fields and return the first one whose name matches 21, or <code>null
   * </code> if none is found.<br>
   * The first occurrence of field 21 at MT691 is expected to be the only one.
   *
   * @return a Field21 object or <code>null</code> if the field is not found
   * @see SwiftTagListBlock#getTagByName(String)
   * @throws IllegalStateException if SwiftMessage object is not initialized
   */
  public Field21 getField21() {
    if (getSwiftMessage() == null) {
      throw new IllegalStateException("SwiftMessage was not initialized");
    }
    if (getSwiftMessage().getBlock4() == null) {
      log.info("block4 is null");
      return null;
    } else {
      final Tag t = getSwiftMessage().getBlock4().getTagByName("21");
      if (t == null) {
        log.fine("field 21 not found");
        return null;
      } else {
        return new Field21(t.getValue());
      }
    }
  }

  /**
   * Iterates through block4 fields and return the first one whose name matches 32B, or <code>null
   * </code> if none is found.<br>
   * The first occurrence of field 32B at MT691 is expected to be the only one.
   *
   * @return a Field32B object or <code>null</code> if the field is not found
   * @see SwiftTagListBlock#getTagByName(String)
   * @throws IllegalStateException if SwiftMessage object is not initialized
   */
  public Field32B getField32B() {
    if (getSwiftMessage() == null) {
      throw new IllegalStateException("SwiftMessage was not initialized");
    }
    if (getSwiftMessage().getBlock4() == null) {
      log.info("block4 is null");
      return null;
    } else {
      final Tag t = getSwiftMessage().getBlock4().getTagByName("32B");
      if (t == null) {
        log.fine("field 32B not found");
        return null;
      } else {
        return new Field32B(t.getValue());
      }
    }
  }

  /**
   * Iterates through block4 fields and return the first one whose name matches 52A, or <code>null
   * </code> if none is found.<br>
   * The first occurrence of field 52A at MT691 is expected to be the only one.
   *
   * @return a Field52A object or <code>null</code> if the field is not found
   * @see SwiftTagListBlock#getTagByName(String)
   * @throws IllegalStateException if SwiftMessage object is not initialized
   */
  public Field52A getField52A() {
    if (getSwiftMessage() == null) {
      throw new IllegalStateException("SwiftMessage was not initialized");
    }
    if (getSwiftMessage().getBlock4() == null) {
      log.info("block4 is null");
      return null;
    } else {
      final Tag t = getSwiftMessage().getBlock4().getTagByName("52A");
      if (t == null) {
        log.fine("field 52A not found");
        return null;
      } else {
        return new Field52A(t.getValue());
      }
    }
  }

  /**
   * Iterates through block4 fields and return the first one whose name matches 52D, or <code>null
   * </code> if none is found.<br>
   * The first occurrence of field 52D at MT691 is expected to be the only one.
   *
   * @return a Field52D object or <code>null</code> if the field is not found
   * @see SwiftTagListBlock#getTagByName(String)
   * @throws IllegalStateException if SwiftMessage object is not initialized
   */
  public Field52D getField52D() {
    if (getSwiftMessage() == null) {
      throw new IllegalStateException("SwiftMessage was not initialized");
    }
    if (getSwiftMessage().getBlock4() == null) {
      log.info("block4 is null");
      return null;
    } else {
      final Tag t = getSwiftMessage().getBlock4().getTagByName("52D");
      if (t == null) {
        log.fine("field 52D not found");
        return null;
      } else {
        return new Field52D(t.getValue());
      }
    }
  }

  /**
   * Iterates through block4 fields and return the first one whose name matches 57A, or <code>null
   * </code> if none is found.<br>
   * The first occurrence of field 57A at MT691 is expected to be the only one.
   *
   * @return a Field57A object or <code>null</code> if the field is not found
   * @see SwiftTagListBlock#getTagByName(String)
   * @throws IllegalStateException if SwiftMessage object is not initialized
   */
  public Field57A getField57A() {
    if (getSwiftMessage() == null) {
      throw new IllegalStateException("SwiftMessage was not initialized");
    }
    if (getSwiftMessage().getBlock4() == null) {
      log.info("block4 is null");
      return null;
    } else {
      final Tag t = getSwiftMessage().getBlock4().getTagByName("57A");
      if (t == null) {
        log.fine("field 57A not found");
        return null;
      } else {
        return new Field57A(t.getValue());
      }
    }
  }

  /**
   * Iterates through block4 fields and return the first one whose name matches 57B, or <code>null
   * </code> if none is found.<br>
   * The first occurrence of field 57B at MT691 is expected to be the only one.
   *
   * @return a Field57B object or <code>null</code> if the field is not found
   * @see SwiftTagListBlock#getTagByName(String)
   * @throws IllegalStateException if SwiftMessage object is not initialized
   */
  public Field57B getField57B() {
    if (getSwiftMessage() == null) {
      throw new IllegalStateException("SwiftMessage was not initialized");
    }
    if (getSwiftMessage().getBlock4() == null) {
      log.info("block4 is null");
      return null;
    } else {
      final Tag t = getSwiftMessage().getBlock4().getTagByName("57B");
      if (t == null) {
        log.fine("field 57B not found");
        return null;
      } else {
        return new Field57B(t.getValue());
      }
    }
  }

  /**
   * Iterates through block4 fields and return the first one whose name matches 57D, or <code>null
   * </code> if none is found.<br>
   * The first occurrence of field 57D at MT691 is expected to be the only one.
   *
   * @return a Field57D object or <code>null</code> if the field is not found
   * @see SwiftTagListBlock#getTagByName(String)
   * @throws IllegalStateException if SwiftMessage object is not initialized
   */
  public Field57D getField57D() {
    if (getSwiftMessage() == null) {
      throw new IllegalStateException("SwiftMessage was not initialized");
    }
    if (getSwiftMessage().getBlock4() == null) {
      log.info("block4 is null");
      return null;
    } else {
      final Tag t = getSwiftMessage().getBlock4().getTagByName("57D");
      if (t == null) {
        log.fine("field 57D not found");
        return null;
      } else {
        return new Field57D(t.getValue());
      }
    }
  }

  /**
   * Iterates through block4 fields and return the first one whose name matches 71B, or <code>null
   * </code> if none is found.<br>
   * The first occurrence of field 71B at MT691 is expected to be the only one.
   *
   * @return a Field71B object or <code>null</code> if the field is not found
   * @see SwiftTagListBlock#getTagByName(String)
   * @throws IllegalStateException if SwiftMessage object is not initialized
   */
  public Field71B getField71B() {
    if (getSwiftMessage() == null) {
      throw new IllegalStateException("SwiftMessage was not initialized");
    }
    if (getSwiftMessage().getBlock4() == null) {
      log.info("block4 is null");
      return null;
    } else {
      final Tag t = getSwiftMessage().getBlock4().getTagByName("71B");
      if (t == null) {
        log.fine("field 71B not found");
        return null;
      } else {
        return new Field71B(t.getValue());
      }
    }
  }

  /**
   * Iterates through block4 fields and return the first one whose name matches 72, or <code>null
   * </code> if none is found.<br>
   * The first occurrence of field 72 at MT691 is expected to be the only one.
   *
   * @return a Field72 object or <code>null</code> if the field is not found
   * @see SwiftTagListBlock#getTagByName(String)
   * @throws IllegalStateException if SwiftMessage object is not initialized
   */
  public Field72 getField72() {
    if (getSwiftMessage() == null) {
      throw new IllegalStateException("SwiftMessage was not initialized");
    }
    if (getSwiftMessage().getBlock4() == null) {
      log.info("block4 is null");
      return null;
    } else {
      final Tag t = getSwiftMessage().getBlock4().getTagByName("72");
      if (t == null) {
        log.fine("field 72 not found");
        return null;
      } else {
        return new Field72(t.getValue());
      }
    }
  }

  /*
   * sequences code
   *
   */

}
Example #6
0
/**
 * MT 201<br>
 * Multiple Financial Institution Transfer for its Own Account<br>
 * <em>SRU 2014</em><br>
 * <em>NOTE: this source code has been generated from template</em>
 *
 * @author www.prowidesoftware.com
 */
public class MT201 extends AbstractMT implements Serializable {
  private static final long serialVersionUID = 1L;
  /** Constant for MT name, this is part of the classname, after <code>MT</code> */
  public static final String NAME = "201";
  // begin qualifiers constants
  // end qualifiers constants
  private static final transient java.util.logging.Logger log =
      java.util.logging.Logger.getLogger(MT201.class.getName());

  /**
   * Creates an MT201 initialized with the parameter SwiftMessage
   *
   * @param m swift message with the MT201 content
   */
  public MT201(SwiftMessage m) {
    super(m);
    // TODO issue warning if incorrect message type or illegal argument if different
  }

  /**
   * Creates an MT201 initialized with the parameter MtSwiftMessage
   *
   * @param m swift message with the MT201 content
   */
  public MT201(MtSwiftMessage m) {
    super(m);
    // TODO issue warning if incorrect message type or illegal argument if different
  }

  /**
   * Creates and initializes a new MT201 input message setting TEST BICS as sender and receiver.<br>
   * All mandatory header attributes are completed with default values.
   *
   * @since 7.6
   */
  public MT201() {
    super(201);
  }

  /**
   * Creates and initializes a new MT201 input message from sender to receiver.<br>
   * All mandatory header attributes are completed with default values. In particular the sender and
   * receiver addresses will be filled with proper default LT identifier and branch codes if not
   * provided,
   *
   * @param messageType message type to create
   * @param sender the sender address as a bic8, bic11 or full logical terminal consisting of 12
   *     characters
   * @param receiver the receiver address as a bic8, bic11 or full logical terminal consisting of 12
   *     characters
   * @since 7.6
   */
  public MT201(final int messageType, final String sender, final String receiver) {
    super(201, sender, receiver);
  }

  /**
   * Returns this MT number
   *
   * @return the message type number of this MT
   * @since 6.4
   */
  @Override
  public String getMessageType() {
    return "201";
  }

  /**
   * Add all tags from block to the end of the block4.
   *
   * @param block to append
   * @return this object to allow method chaining
   * @since 7.6
   */
  @Override
  public MT201 append(final SwiftTagListBlock block) {
    super.append(block);
    return this;
  }

  /**
   * Add all tags to the end of the block4.
   *
   * @param tags to append
   * @return this object to allow method chaining
   * @since 7.6
   */
  @Override
  public MT201 append(final Tag... tags) {
    super.append(tags);
    return this;
  }

  /**
   * Add all the fields to the end of the block4.
   *
   * @param fields to append
   * @return this object to allow method chaining
   * @since 7.6
   */
  @Override
  public MT201 append(final Field... fields) {
    super.append(fields);
    return this;
  }

  /**
   * Iterates through block4 fields and return the first one whose name matches 19, or <code>null
   * </code> if none is found.<br>
   * The first occurrence of field 19 at MT201 is expected to be the only one.
   *
   * @return a Field19 object or <code>null</code> if the field is not found
   * @see SwiftTagListBlock#getTagByName(String)
   * @throws IllegalStateException if SwiftMessage object is not initialized
   */
  public Field19 getField19() {
    if (getSwiftMessage() == null) {
      throw new IllegalStateException("SwiftMessage was not initialized");
    }
    if (getSwiftMessage().getBlock4() == null) {
      log.info("block4 is null");
      return null;
    } else {
      final Tag t = getSwiftMessage().getBlock4().getTagByName("19");
      if (t == null) {
        log.fine("field 19 not found");
        return null;
      } else {
        return new Field19(t.getValue());
      }
    }
  }

  /**
   * Iterates through block4 fields and return the first one whose name matches 30, or <code>null
   * </code> if none is found.<br>
   * The first occurrence of field 30 at MT201 is expected to be the only one.
   *
   * @return a Field30 object or <code>null</code> if the field is not found
   * @see SwiftTagListBlock#getTagByName(String)
   * @throws IllegalStateException if SwiftMessage object is not initialized
   */
  public Field30 getField30() {
    if (getSwiftMessage() == null) {
      throw new IllegalStateException("SwiftMessage was not initialized");
    }
    if (getSwiftMessage().getBlock4() == null) {
      log.info("block4 is null");
      return null;
    } else {
      final Tag t = getSwiftMessage().getBlock4().getTagByName("30");
      if (t == null) {
        log.fine("field 30 not found");
        return null;
      } else {
        return new Field30(t.getValue());
      }
    }
  }

  /**
   * Iterates through block4 fields and return the first one whose name matches 53B, or <code>null
   * </code> if none is found.<br>
   * The first occurrence of field 53B at MT201 is expected to be the only one.
   *
   * @return a Field53B object or <code>null</code> if the field is not found
   * @see SwiftTagListBlock#getTagByName(String)
   * @throws IllegalStateException if SwiftMessage object is not initialized
   */
  public Field53B getField53B() {
    if (getSwiftMessage() == null) {
      throw new IllegalStateException("SwiftMessage was not initialized");
    }
    if (getSwiftMessage().getBlock4() == null) {
      log.info("block4 is null");
      return null;
    } else {
      final Tag t = getSwiftMessage().getBlock4().getTagByName("53B");
      if (t == null) {
        log.fine("field 53B not found");
        return null;
      } else {
        return new Field53B(t.getValue());
      }
    }
  }

  /**
   * Iterates through block4 fields and return all occurrences of fields whose names matches 20, or
   * <code>Collections.emptyList()</code> if none is found.<br>
   * Multiple occurrences of field 20 at MT201 are expected at one sequence or across several
   * sequences.
   *
   * @return a List of Field20 objects or <code>Collections.emptyList()</code> if none is not found
   * @see SwiftTagListBlock#getTagsByName(String)
   * @throws IllegalStateException if SwiftMessage object is not initialized
   */
  public List<Field20> getField20() {
    if (getSwiftMessage() == null) {
      throw new IllegalStateException("SwiftMessage was not initialized");
    }
    if (getSwiftMessage().getBlock4() == null) {
      log.info("block4 is null");
      return Collections.emptyList();
    } else {
      final Tag[] tags = getSwiftMessage().getBlock4().getTagsByName("20");
      final List<Field20> result = new ArrayList<Field20>();
      for (int i = 0; i < tags.length; i++) {
        result.add(new Field20(tags[i].getValue()));
      }
      return result;
    }
  }

  /**
   * Iterates through block4 fields and return all occurrences of fields whose names matches 32B, or
   * <code>Collections.emptyList()</code> if none is found.<br>
   * Multiple occurrences of field 32B at MT201 are expected at one sequence or across several
   * sequences.
   *
   * @return a List of Field32B objects or <code>Collections.emptyList()</code> if none is not found
   * @see SwiftTagListBlock#getTagsByName(String)
   * @throws IllegalStateException if SwiftMessage object is not initialized
   */
  public List<Field32B> getField32B() {
    if (getSwiftMessage() == null) {
      throw new IllegalStateException("SwiftMessage was not initialized");
    }
    if (getSwiftMessage().getBlock4() == null) {
      log.info("block4 is null");
      return Collections.emptyList();
    } else {
      final Tag[] tags = getSwiftMessage().getBlock4().getTagsByName("32B");
      final List<Field32B> result = new ArrayList<Field32B>();
      for (int i = 0; i < tags.length; i++) {
        result.add(new Field32B(tags[i].getValue()));
      }
      return result;
    }
  }

  /**
   * Iterates through block4 fields and return all occurrences of fields whose names matches 56A, or
   * <code>Collections.emptyList()</code> if none is found.<br>
   * Multiple occurrences of field 56A at MT201 are expected at one sequence or across several
   * sequences.
   *
   * @return a List of Field56A objects or <code>Collections.emptyList()</code> if none is not found
   * @see SwiftTagListBlock#getTagsByName(String)
   * @throws IllegalStateException if SwiftMessage object is not initialized
   */
  public List<Field56A> getField56A() {
    if (getSwiftMessage() == null) {
      throw new IllegalStateException("SwiftMessage was not initialized");
    }
    if (getSwiftMessage().getBlock4() == null) {
      log.info("block4 is null");
      return Collections.emptyList();
    } else {
      final Tag[] tags = getSwiftMessage().getBlock4().getTagsByName("56A");
      final List<Field56A> result = new ArrayList<Field56A>();
      for (int i = 0; i < tags.length; i++) {
        result.add(new Field56A(tags[i].getValue()));
      }
      return result;
    }
  }

  /**
   * Iterates through block4 fields and return all occurrences of fields whose names matches 56D, or
   * <code>Collections.emptyList()</code> if none is found.<br>
   * Multiple occurrences of field 56D at MT201 are expected at one sequence or across several
   * sequences.
   *
   * @return a List of Field56D objects or <code>Collections.emptyList()</code> if none is not found
   * @see SwiftTagListBlock#getTagsByName(String)
   * @throws IllegalStateException if SwiftMessage object is not initialized
   */
  public List<Field56D> getField56D() {
    if (getSwiftMessage() == null) {
      throw new IllegalStateException("SwiftMessage was not initialized");
    }
    if (getSwiftMessage().getBlock4() == null) {
      log.info("block4 is null");
      return Collections.emptyList();
    } else {
      final Tag[] tags = getSwiftMessage().getBlock4().getTagsByName("56D");
      final List<Field56D> result = new ArrayList<Field56D>();
      for (int i = 0; i < tags.length; i++) {
        result.add(new Field56D(tags[i].getValue()));
      }
      return result;
    }
  }

  /**
   * Iterates through block4 fields and return all occurrences of fields whose names matches 57A, or
   * <code>Collections.emptyList()</code> if none is found.<br>
   * Multiple occurrences of field 57A at MT201 are expected at one sequence or across several
   * sequences.
   *
   * @return a List of Field57A objects or <code>Collections.emptyList()</code> if none is not found
   * @see SwiftTagListBlock#getTagsByName(String)
   * @throws IllegalStateException if SwiftMessage object is not initialized
   */
  public List<Field57A> getField57A() {
    if (getSwiftMessage() == null) {
      throw new IllegalStateException("SwiftMessage was not initialized");
    }
    if (getSwiftMessage().getBlock4() == null) {
      log.info("block4 is null");
      return Collections.emptyList();
    } else {
      final Tag[] tags = getSwiftMessage().getBlock4().getTagsByName("57A");
      final List<Field57A> result = new ArrayList<Field57A>();
      for (int i = 0; i < tags.length; i++) {
        result.add(new Field57A(tags[i].getValue()));
      }
      return result;
    }
  }

  /**
   * Iterates through block4 fields and return all occurrences of fields whose names matches 57B, or
   * <code>Collections.emptyList()</code> if none is found.<br>
   * Multiple occurrences of field 57B at MT201 are expected at one sequence or across several
   * sequences.
   *
   * @return a List of Field57B objects or <code>Collections.emptyList()</code> if none is not found
   * @see SwiftTagListBlock#getTagsByName(String)
   * @throws IllegalStateException if SwiftMessage object is not initialized
   */
  public List<Field57B> getField57B() {
    if (getSwiftMessage() == null) {
      throw new IllegalStateException("SwiftMessage was not initialized");
    }
    if (getSwiftMessage().getBlock4() == null) {
      log.info("block4 is null");
      return Collections.emptyList();
    } else {
      final Tag[] tags = getSwiftMessage().getBlock4().getTagsByName("57B");
      final List<Field57B> result = new ArrayList<Field57B>();
      for (int i = 0; i < tags.length; i++) {
        result.add(new Field57B(tags[i].getValue()));
      }
      return result;
    }
  }

  /**
   * Iterates through block4 fields and return all occurrences of fields whose names matches 57D, or
   * <code>Collections.emptyList()</code> if none is found.<br>
   * Multiple occurrences of field 57D at MT201 are expected at one sequence or across several
   * sequences.
   *
   * @return a List of Field57D objects or <code>Collections.emptyList()</code> if none is not found
   * @see SwiftTagListBlock#getTagsByName(String)
   * @throws IllegalStateException if SwiftMessage object is not initialized
   */
  public List<Field57D> getField57D() {
    if (getSwiftMessage() == null) {
      throw new IllegalStateException("SwiftMessage was not initialized");
    }
    if (getSwiftMessage().getBlock4() == null) {
      log.info("block4 is null");
      return Collections.emptyList();
    } else {
      final Tag[] tags = getSwiftMessage().getBlock4().getTagsByName("57D");
      final List<Field57D> result = new ArrayList<Field57D>();
      for (int i = 0; i < tags.length; i++) {
        result.add(new Field57D(tags[i].getValue()));
      }
      return result;
    }
  }

  /**
   * Iterates through block4 fields and return all occurrences of fields whose names matches 72, or
   * <code>Collections.emptyList()</code> if none is found.<br>
   * Multiple occurrences of field 72 at MT201 are expected at one sequence or across several
   * sequences.
   *
   * @return a List of Field72 objects or <code>Collections.emptyList()</code> if none is not found
   * @see SwiftTagListBlock#getTagsByName(String)
   * @throws IllegalStateException if SwiftMessage object is not initialized
   */
  public List<Field72> getField72() {
    if (getSwiftMessage() == null) {
      throw new IllegalStateException("SwiftMessage was not initialized");
    }
    if (getSwiftMessage().getBlock4() == null) {
      log.info("block4 is null");
      return Collections.emptyList();
    } else {
      final Tag[] tags = getSwiftMessage().getBlock4().getTagsByName("72");
      final List<Field72> result = new ArrayList<Field72>();
      for (int i = 0; i < tags.length; i++) {
        result.add(new Field72(tags[i].getValue()));
      }
      return result;
    }
  }

  /*
   * sequences code
   *
   */

  // BaseSequenceCodeGenerator [seq=B]
  public static class SequenceB extends SwiftTagListBlock {
    private static final long serialVersionUID = 1L;

    /** Constructs an empty sequence */
    private SequenceB() {
      super(new ArrayList<Tag>());
    }
    /**
     * Creates a sequence with the given content.
     *
     * @see SwiftTagListBlock
     */
    private SequenceB(final SwiftTagListBlock content) {
      super(content.getTags());
    }
    /**
     * First mandatory tagname of the sequence: <em>"20" </em>. Array format is for cases when more
     * than one letter options is allowed
     */
    public static final String[] START = {"20"};
    /**
     * Last mandatory tagname of the sequence: <em>"57A", "57B", "57D" </em> Array format is for
     * cases when more than one letter options is allowed
     */
    public static final String[] END = {"57A", "57B", "57D"};
    /** List of optional tags after the last mandatory tag */
    public static final String[] TAIL = new String[] {"72"};

    /** same as newInstance(0, 0, tags); see #newInstance(Tag ... ) */
    @SequenceStyle(Type.GENERATED_FIXED_WITH_OPTIONAL_TAIL)
    public static SequenceB newInstance(final Tag... tags) {
      return newInstance(0, 0, tags);
    }

    @SequenceStyle(Type.GENERATED_FIXED_WITH_OPTIONAL_TAIL)
    public static SequenceB newInstance(final int start, final int end, final Tag... tags) {
      final SequenceB result = new SequenceB();

      result.addTag(new Tag(START[start], ""));

      if (tags != null && tags.length > 0) {
        for (final Tag t : tags) {
          result.addTag(t);
        }
      }

      result.addTag(new Tag(END[end], ""));

      return result;
    }
  }
  /**
   * Get the list of SequenceB delimited by leading tag and end, with an optional tail. The presence
   * of this methods indicates that this sequence can occur more than once according to the
   * Standard. If message is empty or nor sequences are found <em>an empty list</em> is returned.
   *
   * @see SwiftTagListBlock#getSubBlocksDelimitedWithOptionalTail(String[], String[], String[])
   */
  @SequenceStyle(Type.GENERATED_FIXED_WITH_OPTIONAL_TAIL)
  public List<SequenceB> getSequenceBList() {
    if (getSwiftMessage() == null) {
      throw new RuntimeException("SwiftMessage is null");
    }
    final SwiftBlock4 b4 = getSwiftMessage().getBlock4();
    if (b4 != null && !b4.isEmpty()) {
      final List<SequenceB> result = new ArrayList<SequenceB>();
      final List<SwiftTagListBlock> bs =
          b4.getSubBlocksDelimitedWithOptionalTail(SequenceB.START, SequenceB.END, SequenceB.TAIL);
      if (bs != null && !bs.isEmpty()) {
        for (final SwiftTagListBlock s : bs) {
          result.add(new SequenceB(s));
        }
      }
      return result;
    }
    // TODO if is is mandatory issue a warning log
    return Collections.emptyList();
  }
}
Example #7
0
/**
 * MT 517<br>
 * <br>
 * <em>NOTE: this source code has been generated from template</em>
 *
 * @author www.prowidesoftware.com
 */
public class MT517 extends AbstractMT implements Serializable {
  private static final long serialVersionUID = 1L;
  /** Constant for MT name, this is part of the classname, after <code>MT</code> */
  public static final String NAME = "517";
  // begin qualifiers constants
  /** Constant for qualifier with value AFFM */
  public static final String AFFM = "AFFM";
  /** Constant for qualifier with value BASK */
  public static final String BASK = "BASK";
  /** Constant for qualifier with value BUYR */
  public static final String BUYR = "BUYR";
  /** Constant for qualifier with value COLR */
  public static final String COLR = "COLR";
  /** Constant for qualifier with value COMM */
  public static final String COMM = "COMM";
  /** Constant for qualifier with value DEAG */
  public static final String DEAG = "DEAG";
  /** Constant for qualifier with value GENL */
  public static final String GENL = "GENL";
  /** Constant for qualifier with value INDX */
  public static final String INDX = "INDX";
  /** Constant for qualifier with value ISSU */
  public static final String ISSU = "ISSU";
  /** Constant for qualifier with value LINK */
  public static final String LINK = "LINK";
  /** Constant for qualifier with value LIST */
  public static final String LIST = "LIST";
  /** Constant for qualifier with value MAST */
  public static final String MAST = "MAST";
  /** Constant for qualifier with value PREP */
  public static final String PREP = "PREP";
  /** Constant for qualifier with value PREV */
  public static final String PREV = "PREV";
  /** Constant for qualifier with value PROG */
  public static final String PROG = "PROG";
  /** Constant for qualifier with value REAG */
  public static final String REAG = "REAG";
  /** Constant for qualifier with value RELA */
  public static final String RELA = "RELA";
  /** Constant for qualifier with value SELL */
  public static final String SELL = "SELL";
  /** Constant for qualifier with value SEME */
  public static final String SEME = "SEME";
  /** Constant for qualifier with value TRRF */
  public static final String TRRF = "TRRF";
  // end qualifiers constants
  private static final transient java.util.logging.Logger log =
      java.util.logging.Logger.getLogger(MT517.class.getName());

  /**
   * Creates an MT517 initialized with the parameter SwiftMessage
   *
   * @param m swift message with the MT517 content
   */
  public MT517(SwiftMessage m) {
    super(m);
  }

  /**
   * Creates an MT517 initialized with the parameter MtSwiftMessage
   *
   * @param m swift message with the MT517 content
   */
  public MT517(MtSwiftMessage m) {
    super(m);
  }

  /** Creates an MT517 initialized with a new SwiftMessage */
  /*
  public MT517() {
  	super();
  }
  */

  /**
   * Returns this MT number
   *
   * @return the message type number of this MT
   * @since 6.4
   */
  @Override
  public String getMessageType() {
    return "517";
  }

  /**
   * Iterates through block4 fields and return the first one whose name matches 23G, or <code>null
   * </code> if none is found.<br>
   * The first occurrence of field 23G at MT517 is expected to be the only one.
   *
   * @return a Field23G object or <code>null</code> if the field is not found
   * @see SwiftTagListBlock#getTagByName(String)
   * @throws IllegalStateException if SwiftMessage object is not initialized
   */
  public Field23G getField23G() {
    if (getSwiftMessage() == null) {
      throw new IllegalStateException("SwiftMessage was not initialized");
    }
    if (getSwiftMessage().getBlock4() == null) {
      log.info("block4 is null");
      return null;
    } else {
      final Tag t = getSwiftMessage().getBlock4().getTagByName("23G");
      if (t == null) {
        log.fine("field 23G not found");
        return null;
      } else {
        return new Field23G(t.getValue());
      }
    }
  }

  /**
   * Iterates through block4 fields and return the first one whose name matches 98A, or <code>null
   * </code> if none is found.<br>
   * The first occurrence of field 98A at MT517 is expected to be the only one.
   *
   * @return a Field98A object or <code>null</code> if the field is not found
   * @see SwiftTagListBlock#getTagByName(String)
   * @throws IllegalStateException if SwiftMessage object is not initialized
   */
  public Field98A getField98A() {
    if (getSwiftMessage() == null) {
      throw new IllegalStateException("SwiftMessage was not initialized");
    }
    if (getSwiftMessage().getBlock4() == null) {
      log.info("block4 is null");
      return null;
    } else {
      final Tag t = getSwiftMessage().getBlock4().getTagByName("98A");
      if (t == null) {
        log.fine("field 98A not found");
        return null;
      } else {
        return new Field98A(t.getValue());
      }
    }
  }

  /**
   * Iterates through block4 fields and return the first one whose name matches 98C, or <code>null
   * </code> if none is found.<br>
   * The first occurrence of field 98C at MT517 is expected to be the only one.
   *
   * @return a Field98C object or <code>null</code> if the field is not found
   * @see SwiftTagListBlock#getTagByName(String)
   * @throws IllegalStateException if SwiftMessage object is not initialized
   */
  public Field98C getField98C() {
    if (getSwiftMessage() == null) {
      throw new IllegalStateException("SwiftMessage was not initialized");
    }
    if (getSwiftMessage().getBlock4() == null) {
      log.info("block4 is null");
      return null;
    } else {
      final Tag t = getSwiftMessage().getBlock4().getTagByName("98C");
      if (t == null) {
        log.fine("field 98C not found");
        return null;
      } else {
        return new Field98C(t.getValue());
      }
    }
  }

  /**
   * Iterates through block4 fields and return the first one whose name matches 98E, or <code>null
   * </code> if none is found.<br>
   * The first occurrence of field 98E at MT517 is expected to be the only one.
   *
   * @return a Field98E object or <code>null</code> if the field is not found
   * @see SwiftTagListBlock#getTagByName(String)
   * @throws IllegalStateException if SwiftMessage object is not initialized
   */
  public Field98E getField98E() {
    if (getSwiftMessage() == null) {
      throw new IllegalStateException("SwiftMessage was not initialized");
    }
    if (getSwiftMessage().getBlock4() == null) {
      log.info("block4 is null");
      return null;
    } else {
      final Tag t = getSwiftMessage().getBlock4().getTagByName("98E");
      if (t == null) {
        log.fine("field 98E not found");
        return null;
      } else {
        return new Field98E(t.getValue());
      }
    }
  }

  /**
   * Iterates through block4 fields and return the first one whose name matches 25D, or <code>null
   * </code> if none is found.<br>
   * The first occurrence of field 25D at MT517 is expected to be the only one.
   *
   * @return a Field25D object or <code>null</code> if the field is not found
   * @see SwiftTagListBlock#getTagByName(String)
   * @throws IllegalStateException if SwiftMessage object is not initialized
   */
  public Field25D getField25D() {
    if (getSwiftMessage() == null) {
      throw new IllegalStateException("SwiftMessage was not initialized");
    }
    if (getSwiftMessage().getBlock4() == null) {
      log.info("block4 is null");
      return null;
    } else {
      final Tag t = getSwiftMessage().getBlock4().getTagByName("25D");
      if (t == null) {
        log.fine("field 25D not found");
        return null;
      } else {
        return new Field25D(t.getValue());
      }
    }
  }

  /**
   * Iterates through block4 fields and return all occurrences of fields whose names matches 95P, or
   * <code>Collections.emptyList()</code> if none is found.<br>
   * Multiple occurrences of field 95P at MT517 are expected at one sequence or across several
   * sequences.
   *
   * @return a List of Field95P objects or <code>Collections.emptyList()</code> if none is not found
   * @see SwiftTagListBlock#getTagsByName(String)
   * @throws IllegalStateException if SwiftMessage object is not initialized
   */
  public List<Field95P> getField95P() {
    if (getSwiftMessage() == null) {
      throw new IllegalStateException("SwiftMessage was not initialized");
    }
    if (getSwiftMessage().getBlock4() == null) {
      log.info("block4 is null");
      return Collections.emptyList();
    } else {
      final Tag[] tags = getSwiftMessage().getBlock4().getTagsByName("95P");
      final List<Field95P> result = new ArrayList<Field95P>();
      for (int i = 0; i < tags.length; i++) {
        result.add(new Field95P(tags[i].getValue()));
      }
      return result;
    }
  }

  /**
   * Iterates through block4 fields and return all occurrences of fields whose names matches 95Q, or
   * <code>Collections.emptyList()</code> if none is found.<br>
   * Multiple occurrences of field 95Q at MT517 are expected at one sequence or across several
   * sequences.
   *
   * @return a List of Field95Q objects or <code>Collections.emptyList()</code> if none is not found
   * @see SwiftTagListBlock#getTagsByName(String)
   * @throws IllegalStateException if SwiftMessage object is not initialized
   */
  public List<Field95Q> getField95Q() {
    if (getSwiftMessage() == null) {
      throw new IllegalStateException("SwiftMessage was not initialized");
    }
    if (getSwiftMessage().getBlock4() == null) {
      log.info("block4 is null");
      return Collections.emptyList();
    } else {
      final Tag[] tags = getSwiftMessage().getBlock4().getTagsByName("95Q");
      final List<Field95Q> result = new ArrayList<Field95Q>();
      for (int i = 0; i < tags.length; i++) {
        result.add(new Field95Q(tags[i].getValue()));
      }
      return result;
    }
  }

  /**
   * Iterates through block4 fields and return all occurrences of fields whose names matches 95R, or
   * <code>Collections.emptyList()</code> if none is found.<br>
   * Multiple occurrences of field 95R at MT517 are expected at one sequence or across several
   * sequences.
   *
   * @return a List of Field95R objects or <code>Collections.emptyList()</code> if none is not found
   * @see SwiftTagListBlock#getTagsByName(String)
   * @throws IllegalStateException if SwiftMessage object is not initialized
   */
  public List<Field95R> getField95R() {
    if (getSwiftMessage() == null) {
      throw new IllegalStateException("SwiftMessage was not initialized");
    }
    if (getSwiftMessage().getBlock4() == null) {
      log.info("block4 is null");
      return Collections.emptyList();
    } else {
      final Tag[] tags = getSwiftMessage().getBlock4().getTagsByName("95R");
      final List<Field95R> result = new ArrayList<Field95R>();
      for (int i = 0; i < tags.length; i++) {
        result.add(new Field95R(tags[i].getValue()));
      }
      return result;
    }
  }

  /**
   * Iterates through block4 fields and return all occurrences of fields whose names matches 16R, or
   * <code>Collections.emptyList()</code> if none is found.<br>
   * Multiple occurrences of field 16R at MT517 are expected at one sequence or across several
   * sequences.
   *
   * @return a List of Field16R objects or <code>Collections.emptyList()</code> if none is not found
   * @see SwiftTagListBlock#getTagsByName(String)
   * @throws IllegalStateException if SwiftMessage object is not initialized
   */
  public List<Field16R> getField16R() {
    if (getSwiftMessage() == null) {
      throw new IllegalStateException("SwiftMessage was not initialized");
    }
    if (getSwiftMessage().getBlock4() == null) {
      log.info("block4 is null");
      return Collections.emptyList();
    } else {
      final Tag[] tags = getSwiftMessage().getBlock4().getTagsByName("16R");
      final List<Field16R> result = new ArrayList<Field16R>();
      for (int i = 0; i < tags.length; i++) {
        result.add(new Field16R(tags[i].getValue()));
      }
      return result;
    }
  }

  /**
   * Iterates through block4 fields and return all occurrences of fields whose names matches 13A, or
   * <code>Collections.emptyList()</code> if none is found.<br>
   * Multiple occurrences of field 13A at MT517 are expected at one sequence or across several
   * sequences.
   *
   * @return a List of Field13A objects or <code>Collections.emptyList()</code> if none is not found
   * @see SwiftTagListBlock#getTagsByName(String)
   * @throws IllegalStateException if SwiftMessage object is not initialized
   */
  public List<Field13A> getField13A() {
    if (getSwiftMessage() == null) {
      throw new IllegalStateException("SwiftMessage was not initialized");
    }
    if (getSwiftMessage().getBlock4() == null) {
      log.info("block4 is null");
      return Collections.emptyList();
    } else {
      final Tag[] tags = getSwiftMessage().getBlock4().getTagsByName("13A");
      final List<Field13A> result = new ArrayList<Field13A>();
      for (int i = 0; i < tags.length; i++) {
        result.add(new Field13A(tags[i].getValue()));
      }
      return result;
    }
  }

  /**
   * Iterates through block4 fields and return all occurrences of fields whose names matches 13B, or
   * <code>Collections.emptyList()</code> if none is found.<br>
   * Multiple occurrences of field 13B at MT517 are expected at one sequence or across several
   * sequences.
   *
   * @return a List of Field13B objects or <code>Collections.emptyList()</code> if none is not found
   * @see SwiftTagListBlock#getTagsByName(String)
   * @throws IllegalStateException if SwiftMessage object is not initialized
   */
  public List<Field13B> getField13B() {
    if (getSwiftMessage() == null) {
      throw new IllegalStateException("SwiftMessage was not initialized");
    }
    if (getSwiftMessage().getBlock4() == null) {
      log.info("block4 is null");
      return Collections.emptyList();
    } else {
      final Tag[] tags = getSwiftMessage().getBlock4().getTagsByName("13B");
      final List<Field13B> result = new ArrayList<Field13B>();
      for (int i = 0; i < tags.length; i++) {
        result.add(new Field13B(tags[i].getValue()));
      }
      return result;
    }
  }

  /**
   * Iterates through block4 fields and return all occurrences of fields whose names matches 20C, or
   * <code>Collections.emptyList()</code> if none is found.<br>
   * Multiple occurrences of field 20C at MT517 are expected at one sequence or across several
   * sequences.
   *
   * @return a List of Field20C objects or <code>Collections.emptyList()</code> if none is not found
   * @see SwiftTagListBlock#getTagsByName(String)
   * @throws IllegalStateException if SwiftMessage object is not initialized
   */
  public List<Field20C> getField20C() {
    if (getSwiftMessage() == null) {
      throw new IllegalStateException("SwiftMessage was not initialized");
    }
    if (getSwiftMessage().getBlock4() == null) {
      log.info("block4 is null");
      return Collections.emptyList();
    } else {
      final Tag[] tags = getSwiftMessage().getBlock4().getTagsByName("20C");
      final List<Field20C> result = new ArrayList<Field20C>();
      for (int i = 0; i < tags.length; i++) {
        result.add(new Field20C(tags[i].getValue()));
      }
      return result;
    }
  }

  /**
   * Iterates through block4 fields and return all occurrences of fields whose names matches 16S, or
   * <code>Collections.emptyList()</code> if none is found.<br>
   * Multiple occurrences of field 16S at MT517 are expected at one sequence or across several
   * sequences.
   *
   * @return a List of Field16S objects or <code>Collections.emptyList()</code> if none is not found
   * @see SwiftTagListBlock#getTagsByName(String)
   * @throws IllegalStateException if SwiftMessage object is not initialized
   */
  public List<Field16S> getField16S() {
    if (getSwiftMessage() == null) {
      throw new IllegalStateException("SwiftMessage was not initialized");
    }
    if (getSwiftMessage().getBlock4() == null) {
      log.info("block4 is null");
      return Collections.emptyList();
    } else {
      final Tag[] tags = getSwiftMessage().getBlock4().getTagsByName("16S");
      final List<Field16S> result = new ArrayList<Field16S>();
      for (int i = 0; i < tags.length; i++) {
        result.add(new Field16S(tags[i].getValue()));
      }
      return result;
    }
  }

  /*
   * sequences code
   *
   */

  public static class SequenceA extends SwiftTagListBlock {
    private static final long serialVersionUID = 1L;

    /** Constructs an empty sequence */
    private SequenceA() {
      super(new ArrayList<Tag>());
    }
    /**
     * Creates a sequence with the given content.
     *
     * @see SwiftTagListBlock
     */
    private SequenceA(final SwiftTagListBlock content) {
      super(content.getTags());
    }
    /**
     * Value for the qualifier of the 16R / 16S tag that indicates start and end of this sequence
     * <em>GENL</em>
     */
    public static final String START_END_16RS = "GENL";

    public static final Tag START_TAG = new Tag(Field16R.NAME, START_END_16RS);
    public static final Tag END_TAG = new Tag(Field16S.NAME, START_END_16RS);
    /**
     * Creates a new instance of this sequence with the given tags inside.
     *
     * @param tags may be null, an empty sequence containing only start and end sequence tags will
     *     be returned
     */
    public static SequenceA newInstance(final Tag... tags) {
      final SequenceA result = new SequenceA();

      result.addTag(START_TAG);

      if (tags != null && tags.length > 0) {
        for (final Tag t : tags) {
          result.addTag(t);
        }
      }

      result.addTag(END_TAG);

      return result;
    }

    private SequenceA(final SwiftMessage m) {
      super(m.getBlock4().getSubBlock(START_END_16RS).getTags());
    }
  }

  /**
   * Get the single occurrence of SequenceA delimited by 16R/16S {@value SequenceA#START_END_16RS}.
   * The presence of this methods indicates that this sequence can occur only once according to the
   * Standard. <em>NOTE: this method never returns <code>null</code>. If the sequence is not found
   * an empty instance of <code>SequenceA</code> is returned</em>
   */
  public SequenceA getSequenceA() {
    return new SequenceA(this.getSwiftMessage());
  }

  public static class SequenceA1 extends SwiftTagListBlock {
    private static final long serialVersionUID = 1L;

    /** Constructs an empty sequence */
    private SequenceA1() {
      super(new ArrayList<Tag>());
    }
    /**
     * Creates a sequence with the given content.
     *
     * @see SwiftTagListBlock
     */
    private SequenceA1(final SwiftTagListBlock content) {
      super(content.getTags());
    }
    /**
     * Value for the qualifier of the 16R / 16S tag that indicates start and end of this sequence
     * <em>LINK</em>
     */
    public static final String START_END_16RS = "LINK";

    public static final Tag START_TAG = new Tag(Field16R.NAME, START_END_16RS);
    public static final Tag END_TAG = new Tag(Field16S.NAME, START_END_16RS);
    /**
     * Creates a new instance of this sequence with the given tags inside.
     *
     * @param tags may be null, an empty sequence containing only start and end sequence tags will
     *     be returned
     */
    public static SequenceA1 newInstance(final Tag... tags) {
      final SequenceA1 result = new SequenceA1();

      result.addTag(START_TAG);

      if (tags != null && tags.length > 0) {
        for (final Tag t : tags) {
          result.addTag(t);
        }
      }

      result.addTag(END_TAG);

      return result;
    }

    private SequenceA1(final SwiftMessage m) {
      super(m.getBlock4().getSubBlock(START_END_16RS).getTags());
    }
  }

  /**
   * Get the list of SequenceA1 delimited by 16R/16S {@value SequenceA1#START_END_16RS} The presence
   * of this methods indicates that this sequence can occur more than once according to the
   * Standard. If message is empty or nor sequences are found <em>an empty list</em> is returned.
   */
  public List<SequenceA1> getSequenceA1List() {
    final List<SwiftTagListBlock> blocks =
        getSwiftMessage().getBlock4().getSubBlocks(SequenceA1.START_END_16RS);
    if (blocks != null && !blocks.isEmpty()) {
      final List<SequenceA1> result = new ArrayList<SequenceA1>(blocks.size());
      for (final SwiftTagListBlock b : blocks) {
        result.add(new SequenceA1(b));
      }
      return result;
    }
    // TODO if is is mandatory issue a warning log
    return Collections.emptyList();
  }
}
Example #8
0
/**
 * MT 798<br>
 * <br>
 * <em>NOTE: this source code has been generated from template</em>
 *
 * @author www.prowidesoftware.com
 */
public class MT798 extends AbstractMT implements Serializable {
  private static final long serialVersionUID = 1L;
  /** Constant for MT name, this is part of the classname, after <code>MT</code> */
  public static final String NAME = "798";
  // begin qualifiers constants
  // end qualifiers constants
  private static final transient java.util.logging.Logger log =
      java.util.logging.Logger.getLogger(MT798.class.getName());

  /**
   * Creates an MT798 initialized with the parameter SwiftMessage
   *
   * @param m swift message with the MT798 content
   */
  public MT798(SwiftMessage m) {
    super(m);
  }

  /**
   * Creates an MT798 initialized with the parameter MtSwiftMessage
   *
   * @param m swift message with the MT798 content
   */
  public MT798(MtSwiftMessage m) {
    super(m);
  }

  /** Creates an MT798 initialized with a new SwiftMessage */
  /*
  public MT798() {
  	super();
  }
  */

  /**
   * Returns this MT number
   *
   * @return the message type number of this MT
   * @since 6.4
   */
  @Override
  public String getMessageType() {
    return "798";
  }

  /**
   * Iterates through block4 fields and return the first one whose name matches 20, or <code>null
   * </code> if none is found.<br>
   * The first occurrence of field 20 at MT798 is expected to be the only one.
   *
   * @return a Field20 object or <code>null</code> if the field is not found
   * @see SwiftTagListBlock#getTagByName(String)
   * @throws IllegalStateException if SwiftMessage object is not initialized
   */
  public Field20 getField20() {
    if (getSwiftMessage() == null) {
      throw new IllegalStateException("SwiftMessage was not initialized");
    }
    if (getSwiftMessage().getBlock4() == null) {
      log.info("block4 is null");
      return null;
    } else {
      final Tag t = getSwiftMessage().getBlock4().getTagByName("20");
      if (t == null) {
        log.fine("field 20 not found");
        return null;
      } else {
        return new Field20(t.getValue());
      }
    }
  }

  /**
   * Iterates through block4 fields and return the first one whose name matches 12, or <code>null
   * </code> if none is found.<br>
   * The first occurrence of field 12 at MT798 is expected to be the only one.
   *
   * @return a Field12 object or <code>null</code> if the field is not found
   * @see SwiftTagListBlock#getTagByName(String)
   * @throws IllegalStateException if SwiftMessage object is not initialized
   */
  public Field12 getField12() {
    if (getSwiftMessage() == null) {
      throw new IllegalStateException("SwiftMessage was not initialized");
    }
    if (getSwiftMessage().getBlock4() == null) {
      log.info("block4 is null");
      return null;
    } else {
      final Tag t = getSwiftMessage().getBlock4().getTagByName("12");
      if (t == null) {
        log.fine("field 12 not found");
        return null;
      } else {
        return new Field12(t.getValue());
      }
    }
  }

  /**
   * Iterates through block4 fields and return the first one whose name matches 77E, or <code>null
   * </code> if none is found.<br>
   * The first occurrence of field 77E at MT798 is expected to be the only one.
   *
   * @return a Field77E object or <code>null</code> if the field is not found
   * @see SwiftTagListBlock#getTagByName(String)
   * @throws IllegalStateException if SwiftMessage object is not initialized
   */
  public Field77E getField77E() {
    if (getSwiftMessage() == null) {
      throw new IllegalStateException("SwiftMessage was not initialized");
    }
    if (getSwiftMessage().getBlock4() == null) {
      log.info("block4 is null");
      return null;
    } else {
      final Tag t = getSwiftMessage().getBlock4().getTagByName("77E");
      if (t == null) {
        log.fine("field 77E not found");
        return null;
      } else {
        return new Field77E(t.getValue());
      }
    }
  }

  /*
   * sequences code
   *
   */

}