text:
package com.prowidesoftware.swift.model.mt.mt5xx;

import com.prowidesoftware.Generated;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
import java.util.Collections;

import org.apache.commons.lang3.StringUtils;

import com.prowidesoftware.swift.model.*;
import com.prowidesoftware.swift.internal.*;
import com.prowidesoftware.swift.internal.SequenceStyle.Type;
import com.prowidesoftware.swift.model.field.*;
import com.prowidesoftware.swift.model.mt.AbstractMT;
import com.prowidesoftware.swift.utils.Lib;
import java.io.File;
import java.io.InputStream;
import java.io.IOException;

/**
 * MT 568 - Corporate Action Narrative.
 *
 *

 * SWIFT MT568 (ISO 15022) message structure:
 *

Sequence A - General Information (M)

Field 16 R (M)

Field 28 E (O)

Fieldset 20
 (M) (repetitive)

FieldsetItem 20 C (M)

FieldsetItem 20 C (M)

FieldsetItem 20 C (O)

Field 23 G (M)

Field 22 F (M)

Field 98 A,C (O)

Sequence A1 - Linkages (O) (repetitive)

Field 16 R (M)

Field 22 F (O)

Field 13 A,B (O)

Field 20 C (M)

Field 16 S (M)

Field 16 S (M)

Sequence B - Underlying Securities (O)

Field 16 R (M)

Field 95 P,R (O)

Field 97 A,C,D (M)

Field 94 B,C,F (O)

Field 35 B (O)

Sequence B1 - Financial Instrument Attributes (O)

Field 16 R (M)

Field 94 B (O)

Field 22 F (O)

Field 12 A,C (O)

Field 11 A (O)

Fieldset 98
 (O)

FieldsetItem 98 A (O)

FieldsetItem 98 A (O)

FieldsetItem 98 A (O)

FieldsetItem 98 A (O)

FieldsetItem 98 A (O)

FieldsetItem 98 A (O)

FieldsetItem 98 A (O)

FieldsetItem 98 A (O)

FieldsetItem 98 A (O)

Fieldset 92
 (O)

FieldsetItem 92 A (O)

FieldsetItem 92 A (O)

FieldsetItem 92 A (O)

FieldsetItem 92 A (O)

Fieldset 36
 (O)

FieldsetItem 36 B,D (O)

FieldsetItem 36 B,D (O)

Field 16 S (M)

Fieldset 93
 (O) (repetitive)

FieldsetItem 93 B,F (O) (repetitive)

FieldsetItem 93 B,C,E (O)

FieldsetItem 93 B,C,E (O)

FieldsetItem 93 B,C,E (O)

FieldsetItem 93 B,C,E (O)

FieldsetItem 93 B,C,E (O)

FieldsetItem 93 B,C,E (O) (repetitive)

FieldsetItem 93 B,C,E (O) (repetitive)

FieldsetItem 93 B,C,E (O)

FieldsetItem 93 B,C,E (O)

FieldsetItem 93 B,C,E (O)

FieldsetItem 93 B,C,E (O)

FieldsetItem 93 B,C,E (O)

FieldsetItem 93 B,C,E (O)

FieldsetItem 93 B,C,E (O)

Field 16 S (M)

Sequence C - Additional Information (M)

Field 16 R (M)

Fieldset 70
 (O) (repetitive)

FieldsetItem 70 E,F (O) (repetitive)

FieldsetItem 70 E,F (O) (repetitive)

FieldsetItem 70 E,F (O) (repetitive)

FieldsetItem 70 E,F (O) (repetitive)

FieldsetItem 70 E (O) (repetitive)

FieldsetItem 70 E,F (O) (repetitive)

FieldsetItem 70 E,F (O) (repetitive)

FieldsetItem 70 E,F (O) (repetitive)

FieldsetItem 70 E,F (O) (repetitive)

FieldsetItem 70 E,F (O) (repetitive)

FieldsetItem 70 E,F (O) (repetitive)

Fieldset 95
 (O) (repetitive)

FieldsetItem 95 P,Q,R (O)

FieldsetItem 95 P,Q,R (O)

Field 16 S (M)

 *
 *

 * This source code is specific to release SRU 2022
 *

 * For additional resources check https://www.prowidesoftware.com/resources
 */
@Generated
public class MT568 extends AbstractMT implements Serializable {
	/**
	 * Constant identifying the SRU to which this class belongs to.
	 */
	public static final int SRU = 2022;
	private static final long serialVersionUID = 1L;
	private static final java.util.logging.Logger log = java.util.logging.Logger.getLogger(MT568.class.getName());

	/**
	 * Constant for MT name, this is part of the classname, after MT.
	 */
	public static final String NAME = "568";

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

	/**
	 * Creates an MT568 initialized with the parameter MtSwiftMessage.
	 * @param m swift message with the MT568 content, the parameter can not be null
	 * @see #MT568(String)
	 */
	public MT568(final MtSwiftMessage m) {
		this(m.message());
	}

	/**
	 * Creates an MT568 initialized with the parameter MtSwiftMessage.
	 *
	 * @param m swift message with the MT568 content
	 * @return the created object or null if the parameter is null
	 * @see #MT568(String)
	 * @since 7.7
	 */
	public static MT568 parse(final MtSwiftMessage m) {
		if (m == null) {
			return null;
		}
		return new MT568(m);
	}

	/**
	 * Creates and initializes a new MT568 input message setting TEST BICS as sender and receiver.
	 * All mandatory header attributes are completed with default values.
	 *
	 * @since 7.6
	 */
	public MT568() {
		this(BIC.TEST8, BIC.TEST8);
	}

	/**
	 * Creates and initializes a new MT568 input message from sender to receiver.
	 * 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 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.7
	 */
	public MT568(final String sender, final String receiver) {
		super(568, sender, receiver);
	}

	/**
	 * Creates a new MT568 by parsing a String with the message content in its swift FIN format.
	 * If the fin parameter is null or the message cannot be parsed, the internal message object
	 * will be initialized (blocks will be created) but empty.
	 * If the string contains multiple messages, only the first one will be parsed.
	 *
	 * @param fin a string with the MT message in its FIN swift format
	 * @since 7.7
	 */
	public MT568(final String fin) {
		super();
		if (fin != null) {
			final SwiftMessage parsed = read(fin);
			if (parsed != null) {
				super.m = parsed;
				sanityCheck(parsed);
			}
		}
    }

    private void sanityCheck(final SwiftMessage param) {
    	if (param.isServiceMessage()) {
			log.warning("Creating an MT568 object from FIN content with a Service Message. Check if the MT568 you are intended to read is prepended with and ACK.");
		} else if (!StringUtils.equals(param.getType(), "568")) {
			log.warning("Creating an MT568 object from FIN content with message type "+param.getType());
		}
    }

	/**
	 * Creates a new MT568 by parsing a String with the message content in its swift FIN format.
	 * If the fin parameter cannot be parsed, the returned MT568 will have its internal message object
	 * initialized (blocks will be created) but empty.
	 * If the string contains multiple messages, only the first one will be parsed.
	 *
	 * @param fin a string with the MT message in its FIN swift format. fin may be null in which case this method returns null
	 * @return a new instance of MT568 or null if fin is null
	 * @since 7.7
	 */
	public static MT568 parse(final String fin) {
		if (fin == null) {
			return null;
		}
		return new MT568(fin);
    }

    /**
	 * Creates a new MT568 by parsing a input stream with the message content in its swift FIN format, using "UTF-8" as encoding.
	 * If the message content is null or cannot be parsed, the internal message object
	 * will be initialized (blocks will be created) but empty.
	 * If the stream contains multiple messages, only the first one will be parsed.
	 *
	 * @param stream an input stream in UTF-8 encoding with the MT message in its FIN swift format.
	 * @throws IOException if the stream data cannot be read
	 * @since 7.7
	 */
	public MT568(final InputStream stream) throws IOException {
		this(Lib.readStream(stream));
    }

    /**
	 * Creates a new MT568 by parsing a input stream with the message content in its swift FIN format, using "UTF-8" as encoding.
	 * If the stream contains multiple messages, only the first one will be parsed.
	 *
	 * @param stream an input stream in UTF-8 encoding with the MT message in its FIN swift format.
	 * @return a new instance of MT568 or null if stream is null or the message cannot be parsed
	 * @throws IOException if the stream data cannot be read
	 * @since 7.7
	 */
	public static MT568 parse(final InputStream stream) throws IOException {
		if (stream == null) {
			return null;
		}
		return new MT568(stream);
    }

    /**
	 * Creates a new MT568 by parsing a file with the message content in its swift FIN format.
	 * If the file content is null or cannot be parsed as a message, the internal message object
	 * will be initialized (blocks will be created) but empty.
	 * If the file contains multiple messages, only the first one will be parsed.
	 *
	 * @param file a file with the MT message in its FIN swift format.
	 * @throws IOException if the file content cannot be read
	 * @since 7.7
	 */
	public MT568(final File file) throws IOException {
		this(Lib.readFile(file));
    }

    /**
	 * Creates a new MT568 by parsing a file with the message content in its swift FIN format.
	 * If the file contains multiple messages, only the first one will be parsed.
	 *
	 * @param file a file with the MT message in its FIN swift format.
	 * @return a new instance of MT568 or null if; file is null, does not exist, can't be read, is not a file or the message cannot be parsed
	 * @throws IOException if the file content cannot be read
	 * @since 7.7
	 */
	public static MT568 parse(final File file) throws IOException {
		if (file == null) {
			return null;
		}
		return new MT568(file);
    }

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

	/**
	 * 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 MT568 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 MT568 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 MT568 append(final Field... fields) {
		super.append(fields);
		return this;
	}

   /**
	* Creates an MT568 messages from its JSON representation.
	*

	* For generic conversion of JSON into the corresponding MT instance
	* see {@link AbstractMT#fromJson(String)}
	*
	* @param json a JSON representation of an MT568 message
	* @return a new instance of MT568
	* @since 7.10.3
	*/
	public static MT568 fromJson(final String json) {
		return (MT568) AbstractMT.fromJson(json);
	}

	/**
	 * Iterates through block4 fields and return the first one whose name matches 28E,
	 * or null if none is found.
	 * The first occurrence of field 28E at MT568 is expected to be the only one.
	 *
	 * @return a Field28E object or null if the field is not found
	 * @see SwiftTagListBlock#getTagByName(String)
	 * @throws IllegalStateException if SwiftMessage object is not initialized
	 */
	public Field28E getField28E() {
		final Tag t = tag("28E");
		if (t != null) {
			return new Field28E(t.getValue());
		} else {
			return null;
		}
	}

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

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

	/**
	 * Iterates through block4 fields and return the first one whose name matches 97A,
	 * or null if none is found.
	 * The first occurrence of field 97A at MT568 is expected to be the only one.
	 *
	 * @return a Field97A object or null if the field is not found
	 * @see SwiftTagListBlock#getTagByName(String)
	 * @throws IllegalStateException if SwiftMessage object is not initialized
	 */
	public Field97A getField97A() {
		final Tag t = tag("97A");
		if (t != null) {
			return new Field97A(t.getValue());
		} else {
			return null;
		}
	}

	/**
	 * Iterates through block4 fields and return the first one whose name matches 97C,
	 * or null if none is found.
	 * The first occurrence of field 97C at MT568 is expected to be the only one.
	 *
	 * @return a Field97C object or null if the field is not found
	 * @see SwiftTagListBlock#getTagByName(String)
	 * @throws IllegalStateException if SwiftMessage object is not initialized
	 */
	public Field97C getField97C() {
		final Tag t = tag("97C");
		if (t != null) {
			return new Field97C(t.getValue());
		} else {
			return null;
		}
	}

	/**
	 * Iterates through block4 fields and return the first one whose name matches 97D,
	 * or null if none is found.
	 * The first occurrence of field 97D at MT568 is expected to be the only one.
	 *
	 * @return a Field97D object or null if the field is not found
	 * @see SwiftTagListBlock#getTagByName(String)
	 * @throws IllegalStateException if SwiftMessage object is not initialized
	 */
	public Field97D getField97D() {
		final Tag t = tag("97D");
		if (t != null) {
			return new Field97D(t.getValue());
		} else {
			return null;
		}
	}

	/**
	 * Iterates through block4 fields and return the first one whose name matches 94C,
	 * or null if none is found.
	 * The first occurrence of field 94C at MT568 is expected to be the only one.
	 *
	 * @return a Field94C object or null if the field is not found
	 * @see SwiftTagListBlock#getTagByName(String)
	 * @throws IllegalStateException if SwiftMessage object is not initialized
	 */
	public Field94C getField94C() {
		final Tag t = tag("94C");
		if (t != null) {
			return new Field94C(t.getValue());
		} else {
			return null;
		}
	}

	/**
	 * Iterates through block4 fields and return the first one whose name matches 94F,
	 * or null if none is found.
	 * The first occurrence of field 94F at MT568 is expected to be the only one.
	 *
	 * @return a Field94F object or null if the field is not found
	 * @see SwiftTagListBlock#getTagByName(String)
	 * @throws IllegalStateException if SwiftMessage object is not initialized
	 */
	public Field94F getField94F() {
		final Tag t = tag("94F");
		if (t != null) {
			return new Field94F(t.getValue());
		} else {
			return null;
		}
	}

	/**
	 * Iterates through block4 fields and return the first one whose name matches 35B,
	 * or null if none is found.
	 * The first occurrence of field 35B at MT568 is expected to be the only one.
	 *
	 * @return a Field35B object or null if the field is not found
	 * @see SwiftTagListBlock#getTagByName(String)
	 * @throws IllegalStateException if SwiftMessage object is not initialized
	 */
	public Field35B getField35B() {
		final Tag t = tag("35B");
		if (t != null) {
			return new Field35B(t.getValue());
		} else {
			return null;
		}
	}

	/**
	 * Iterates through block4 fields and return the first one whose name matches 12A,
	 * or null if none is found.
	 * The first occurrence of field 12A at MT568 is expected to be the only one.
	 *
	 * @return a Field12A object or null if the field is not found
	 * @see SwiftTagListBlock#getTagByName(String)
	 * @throws IllegalStateException if SwiftMessage object is not initialized
	 */
	public Field12A getField12A() {
		final Tag t = tag("12A");
		if (t != null) {
			return new Field12A(t.getValue());
		} else {
			return null;
		}
	}

	/**
	 * Iterates through block4 fields and return the first one whose name matches 12C,
	 * or null if none is found.
	 * The first occurrence of field 12C at MT568 is expected to be the only one.
	 *
	 * @return a Field12C object or null if the field is not found
	 * @see SwiftTagListBlock#getTagByName(String)
	 * @throws IllegalStateException if SwiftMessage object is not initialized
	 */
	public Field12C getField12C() {
		final Tag t = tag("12C");
		if (t != null) {
			return new Field12C(t.getValue());
		} else {
			return null;
		}
	}

	/**
	 * Iterates through block4 fields and return the first one whose name matches 11A,
	 * or null if none is found.
	 * The first occurrence of field 11A at MT568 is expected to be the only one.
	 *
	 * @return a Field11A object or null if the field is not found
	 * @see SwiftTagListBlock#getTagByName(String)
	 * @throws IllegalStateException if SwiftMessage object is not initialized
	 */
	public Field11A getField11A() {
		final Tag t = tag("11A");
		if (t != null) {
			return new Field11A(t.getValue());
		} else {
			return null;
		}
	}

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

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

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

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

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

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

	/**
	 * Iterates through block4 fields and return all occurrences of fields whose names matches 94B,
	 * or Collections.emptyList() if none is found.
	 * Multiple occurrences of field 94B at MT568 are expected at one sequence or across several sequences.
	 *
	 * @return a List of Field94B objects or Collections.emptyList() if none is not found
	 * @see SwiftTagListBlock#getTagsByName(String)
	 * @throws IllegalStateException if SwiftMessage object is not initialized
	 */
	public List<Field94B> getField94B() {
		final List<Field94B> result = new ArrayList<>();
		final Tag[] tags = tags("94B");
		if (tags != null && tags.length > 0) {
            for (Tag tag : tags) {
                result.add(new Field94B(tag.getValue()));
            }
		}
		return result;
	}

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

	/**
	 * Iterates through block4 fields and return all occurrences of fields whose names matches 92A,
	 * or Collections.emptyList() if none is found.
	 * Multiple occurrences of field 92A at MT568 are expected at one sequence or across several sequences.
	 *
	 * @return a List of Field92A objects or Collections.emptyList() if none is not found
	 * @see SwiftTagListBlock#getTagsByName(String)
	 * @throws IllegalStateException if SwiftMessage object is not initialized
	 */
	public List<Field92A> getField92A() {
		final List<Field92A> result = new ArrayList<>();
		final Tag[] tags = tags("92A");
		if (tags != null && tags.length > 0) {
            for (Tag tag : tags) {
                result.add(new Field92A(tag.getValue()));
            }
		}
		return result;
	}

	/**
	 * Iterates through block4 fields and return all occurrences of fields whose names matches 36B,
	 * or Collections.emptyList() if none is found.
	 * Multiple occurrences of field 36B at MT568 are expected at one sequence or across several sequences.
	 *
	 * @return a List of Field36B objects or Collections.emptyList() if none is not found
	 * @see SwiftTagListBlock#getTagsByName(String)
	 * @throws IllegalStateException if SwiftMessage object is not initialized
	 */
	public List<Field36B> getField36B() {
		final List<Field36B> result = new ArrayList<>();
		final Tag[] tags = tags("36B");
		if (tags != null && tags.length > 0) {
            for (Tag tag : tags) {
                result.add(new Field36B(tag.getValue()));
            }
		}
		return result;
	}

	/**
	 * Iterates through block4 fields and return all occurrences of fields whose names matches 36D,
	 * or Collections.emptyList() if none is found.
	 * Multiple occurrences of field 36D at MT568 are expected at one sequence or across several sequences.
	 *
	 * @return a List of Field36D objects or Collections.emptyList() if none is not found
	 * @see SwiftTagListBlock#getTagsByName(String)
	 * @throws IllegalStateException if SwiftMessage object is not initialized
	 */
	public List<Field36D> getField36D() {
		final List<Field36D> result = new ArrayList<>();
		final Tag[] tags = tags("36D");
		if (tags != null && tags.length > 0) {
            for (Tag tag : tags) {
                result.add(new Field36D(tag.getValue()));
            }
		}
		return result;
	}

	/**
	 * Iterates through block4 fields and return all occurrences of fields whose names matches 93B,
	 * or Collections.emptyList() if none is found.
	 * Multiple occurrences of field 93B at MT568 are expected at one sequence or across several sequences.
	 *
	 * @return a List of Field93B objects or Collections.emptyList() if none is not found
	 * @see SwiftTagListBlock#getTagsByName(String)
	 * @throws IllegalStateException if SwiftMessage object is not initialized
	 */
	public List<Field93B> getField93B() {
		final List<Field93B> result = new ArrayList<>();
		final Tag[] tags = tags("93B");
		if (tags != null && tags.length > 0) {
            for (Tag tag : tags) {
                result.add(new Field93B(tag.getValue()));
            }
		}
		return result;
	}

	/**
	 * Iterates through block4 fields and return all occurrences of fields whose names matches 93C,
	 * or Collections.emptyList() if none is found.
	 * Multiple occurrences of field 93C at MT568 are expected at one sequence or across several sequences.
	 *
	 * @return a List of Field93C objects or Collections.emptyList() if none is not found
	 * @see SwiftTagListBlock#getTagsByName(String)
	 * @throws IllegalStateException if SwiftMessage object is not initialized
	 */
	public List<Field93C> getField93C() {
		final List<Field93C> result = new ArrayList<>();
		final Tag[] tags = tags("93C");
		if (tags != null && tags.length > 0) {
            for (Tag tag : tags) {
                result.add(new Field93C(tag.getValue()));
            }
		}
		return result;
	}

	/**
	 * Iterates through block4 fields and return all occurrences of fields whose names matches 93E,
	 * or Collections.emptyList() if none is found.
	 * Multiple occurrences of field 93E at MT568 are expected at one sequence or across several sequences.
	 *
	 * @return a List of Field93E objects or Collections.emptyList() if none is not found
	 * @see SwiftTagListBlock#getTagsByName(String)
	 * @throws IllegalStateException if SwiftMessage object is not initialized
	 */
	public List<Field93E> getField93E() {
		final List<Field93E> result = new ArrayList<>();
		final Tag[] tags = tags("93E");
		if (tags != null && tags.length > 0) {
            for (Tag tag : tags) {
                result.add(new Field93E(tag.getValue()));
            }
		}
		return result;
	}

	/**
	 * Iterates through block4 fields and return all occurrences of fields whose names matches 93F,
	 * or Collections.emptyList() if none is found.
	 * Multiple occurrences of field 93F at MT568 are expected at one sequence or across several sequences.
	 *
	 * @return a List of Field93F objects or Collections.emptyList() if none is not found
	 * @see SwiftTagListBlock#getTagsByName(String)
	 * @throws IllegalStateException if SwiftMessage object is not initialized
	 */
	public List<Field93F> getField93F() {
		final List<Field93F> result = new ArrayList<>();
		final Tag[] tags = tags("93F");
		if (tags != null && tags.length > 0) {
            for (Tag tag : tags) {
                result.add(new Field93F(tag.getValue()));
            }
		}
		return result;
	}

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

	/**
	 * Iterates through block4 fields and return all occurrences of fields whose names matches 70F,
	 * or Collections.emptyList() if none is found.
	 * Multiple occurrences of field 70F at MT568 are expected at one sequence or across several sequences.
	 *
	 * @return a List of Field70F objects or Collections.emptyList() if none is not found
	 * @see SwiftTagListBlock#getTagsByName(String)
	 * @throws IllegalStateException if SwiftMessage object is not initialized
	 */
	public List<Field70F> getField70F() {
		final List<Field70F> result = new ArrayList<>();
		final Tag[] tags = tags("70F");
		if (tags != null && tags.length > 0) {
            for (Tag tag : tags) {
                result.add(new Field70F(tag.getValue()));
            }
		}
		return result;
	}

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

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

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

	/**
	 * Class to model Sequence "A" in MT 568.
	 */
	@SequenceStyle(Type.GENERATED_16RS)
	public static class SequenceA extends SwiftTagListBlock {
		private static final long serialVersionUID = 1L;

		/**
		 * Constructs an empty sequence.
		 */
	    private SequenceA() {
			super(new ArrayList<>());
		}

		/**
		 * 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 GENL.
		 */
		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
		 * @return a new instance of the sequence, initialized with the parameter tags
		 */
		@SequenceStyle(Type.GENERATED_16RS)
		public static SequenceA newInstance(final Tag... tags) {
			final SequenceA result = new SequenceA();
			result.append(START_TAG);
			if (tags != null && tags.length > 0) {
				for (final Tag t : tags) {
					result.append(t);
				}
			}
			result.append(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
		 * @return a new instance of the sequence
		 * @since 7.6
		 */
		public static SequenceA newInstance() {
			final SequenceA result = new SequenceA();
			result.append(START_TAG);
			result.append(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
		 * @param sequences a list of blocks to set as the new sequence content
		 * @return a new instance of the sequence, initialized with the parameter sequences content
		 * @since 7.6
		 */
		public static SequenceA newInstance(final SwiftTagListBlock... sequences) {
			final SequenceA result = new SequenceA();
			result.append(START_TAG);
			if (sequences != null && sequences.length > 0) {
				for (final SwiftTagListBlock s : sequences) {
					result.addTags(s.getTags());
				}
			}
			result.append(END_TAG);
			return result;
		}

		@SequenceStyle(Type.GENERATED_16RS)
		private SequenceA(final SwiftMessage m) {
			super();
			if (m.getBlock4() != null) {
				setTags(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 method indicates that this sequence can occur only once according to the Standard.
	 * @return the found sequence or an empty sequence if none is found
	 * @see SequenceA#START_END_16RS
	 */
	@SequenceStyle(Type.GENERATED_16RS)
	public SequenceA getSequenceA() {
		return new SequenceA(super.getSwiftMessageNotNullOrException());
	}

    /**
     * Same as getSequenceA using the sequence delimiter field qualifier
     * @see SequenceA#getSequenceA()
     * @return the found sequence or an empty sequence if none is found, never returns null
     * @since 9.2.18
     */
    public SequenceA getSequenceGENL() {
        return getSequenceA();
    }

	/**
	 * Get the single occurrence of SequenceA delimited by 16R/16S the value of SequenceA#START_END_16RS.
	 * The presence of this method indicates that this sequence can occur only once according to the Standard.
	 * @see SequenceA#START_END_16RS
	 * @param parentSequence a not null parent sequence to find SequenceA within it
	 * @return the found sequence or an empty sequence if none is found, never returns null
	 * @since 7.7
	 */
	@SequenceStyle(Type.GENERATED_16RS)
	public static SequenceA getSequenceA(SwiftTagListBlock parentSequence) {
		final SequenceA s = new SequenceA();
		if (parentSequence != null) {
		    s.setTags(parentSequence.getSubBlock(SequenceA.START_END_16RS).getTags());
		}
		return s;
	}

    /**
	 * Same as getSequenceA using the sequence delimiter field qualifier
	 * @see SequenceA#getSequenceA(SwiftTagListBlock)
	 * @param parentSequence a not null parent sequence to find SequenceA within it
	 * @return the found sequence or an empty sequence if none is found, never returns null
	 * @since 9.2.18
	 */
	public static SequenceA getSequenceGENL(SwiftTagListBlock parentSequence) {
		return getSequenceA(parentSequence);
	}

	/**
	 * Class to model Sequence "A1" in MT 568.
	 */
	@SequenceStyle(Type.GENERATED_16RS)
	public static class SequenceA1 extends SwiftTagListBlock {
		private static final long serialVersionUID = 1L;

		/**
		 * Constructs an empty sequence.
		 */
	    private SequenceA1() {
			super(new ArrayList<>());
		}

		/**
		 * 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 LINK.
		 */
		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
		 * @return a new instance of the sequence, initialized with the parameter tags
		 */
		@SequenceStyle(Type.GENERATED_16RS)
		public static SequenceA1 newInstance(final Tag... tags) {
			final SequenceA1 result = new SequenceA1();
			result.append(START_TAG);
			if (tags != null && tags.length > 0) {
				for (final Tag t : tags) {
					result.append(t);
				}
			}
			result.append(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
		 * @return a new instance of the sequence
		 * @since 7.6
		 */
		public static SequenceA1 newInstance() {
			final SequenceA1 result = new SequenceA1();
			result.append(START_TAG);
			result.append(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
		 * @param sequences a list of blocks to set as the new sequence content
		 * @return a new instance of the sequence, initialized with the parameter sequences content
		 * @since 7.6
		 */
		public static SequenceA1 newInstance(final SwiftTagListBlock... sequences) {
			final SequenceA1 result = new SequenceA1();
			result.append(START_TAG);
			if (sequences != null && sequences.length > 0) {
				for (final SwiftTagListBlock s : sequences) {
					result.addTags(s.getTags());
				}
			}
			result.append(END_TAG);
			return result;
		}

		@SequenceStyle(Type.GENERATED_16RS)
		private SequenceA1(final SwiftMessage m) {
			super();
			if (m.getBlock4() != null) {
				setTags(m.getBlock4().getSubBlock(START_END_16RS).getTags());
			}
		}

	}

	/**
	 * Get the list of SequenceA1 delimited by 16R/16S with value specified in {@link SequenceA1#START_END_16RS}.
	 *
	 *
The presence of this method indicates that this sequence can occur more than once according to the Standard.
     * @return the found sequences or an empty list if none is found
	 * @see SequenceA1#START_END_16RS
	 */
	@SequenceStyle(Type.GENERATED_16RS)
	public List<SequenceA1> getSequenceA1List() {
		return getSequenceA1List(super.getSwiftMessageNotNullOrException().getBlock4());
	}

    /**
     * Same as getSequenceA1List using the sequence delimiter field qualifier
     * @see SequenceA1#getSequenceA1List()
     * @return the found sequences or an empty list if none is found
     * @since 9.2.18
     */
     public List<SequenceA1> getSequenceLINKList() {
        return getSequenceA1List();
     }

	/**
	 * Get the list of SequenceA1 delimited by 16R/16S with value specified in {@link SequenceA1#START_END_16RS}.
	 *
	 *
The presence of this method indicates that this sequence can occur more than once according to the Standard.
	 * @see SequenceA1#START_END_16RS
	 * @param parentSequence a not null parent sequence to find SequenceA1 within it
	 * @return the found sequences or an empty list if none is found or parent sequence is null
	 * @since 7.7
	 */
	@SequenceStyle(Type.GENERATED_16RS)
	public static List<SequenceA1> getSequenceA1List(final SwiftTagListBlock parentSequence) {
	    if (parentSequence != null) {
            final List<SwiftTagListBlock> blocks = parentSequence.getSubBlocks(SequenceA1.START_END_16RS);
            if (blocks != null && !blocks.isEmpty()) {
                final List<SequenceA1> result = new ArrayList<>(blocks.size());
                for (final SwiftTagListBlock b : blocks) {
                    final SequenceA1 s = new SequenceA1();
                    s.setTags(b.getSubBlock(SequenceA1.START_END_16RS).getTags());
                    result.add(s);
                }
                return result;
            }
		}
		return Collections.emptyList();
	}

    /**
     * Same as getSequenceA1List using the sequence delimiter field qualifier
     * @see SequenceA1#getSequenceA1List(SwiftTagListBlock)
     * @param parentSequence a not null parent sequence to find SequenceA1 within it
     * @return the found sequences or an empty list if none is found
     * @since 9.2.18
     */
     public static List<SequenceA1> getSequenceLINKList(final SwiftTagListBlock parentSequence) {
        return getSequenceA1List(parentSequence);
    }

	/**
	 * Class to model Sequence "B" in MT 568.
	 */
	@SequenceStyle(Type.GENERATED_16RS)
	public static class SequenceB extends SwiftTagListBlock {
		private static final long serialVersionUID = 1L;

		/**
		 * Constructs an empty sequence.
		 */
	    private SequenceB() {
			super(new ArrayList<>());
		}

		/**
		 * 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 USECU.
		 */
		public static final String START_END_16RS = "USECU";
		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
		 * @return a new instance of the sequence, initialized with the parameter tags
		 */
		@SequenceStyle(Type.GENERATED_16RS)
		public static SequenceB newInstance(final Tag... tags) {
			final SequenceB result = new SequenceB();
			result.append(START_TAG);
			if (tags != null && tags.length > 0) {
				for (final Tag t : tags) {
					result.append(t);
				}
			}
			result.append(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
		 * @return a new instance of the sequence
		 * @since 7.6
		 */
		public static SequenceB newInstance() {
			final SequenceB result = new SequenceB();
			result.append(START_TAG);
			result.append(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
		 * @param sequences a list of blocks to set as the new sequence content
		 * @return a new instance of the sequence, initialized with the parameter sequences content
		 * @since 7.6
		 */
		public static SequenceB newInstance(final SwiftTagListBlock... sequences) {
			final SequenceB result = new SequenceB();
			result.append(START_TAG);
			if (sequences != null && sequences.length > 0) {
				for (final SwiftTagListBlock s : sequences) {
					result.addTags(s.getTags());
				}
			}
			result.append(END_TAG);
			return result;
		}

		@SequenceStyle(Type.GENERATED_16RS)
		private SequenceB(final SwiftMessage m) {
			super();
			if (m.getBlock4() != null) {
				setTags(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 method indicates that this sequence can occur only once according to the Standard.
	 * @return the found sequence or an empty sequence if none is found
	 * @see SequenceB#START_END_16RS
	 */
	@SequenceStyle(Type.GENERATED_16RS)
	public SequenceB getSequenceB() {
		return new SequenceB(super.getSwiftMessageNotNullOrException());
	}

    /**
     * Same as getSequenceB using the sequence delimiter field qualifier
     * @see SequenceB#getSequenceB()
     * @return the found sequence or an empty sequence if none is found, never returns null
     * @since 9.2.18
     */
    public SequenceB getSequenceUSECU() {
        return getSequenceB();
    }

	/**
	 * Get the single occurrence of SequenceB delimited by 16R/16S the value of SequenceB#START_END_16RS.
	 * The presence of this method indicates that this sequence can occur only once according to the Standard.
	 * @see SequenceB#START_END_16RS
	 * @param parentSequence a not null parent sequence to find SequenceB within it
	 * @return the found sequence or an empty sequence if none is found, never returns null
	 * @since 7.7
	 */
	@SequenceStyle(Type.GENERATED_16RS)
	public static SequenceB getSequenceB(SwiftTagListBlock parentSequence) {
		final SequenceB s = new SequenceB();
		if (parentSequence != null) {
		    s.setTags(parentSequence.getSubBlock(SequenceB.START_END_16RS).getTags());
		}
		return s;
	}

    /**
	 * Same as getSequenceB using the sequence delimiter field qualifier
	 * @see SequenceB#getSequenceB(SwiftTagListBlock)
	 * @param parentSequence a not null parent sequence to find SequenceB within it
	 * @return the found sequence or an empty sequence if none is found, never returns null
	 * @since 9.2.18
	 */
	public static SequenceB getSequenceUSECU(SwiftTagListBlock parentSequence) {
		return getSequenceB(parentSequence);
	}

	/**
	 * Class to model Sequence "B1" in MT 568.
	 */
	@SequenceStyle(Type.GENERATED_16RS)
	public static class SequenceB1 extends SwiftTagListBlock {
		private static final long serialVersionUID = 1L;

		/**
		 * Constructs an empty sequence.
		 */
	    private SequenceB1() {
			super(new ArrayList<>());
		}

		/**
		 * 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 FIA.
		 */
		public static final String START_END_16RS = "FIA";
		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
		 * @return a new instance of the sequence, initialized with the parameter tags
		 */
		@SequenceStyle(Type.GENERATED_16RS)
		public static SequenceB1 newInstance(final Tag... tags) {
			final SequenceB1 result = new SequenceB1();
			result.append(START_TAG);
			if (tags != null && tags.length > 0) {
				for (final Tag t : tags) {
					result.append(t);
				}
			}
			result.append(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
		 * @return a new instance of the sequence
		 * @since 7.6
		 */
		public static SequenceB1 newInstance() {
			final SequenceB1 result = new SequenceB1();
			result.append(START_TAG);
			result.append(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
		 * @param sequences a list of blocks to set as the new sequence content
		 * @return a new instance of the sequence, initialized with the parameter sequences content
		 * @since 7.6
		 */
		public static SequenceB1 newInstance(final SwiftTagListBlock... sequences) {
			final SequenceB1 result = new SequenceB1();
			result.append(START_TAG);
			if (sequences != null && sequences.length > 0) {
				for (final SwiftTagListBlock s : sequences) {
					result.addTags(s.getTags());
				}
			}
			result.append(END_TAG);
			return result;
		}

		@SequenceStyle(Type.GENERATED_16RS)
		private SequenceB1(final SwiftMessage m) {
			super();
			if (m.getBlock4() != null) {
				setTags(m.getBlock4().getSubBlock(START_END_16RS).getTags());
			}
		}

	}
	/**
	 * Get the single occurrence of SequenceB1 delimited by 16R/16S the value of SequenceB1#START_END_16RS.
	 * The presence of this method indicates that this sequence can occur only once according to the Standard.
	 * @return the found sequence or an empty sequence if none is found
	 * @see SequenceB1#START_END_16RS
	 */
	@SequenceStyle(Type.GENERATED_16RS)
	public SequenceB1 getSequenceB1() {
		return new SequenceB1(super.getSwiftMessageNotNullOrException());
	}

    /**
     * Same as getSequenceB1 using the sequence delimiter field qualifier
     * @see SequenceB1#getSequenceB1()
     * @return the found sequence or an empty sequence if none is found, never returns null
     * @since 9.2.18
     */
    public SequenceB1 getSequenceFIA() {
        return getSequenceB1();
    }

	/**
	 * Get the single occurrence of SequenceB1 delimited by 16R/16S the value of SequenceB1#START_END_16RS.
	 * The presence of this method indicates that this sequence can occur only once according to the Standard.
	 * @see SequenceB1#START_END_16RS
	 * @param parentSequence a not null parent sequence to find SequenceB1 within it
	 * @return the found sequence or an empty sequence if none is found, never returns null
	 * @since 7.7
	 */
	@SequenceStyle(Type.GENERATED_16RS)
	public static SequenceB1 getSequenceB1(SwiftTagListBlock parentSequence) {
		final SequenceB1 s = new SequenceB1();
		if (parentSequence != null) {
		    s.setTags(parentSequence.getSubBlock(SequenceB1.START_END_16RS).getTags());
		}
		return s;
	}

    /**
	 * Same as getSequenceB1 using the sequence delimiter field qualifier
	 * @see SequenceB1#getSequenceB1(SwiftTagListBlock)
	 * @param parentSequence a not null parent sequence to find SequenceB1 within it
	 * @return the found sequence or an empty sequence if none is found, never returns null
	 * @since 9.2.18
	 */
	public static SequenceB1 getSequenceFIA(SwiftTagListBlock parentSequence) {
		return getSequenceB1(parentSequence);
	}

	/**
	 * Class to model Sequence "C" in MT 568.
	 */
	@SequenceStyle(Type.GENERATED_16RS)
	public static class SequenceC extends SwiftTagListBlock {
		private static final long serialVersionUID = 1L;

		/**
		 * Constructs an empty sequence.
		 */
	    private SequenceC() {
			super(new ArrayList<>());
		}

		/**
		 * Creates a sequence with the given content.
		 * @see SwiftTagListBlock
		 */
		private SequenceC(final SwiftTagListBlock content) {
			super(content.getTags());
		}

		/**
		 * Value for the qualifier of the 16R / 16S tag that indicates start and end of this sequence ADDINFO.
		 */
		public static final String START_END_16RS = "ADDINFO";
		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
		 * @return a new instance of the sequence, initialized with the parameter tags
		 */
		@SequenceStyle(Type.GENERATED_16RS)
		public static SequenceC newInstance(final Tag... tags) {
			final SequenceC result = new SequenceC();
			result.append(START_TAG);
			if (tags != null && tags.length > 0) {
				for (final Tag t : tags) {
					result.append(t);
				}
			}
			result.append(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
		 * @return a new instance of the sequence
		 * @since 7.6
		 */
		public static SequenceC newInstance() {
			final SequenceC result = new SequenceC();
			result.append(START_TAG);
			result.append(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
		 * @param sequences a list of blocks to set as the new sequence content
		 * @return a new instance of the sequence, initialized with the parameter sequences content
		 * @since 7.6
		 */
		public static SequenceC newInstance(final SwiftTagListBlock... sequences) {
			final SequenceC result = new SequenceC();
			result.append(START_TAG);
			if (sequences != null && sequences.length > 0) {
				for (final SwiftTagListBlock s : sequences) {
					result.addTags(s.getTags());
				}
			}
			result.append(END_TAG);
			return result;
		}

		@SequenceStyle(Type.GENERATED_16RS)
		private SequenceC(final SwiftMessage m) {
			super();
			if (m.getBlock4() != null) {
				setTags(m.getBlock4().getSubBlock(START_END_16RS).getTags());
			}
		}

	}
	/**
	 * Get the single occurrence of SequenceC delimited by 16R/16S the value of SequenceC#START_END_16RS.
	 * The presence of this method indicates that this sequence can occur only once according to the Standard.
	 * @return the found sequence or an empty sequence if none is found
	 * @see SequenceC#START_END_16RS
	 */
	@SequenceStyle(Type.GENERATED_16RS)
	public SequenceC getSequenceC() {
		return new SequenceC(super.getSwiftMessageNotNullOrException());
	}

    /**
     * Same as getSequenceC using the sequence delimiter field qualifier
     * @see SequenceC#getSequenceC()
     * @return the found sequence or an empty sequence if none is found, never returns null
     * @since 9.2.18
     */
    public SequenceC getSequenceADDINFO() {
        return getSequenceC();
    }

	/**
	 * Get the single occurrence of SequenceC delimited by 16R/16S the value of SequenceC#START_END_16RS.
	 * The presence of this method indicates that this sequence can occur only once according to the Standard.
	 * @see SequenceC#START_END_16RS
	 * @param parentSequence a not null parent sequence to find SequenceC within it
	 * @return the found sequence or an empty sequence if none is found, never returns null
	 * @since 7.7
	 */
	@SequenceStyle(Type.GENERATED_16RS)
	public static SequenceC getSequenceC(SwiftTagListBlock parentSequence) {
		final SequenceC s = new SequenceC();
		if (parentSequence != null) {
		    s.setTags(parentSequence.getSubBlock(SequenceC.START_END_16RS).getTags());
		}
		return s;
	}

    /**
	 * Same as getSequenceC using the sequence delimiter field qualifier
	 * @see SequenceC#getSequenceC(SwiftTagListBlock)
	 * @param parentSequence a not null parent sequence to find SequenceC within it
	 * @return the found sequence or an empty sequence if none is found, never returns null
	 * @since 9.2.18
	 */
	public static SequenceC getSequenceADDINFO(SwiftTagListBlock parentSequence) {
		return getSequenceC(parentSequence);
	}

}


text:
using System;
using System.Runtime.InteropServices;

internal partial class Interop
{
    internal partial class NtDll
    {
        [StructLayout(LayoutKind.Sequential)]
        internal struct RTL_OSVERSIONINFOEX
        {
            internal uint dwOSVersionInfoSize;
            internal uint dwMajorVersion;
            internal uint dwMinorVersion;
            internal uint dwBuildNumber;
            internal uint dwPlatformId;
            [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 128)]
            internal string szCSDVersion;
        }
    }
}

redpajama_set_name: RedPajamaGithub


text:
using System;
using System.IO;
using System.Xml.Serialization;

namespace RCube
{
    public class CubeStorage
    {
        static XmlSerializer serializer = new XmlSerializer(typeof(CubeStorage));

        public int[] Colors;
        public int[][] SideColors;
        public double[] Rotation;

        public static CubeStorage Load(string filename)
        {
            using (FileStream fs = File.OpenRead(filename))
            {
                return (CubeStorage)serializer.Deserialize(fs);
            }
        }

        public void Save(string filename)
        {
            using (FileStream fs = File.Create(filename))
            {
                serializer.Serialize(fs, this);
            }
        }
    }

}


text:
import sys,re,os
from optparse import OptionParser

parser=OptionParser()
parser.add_option('--outFile','--outF','-o',default='')
parser.add_option('--snowshoe','-s',action='store_true',default=False)
parser.add_option('--avgMarker',action='store_true',default=False)
parser.add_option('--noTrack','-t',action='store_true',default=False)

options,args =parser.parse_args()

if not args:
    sys.exit(0)

lineWidth = 3
lineColor = "EE00AA00" # <- color order is aabbggrr
dotURL="http://www.google.com/intl/en_us/mapfiles/ms/icons/green-dot.png"
if options.snowshoe:
  lineColor = "CCFF3333" # <- color order is aabbggrr
  dotURL="http://www.google.com/intl/en_us/mapfiles/ms/icons/blue-dot.png"

from xml.etree import cElementTree as ET
def doFile(name,options,idx):
    inF = open(name,'r')
    et = ET.ElementTree(file=inF)
    nms = et.findall('.//{http://www.topografix.com/GPX/1/1}name')
    if nms:
        name = nms[0].text

    pts = et.findall('.//{http://www.topografix.com/GPX/1/1}trkpt')
    if not pts:
        pts = et.findall('.//{http://www.topografix.com/GPX/1/0}trkpt')
        if not pts:
            raise ValueError('could not find any points')
    data=[]
    for pt in pts:
        data.append((float(pt.get('lat')),float(pt.get('lon'))))

    description = name

    trackTemplate="""
    <Placemark>
        <name>%(name)s</name>
        <description>%(description)s</description>
        <styleUrl>#trackColor%(idx)s</styleUrl>
        <Point>
          <coordinates>%(markerX)f,%(markerY)f</coordinates>
        </Point>
%(lineString)s
    </Placemark>
    """
    txtPairs=["%.6f,%.6f"%(pt[1],pt[0]) for pt in data]
    center=[0.,0.]
    for pt in data:
        lat = pt[0]
        long = pt[1]
        center[0] += lat
        center[1] += long
    lat,long=center
    lat /= len(data)
    long /= len(data)
    if options.avgMarker:
        markerX = long
        markerY = lat
    else:
        markerX = data[0][1]
        markerY = data[0][0]
    coords = '\n'.join(txtPairs)
    if not options.noTrack:
        lineString="""
        <LineString>
          <coordinates>
            %(coords)s
          </coordinates>
        </LineString>"""%locals()
    else:
        lineString=""
    track = trackTemplate%locals()
    return track

tracks = [doFile(arg,options,idx+1) for (idx,arg) in enumerate(args)]
tracks = '\n'.join(tracks)

if options.outFile=='-':
    outF = sys.stdout
else:
    if options.outFile:
        outF = open(options.outFile,'w+')
    else:
        fName = os.path.splitext(args[0])[0]+'.kml'
        outF = open(fName,'w+')

styles=[]
for idx in range(1,len(args)+1):
    styles.append("""<Style id="trackColor%(idx)d">
      <LineStyle>
        <color>%(lineColor)s</color>
        <width>%(lineWidth)s</width>
      </LineStyle>
        <IconStyle>
          <Icon>
            <href>%(dotURL)s</href>
          </Icon>
        </IconStyle>
    </Style>"""%globals())
styles = '\n'.join(styles)

template="""<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="http://www.opengis.net/kml/2.2">
<Document>
    %(styles)s
%(tracks)s
</Document>
</kml>
"""
print(template%locals(),file=outF)


text:
/* TEMPLATE GENERATED TESTCASE FILE
Filename: CWE122_Heap_Based_Buffer_Overflow__cpp_CWE129_fscanf_83_bad.cpp
Label Definition File: CWE122_Heap_Based_Buffer_Overflow__cpp_CWE129.label.xml
Template File: sources-sinks-83_bad.tmpl.cpp
*/
/*
 * @description
 * CWE: 122 Heap Based Buffer Overflow
 * BadSource: fscanf Read data from the console using fscanf()
 * GoodSource: Larger than zero but less than 10
 * Sinks:
 *    GoodSink: Ensure the array index is valid
 *    BadSink : Improperly check the array index by not checking the upper bound
 * Flow Variant: 83 Data flow: data passed to class constructor and destructor by declaring the class object on the stack
 *
 * */
#ifndef OMITBAD

#include "std_testcase.h"
#include "CWE122_Heap_Based_Buffer_Overflow__cpp_CWE129_fscanf_83.h"

namespace CWE122_Heap_Based_Buffer_Overflow__cpp_CWE129_fscanf_83
{
CWE122_Heap_Based_Buffer_Overflow__cpp_CWE129_fscanf_83_bad::CWE122_Heap_Based_Buffer_Overflow__cpp_CWE129_fscanf_83_bad(int dataCopy)
{
    data = dataCopy;
    /* POTENTIAL FLAW: Read data from the console using fscanf() */
    fscanf(stdin, "%d", &data);
}

CWE122_Heap_Based_Buffer_Overflow__cpp_CWE129_fscanf_83_bad::~CWE122_Heap_Based_Buffer_Overflow__cpp_CWE129_fscanf_83_bad()
{
    {
        int i;
        int * buffer = new int[10];
        /* initialize buffer */
        for (i = 0; i < 10; i++)
        {
            buffer[i] = 0;
        }
        /* POTENTIAL FLAW: Attempt to write to an index of the array that is above the upper bound
        * This code does check to see if the array index is negative */
        if (data >= 0)
        {
            buffer[data] = 1;
            /* Print the array values */
            for(i = 0; i < 10; i++)
            {
                printIntLine(buffer[i]);
            }
        }
        else
        {
            printLine("ERROR: Array index is negative.");
        }
        delete[] buffer;
    }
}
}
#endif /* OMITBAD */