/**
  * Get a list of all occurrences of the field Field29F from the given block an empty list is
  * returned if none found.
  *
  * @param block may be empty or null in which case an empty list is returned
  */
 public static java.util.List<Field29F> getAll(final SwiftTagListBlock block) {
   if (block == null || block.isEmpty()) {
     return null;
   }
   final Field[] arr = block.getFieldsByName(NAME);
   if (arr != null && arr.length > 0) {
     final java.util.ArrayList<Field29F> result = new java.util.ArrayList<Field29F>(arr.length);
     for (final Field f : arr) {
       result.add((Field29F) f);
     }
     return result;
   }
   return java.util.Collections.emptyList();
 }
Exemple #2
0
    /**
     * 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;
    }
 /**
  * Get the first occurrence form the tag list or null if not found.
  *
  * @return null if not found o block is null or empty
  * @param block may be null or empty
  */
 public static Field29F get(final SwiftTagListBlock block) {
   if (block == null || block.isEmpty()) {
     return null;
   }
   return (Field29F) block.getFieldByName(NAME);
 }
Exemple #4
0
 /**
  * Creates a sequence with the given content.
  *
  * @see SwiftTagListBlock
  */
 private SequenceB(final SwiftTagListBlock content) {
   super(content.getTags());
 }