diff --git a/CHANGELOG.md b/CHANGELOG.md index d1787fb04..f9ba1d66b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ #### 9.5.2 - SNAPSHOT * Added new `FieldEnum` with all the available field names + * Code security improvements as per CodeQL recommendations #### 9.5.1 - June 2024 * (PW-1913) Added IBAN validation for Egypt local account structure diff --git a/build.gradle b/build.gradle index 1315add82..8f023a9a8 100644 --- a/build.gradle +++ b/build.gradle @@ -60,6 +60,7 @@ dependencies { compileOnly 'javax.xml.bind:jaxb-api:2.3.1' compileOnly 'javax.validation:validation-api:2.0.1.Final' + testImplementation 'javax.validation:validation-api:2.0.1.Final' testImplementation 'javax.persistence:javax.persistence-api:2.2' testImplementation 'org.junit.jupiter:junit-jupiter:5.10.2' testImplementation 'org.assertj:assertj-core:3.25.3' diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field101.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field101.java index 1b6e6e9e5..26b879d90 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field101.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field101.java @@ -29,12 +29,9 @@ -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -183,19 +180,16 @@ public String getValue() { */ @Override public String getValueDisplay(int component, Locale locale) { - if (component < 1 || component > 1) { + if (component != 1) { throw new IllegalArgumentException("invalid component number " + component + " for field 101"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -398,7 +392,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field101(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field102.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field102.java index 0c9353677..b31b6af47 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field102.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field102.java @@ -30,12 +30,9 @@ import com.prowidesoftware.swift.model.LogicalTerminalAddress; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -184,19 +181,16 @@ public String getValue() { */ @Override public String getValueDisplay(int component, Locale locale) { - if (component < 1 || component > 1) { + if (component != 1) { throw new IllegalArgumentException("invalid component number " + component + " for field 102"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -439,7 +433,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field102(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field103.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field103.java index b91ccd9c2..ea8b8698f 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field103.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field103.java @@ -29,12 +29,9 @@ -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -183,19 +180,16 @@ public String getValue() { */ @Override public String getValueDisplay(int component, Locale locale) { - if (component < 1 || component > 1) { + if (component != 1) { throw new IllegalArgumentException("invalid component number " + component + " for field 103"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -398,7 +392,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field103(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field104.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field104.java index 7f85ec7e8..ea3a130b3 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field104.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field104.java @@ -29,12 +29,9 @@ -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -183,19 +180,16 @@ public String getValue() { */ @Override public String getValueDisplay(int component, Locale locale) { - if (component < 1 || component > 1) { + if (component != 1) { throw new IllegalArgumentException("invalid component number " + component + " for field 104"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -398,7 +392,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field104(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field105.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field105.java index 146e2f42c..f9d841492 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field105.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field105.java @@ -31,12 +31,9 @@ import java.math.BigInteger; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -185,19 +182,16 @@ public String getValue() { */ @Override public String getValueDisplay(int component, Locale locale) { - if (component < 1 || component > 1) { + if (component != 1) { throw new IllegalArgumentException("invalid component number " + component + " for field 105"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -344,32 +338,14 @@ public Field105 setComponent1(String component1) { return this; } - /** - * Set the component1 from a Long object. - *
- * If the component being set is a fixed length number, the argument will not be - * padded. It is recommended for these cases to use the setComponent1(String) - * method. - * - * @see #setComponent1(String) - * @since 9.2.7 - * - * @param component1 the Long with the Delivery Monitoring content to set - * @return the field object to enable build pattern - */ - public Field105 setComponent1(java.lang.Long component1) { - setComponent(1, SwiftFormatUtils.getLong(component1)); - return this; - } /** * Alternative method setter for field's Delivery Monitoring (component 1) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10 becomes an Integer) * * @param component1 the Number with the Delivery Monitoring content to set * @return the field object to enable build pattern - * @see #setDeliveryMonitoring(java.lang.Long) */ public Field105 setComponent1(java.lang.Number component1) { @@ -399,27 +375,13 @@ public Field105 setDeliveryMonitoring(String component1) { return setComponent1(component1); } - /** - * Set the Delivery Monitoring (component 1) from a Long object. - * - * @see #setComponent1(java.lang.Long) - * - * @param component1 Long with the Delivery Monitoring content to set - * @return the field object to enable build pattern - * @since 9.2.7 - */ - public Field105 setDeliveryMonitoring(java.lang.Long component1) { - return setComponent1(component1); - } - /** * Alternative method setter for field's Delivery Monitoring (component 1) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10 becomes an Integer) * * @param component1 the Number with the Delivery Monitoring content to set * @return the field object to enable build pattern - * @see #setDeliveryMonitoring(java.lang.Long) */ public Field105 setDeliveryMonitoring(java.lang.Number component1) { return setComponent1(component1); @@ -490,7 +452,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field105(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field106.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field106.java index d61d34e27..dda04a655 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field106.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field106.java @@ -29,12 +29,9 @@ -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -183,19 +180,16 @@ public String getValue() { */ @Override public String getValueDisplay(int component, Locale locale) { - if (component < 1 || component > 1) { + if (component != 1) { throw new IllegalArgumentException("invalid component number " + component + " for field 106"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -398,7 +392,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field106(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field107.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field107.java index b8215f397..4a260c048 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field107.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field107.java @@ -29,12 +29,9 @@ -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -183,19 +180,16 @@ public String getValue() { */ @Override public String getValueDisplay(int component, Locale locale) { - if (component < 1 || component > 1) { + if (component != 1) { throw new IllegalArgumentException("invalid component number " + component + " for field 107"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -398,7 +392,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field107(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field108.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field108.java index e83bd1c46..ebed16145 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field108.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field108.java @@ -29,12 +29,9 @@ -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -183,19 +180,16 @@ public String getValue() { */ @Override public String getValueDisplay(int component, Locale locale) { - if (component < 1 || component > 1) { + if (component != 1) { throw new IllegalArgumentException("invalid component number " + component + " for field 108"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -398,7 +392,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field108(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field109.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field109.java index 43b4c4425..36af0d751 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field109.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field109.java @@ -32,12 +32,9 @@ import com.prowidesoftware.swift.model.field.DateContainer; import com.prowidesoftware.swift.model.field.DateResolver; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -227,16 +224,14 @@ public String getValueDisplay(int component, Locale locale) { return f.format(cal.getTime()); } } - if (component == 3) { - //default format (as is) - return getComponent(3); - } - return null; + // This is the last component, return directly without `if` + //default format (as is) + return getComponent(3); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -540,6 +535,7 @@ public Field109 setMIR(String component3) { * * @return the list of converted components (a Calendar object or null) */ + @Override public List dates() { return DateResolver.dates(this); } @@ -617,7 +613,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field109(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field110.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field110.java index ab3400db2..9832c047f 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field110.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field110.java @@ -31,12 +31,9 @@ import java.math.BigInteger; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -185,19 +182,16 @@ public String getValue() { */ @Override public String getValueDisplay(int component, Locale locale) { - if (component < 1 || component > 1) { + if (component != 1) { throw new IllegalArgumentException("invalid component number " + component + " for field 110"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -344,32 +338,14 @@ public Field110 setComponent1(String component1) { return this; } - /** - * Set the component1 from a Long object. - *
- * If the component being set is a fixed length number, the argument will not be - * padded. It is recommended for these cases to use the setComponent1(String) - * method. - * - * @see #setComponent1(String) - * @since 9.2.7 - * - * @param component1 the Long with the Window Size content to set - * @return the field object to enable build pattern - */ - public Field110 setComponent1(java.lang.Long component1) { - setComponent(1, SwiftFormatUtils.getLong(component1)); - return this; - } /** * Alternative method setter for field's Window Size (component 1) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10 becomes an Integer) * * @param component1 the Number with the Window Size content to set * @return the field object to enable build pattern - * @see #setWindowSize(java.lang.Long) */ public Field110 setComponent1(java.lang.Number component1) { @@ -399,27 +375,13 @@ public Field110 setWindowSize(String component1) { return setComponent1(component1); } - /** - * Set the Window Size (component 1) from a Long object. - * - * @see #setComponent1(java.lang.Long) - * - * @param component1 Long with the Window Size content to set - * @return the field object to enable build pattern - * @since 9.2.7 - */ - public Field110 setWindowSize(java.lang.Long component1) { - return setComponent1(component1); - } - /** * Alternative method setter for field's Window Size (component 1) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10 becomes an Integer) * * @param component1 the Number with the Window Size content to set * @return the field object to enable build pattern - * @see #setWindowSize(java.lang.Long) */ public Field110 setWindowSize(java.lang.Number component1) { return setComponent1(component1); @@ -490,7 +452,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field110(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field111.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field111.java index 9749de18a..543957872 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field111.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field111.java @@ -31,12 +31,9 @@ import java.math.BigInteger; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -185,19 +182,16 @@ public String getValue() { */ @Override public String getValueDisplay(int component, Locale locale) { - if (component < 1 || component > 1) { + if (component != 1) { throw new IllegalArgumentException("invalid component number " + component + " for field 111"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -344,32 +338,14 @@ public Field111 setComponent1(String component1) { return this; } - /** - * Set the component1 from a Long object. - *
- * If the component being set is a fixed length number, the argument will not be - * padded. It is recommended for these cases to use the setComponent1(String) - * method. - * - * @see #setComponent1(String) - * @since 9.2.7 - * - * @param component1 the Long with the Service Type Identifier content to set - * @return the field object to enable build pattern - */ - public Field111 setComponent1(java.lang.Long component1) { - setComponent(1, SwiftFormatUtils.getLong(component1)); - return this; - } /** * Alternative method setter for field's Service Type Identifier (component 1) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10 becomes an Integer) * * @param component1 the Number with the Service Type Identifier content to set * @return the field object to enable build pattern - * @see #setServiceTypeIdentifier(java.lang.Long) */ public Field111 setComponent1(java.lang.Number component1) { @@ -399,27 +375,13 @@ public Field111 setServiceTypeIdentifier(String component1) { return setComponent1(component1); } - /** - * Set the Service Type Identifier (component 1) from a Long object. - * - * @see #setComponent1(java.lang.Long) - * - * @param component1 Long with the Service Type Identifier content to set - * @return the field object to enable build pattern - * @since 9.2.7 - */ - public Field111 setServiceTypeIdentifier(java.lang.Long component1) { - return setComponent1(component1); - } - /** * Alternative method setter for field's Service Type Identifier (component 1) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10 becomes an Integer) * * @param component1 the Number with the Service Type Identifier content to set * @return the field object to enable build pattern - * @see #setServiceTypeIdentifier(java.lang.Long) */ public Field111 setServiceTypeIdentifier(java.lang.Number component1) { return setComponent1(component1); @@ -490,7 +452,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field111(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field113.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field113.java index c3b63708d..52327306a 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field113.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field113.java @@ -29,12 +29,9 @@ -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -183,19 +180,16 @@ public String getValue() { */ @Override public String getValueDisplay(int component, Locale locale) { - if (component < 1 || component > 1) { + if (component != 1) { throw new IllegalArgumentException("invalid component number " + component + " for field 113"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -398,7 +392,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field113(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field114.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field114.java index 2ad87b636..5e167ec86 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field114.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field114.java @@ -29,12 +29,9 @@ -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -183,19 +180,16 @@ public String getValue() { */ @Override public String getValueDisplay(int component, Locale locale) { - if (component < 1 || component > 1) { + if (component != 1) { throw new IllegalArgumentException("invalid component number " + component + " for field 114"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -398,7 +392,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field114(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field115.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field115.java index 0ccf406ba..e6e3d8b8d 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field115.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field115.java @@ -29,12 +29,9 @@ -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -183,19 +180,16 @@ public String getValue() { */ @Override public String getValueDisplay(int component, Locale locale) { - if (component < 1 || component > 1) { + if (component != 1) { throw new IllegalArgumentException("invalid component number " + component + " for field 115"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -398,7 +392,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field115(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field116.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field116.java index ad0058e3c..4f3937c71 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field116.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field116.java @@ -29,12 +29,9 @@ -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -183,19 +180,16 @@ public String getValue() { */ @Override public String getValueDisplay(int component, Locale locale) { - if (component < 1 || component > 1) { + if (component != 1) { throw new IllegalArgumentException("invalid component number " + component + " for field 116"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -438,7 +432,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field116(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field117.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field117.java index 8ba98f10d..39904866e 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field117.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field117.java @@ -29,12 +29,9 @@ -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -183,19 +180,16 @@ public String getValue() { */ @Override public String getValueDisplay(int component, Locale locale) { - if (component < 1 || component > 1) { + if (component != 1) { throw new IllegalArgumentException("invalid component number " + component + " for field 117"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -398,7 +392,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field117(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field118.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field118.java index 640ba3112..276b2ec0d 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field118.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field118.java @@ -29,12 +29,9 @@ -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -183,19 +180,16 @@ public String getValue() { */ @Override public String getValueDisplay(int component, Locale locale) { - if (component < 1 || component > 1) { + if (component != 1) { throw new IllegalArgumentException("invalid component number " + component + " for field 118"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -438,7 +432,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field118(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field119.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field119.java index 48b4887d3..414de82d5 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field119.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field119.java @@ -29,12 +29,9 @@ -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -183,19 +180,16 @@ public String getValue() { */ @Override public String getValueDisplay(int component, Locale locale) { - if (component < 1 || component > 1) { + if (component != 1) { throw new IllegalArgumentException("invalid component number " + component + " for field 119"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -398,7 +392,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field119(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field11A.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field11A.java index 2624b21ea..c99224c6c 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field11A.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field11A.java @@ -33,12 +33,9 @@ import com.prowidesoftware.swift.model.field.CurrencyContainer; import com.prowidesoftware.swift.model.field.CurrencyResolver; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -205,16 +202,14 @@ public String getValueDisplay(int component, Locale locale) { //default format (as is) return getComponent(1); } - if (component == 2) { - //default format (as is) - return getComponent(2); - } - return null; + // This is the last component, return directly without `if` + //default format (as is) + return getComponent(2); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -436,26 +431,32 @@ public Field11A setCurrencyCode(java.util.Currency component2) { } + @Override public List currencyStrings() { return CurrencyResolver.currencyStrings(this); } + @Override public List currencies() { return CurrencyResolver.currencies(this); } + @Override public Currency currency() { return CurrencyResolver.resolveCurrency(this); } + @Override public String currencyString() { return CurrencyResolver.resolveCurrencyString(this); } + @Override public void initializeCurrencies(String cur) { CurrencyResolver.resolveSetCurrency(this, cur); } + @Override public void initializeCurrencies(Currency cur) { CurrencyResolver.resolveSetCurrency(this, cur); } @@ -467,6 +468,7 @@ public void initializeCurrencies(Currency cur) { * * @return DSS component value or null if the DSS is not set or not available for this field. */ + @Override public String getDSS() { return null; } @@ -477,6 +479,7 @@ public String getDSS() { * @see #getDSS() * @return true if DSS is present, false otherwise. */ + @Override public boolean isDSSPresent() { return false; } @@ -491,6 +494,7 @@ public boolean isDSSPresent() { * * @return for generic fields returns the value of the conditional qualifier or null if not set or not applicable for this field. */ + @Override public String getConditionalQualifier() { return getComponent(CONDITIONAL_QUALIFIER); } @@ -558,7 +562,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field11A(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field11R.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field11R.java index 34945fbd3..98e86287c 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field11R.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field11R.java @@ -35,12 +35,9 @@ import com.prowidesoftware.swift.model.field.DateContainer; import com.prowidesoftware.swift.model.field.DateResolver; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -253,16 +250,14 @@ public String getValueDisplay(int component, Locale locale) { //default format (as is) return getComponent(3); } - if (component == 4) { - //default format (as is) - return getComponent(4); - } - return null; + // This is the last component, return directly without `if` + //default format (as is) + return getComponent(4); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -576,32 +571,14 @@ public Field11R setComponent3(String component3) { return this; } - /** - * Set the component3 from a Long object. - *
- * If the component being set is a fixed length number, the argument will not be - * padded. It is recommended for these cases to use the setComponent3(String) - * method. - * - * @see #setComponent3(String) - * @since 9.2.7 - * - * @param component3 the Long with the Session Number content to set - * @return the field object to enable build pattern - */ - public Field11R setComponent3(java.lang.Long component3) { - setComponent(3, SwiftFormatUtils.getLong(component3)); - return this; - } /** * Alternative method setter for field's Session Number (component 3) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10 becomes an Integer) * * @param component3 the Number with the Session Number content to set * @return the field object to enable build pattern - * @see #setSessionNumber(java.lang.Long) */ public Field11R setComponent3(java.lang.Number component3) { @@ -631,27 +608,13 @@ public Field11R setSessionNumber(String component3) { return setComponent3(component3); } - /** - * Set the Session Number (component 3) from a Long object. - * - * @see #setComponent3(java.lang.Long) - * - * @param component3 Long with the Session Number content to set - * @return the field object to enable build pattern - * @since 9.2.7 - */ - public Field11R setSessionNumber(java.lang.Long component3) { - return setComponent3(component3); - } - /** * Alternative method setter for field's Session Number (component 3) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10 becomes an Integer) * * @param component3 the Number with the Session Number content to set * @return the field object to enable build pattern - * @see #setSessionNumber(java.lang.Long) */ public Field11R setSessionNumber(java.lang.Number component3) { return setComponent3(component3); @@ -668,32 +631,14 @@ public Field11R setComponent4(String component4) { return this; } - /** - * Set the component4 from a Long object. - *
- * If the component being set is a fixed length number, the argument will not be - * padded. It is recommended for these cases to use the setComponent4(String) - * method. - * - * @see #setComponent4(String) - * @since 9.2.7 - * - * @param component4 the Long with the ISN content to set - * @return the field object to enable build pattern - */ - public Field11R setComponent4(java.lang.Long component4) { - setComponent(4, SwiftFormatUtils.getLong(component4)); - return this; - } /** * Alternative method setter for field's ISN (component 4) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10 becomes an Integer) * * @param component4 the Number with the ISN content to set * @return the field object to enable build pattern - * @see #setISN(java.lang.Long) */ public Field11R setComponent4(java.lang.Number component4) { @@ -723,27 +668,13 @@ public Field11R setISN(String component4) { return setComponent4(component4); } - /** - * Set the ISN (component 4) from a Long object. - * - * @see #setComponent4(java.lang.Long) - * - * @param component4 Long with the ISN content to set - * @return the field object to enable build pattern - * @since 9.2.7 - */ - public Field11R setISN(java.lang.Long component4) { - return setComponent4(component4); - } - /** * Alternative method setter for field's ISN (component 4) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10 becomes an Integer) * * @param component4 the Number with the ISN content to set * @return the field object to enable build pattern - * @see #setISN(java.lang.Long) */ public Field11R setISN(java.lang.Number component4) { return setComponent4(component4); @@ -755,6 +686,7 @@ public Field11R setISN(java.lang.Number component4) { * * @return the list of converted components (a Calendar object or null) */ + @Override public List dates() { return DateResolver.dates(this); } @@ -832,7 +764,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field11R(f)); } @@ -848,6 +780,7 @@ public static List getAll(final SwiftTagListBlock block) { * @return line content or null if not present or if line number is above the expected * @since 7.7 */ + @Override public String getLine(int line) { return getLine(line, 0); } @@ -861,6 +794,7 @@ public String getLine(int line) { * @return line content or null if not present or if line number is above the expected * @since 7.7 */ + @Override public String getLine(int line, int offset) { Field11R cp = newInstance(this); return getLine(cp, line, null, offset); @@ -873,6 +807,7 @@ public String getLine(int line, int offset) { * @return lines content or empty list if field's value is empty * @since 7.7 */ + @Override public List getLines() { return SwiftParseUtils.getLines(getValue()); } @@ -885,6 +820,7 @@ public List getLines() { * @return found lines or empty list if lines are not present or the offset is invalid * @since 7.7 */ + @Override public List getLines(int offset) { Field11R cp = newInstance(this); return SwiftParseUtils.getLines(getLine(cp, null, null, offset)); @@ -899,6 +835,7 @@ public List getLines(int offset) { * @return found lines or empty list if value is empty * @since 7.7 */ + @Override public List getLinesBetween(int start, int end) { return getLinesBetween(start, end, 0); } @@ -913,6 +850,7 @@ public List getLinesBetween(int start, int end) { * @return found lines or empty list if lines are not present or the offset is invalid * @since 7.7 */ + @Override public List getLinesBetween(int start, int end, int offset) { Field11R cp = newInstance(this); return SwiftParseUtils.getLines(getLine(cp, start, end, offset)); diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field11S.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field11S.java index bf83d1ce3..00925e61d 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field11S.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field11S.java @@ -35,12 +35,9 @@ import com.prowidesoftware.swift.model.field.DateContainer; import com.prowidesoftware.swift.model.field.DateResolver; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -253,16 +250,14 @@ public String getValueDisplay(int component, Locale locale) { //default format (as is) return getComponent(3); } - if (component == 4) { - //default format (as is) - return getComponent(4); - } - return null; + // This is the last component, return directly without `if` + //default format (as is) + return getComponent(4); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -576,32 +571,14 @@ public Field11S setComponent3(String component3) { return this; } - /** - * Set the component3 from a Long object. - *
- * If the component being set is a fixed length number, the argument will not be - * padded. It is recommended for these cases to use the setComponent3(String) - * method. - * - * @see #setComponent3(String) - * @since 9.2.7 - * - * @param component3 the Long with the Session Number content to set - * @return the field object to enable build pattern - */ - public Field11S setComponent3(java.lang.Long component3) { - setComponent(3, SwiftFormatUtils.getLong(component3)); - return this; - } /** * Alternative method setter for field's Session Number (component 3) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10 becomes an Integer) * * @param component3 the Number with the Session Number content to set * @return the field object to enable build pattern - * @see #setSessionNumber(java.lang.Long) */ public Field11S setComponent3(java.lang.Number component3) { @@ -631,27 +608,13 @@ public Field11S setSessionNumber(String component3) { return setComponent3(component3); } - /** - * Set the Session Number (component 3) from a Long object. - * - * @see #setComponent3(java.lang.Long) - * - * @param component3 Long with the Session Number content to set - * @return the field object to enable build pattern - * @since 9.2.7 - */ - public Field11S setSessionNumber(java.lang.Long component3) { - return setComponent3(component3); - } - /** * Alternative method setter for field's Session Number (component 3) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10 becomes an Integer) * * @param component3 the Number with the Session Number content to set * @return the field object to enable build pattern - * @see #setSessionNumber(java.lang.Long) */ public Field11S setSessionNumber(java.lang.Number component3) { return setComponent3(component3); @@ -668,32 +631,14 @@ public Field11S setComponent4(String component4) { return this; } - /** - * Set the component4 from a Long object. - *
- * If the component being set is a fixed length number, the argument will not be - * padded. It is recommended for these cases to use the setComponent4(String) - * method. - * - * @see #setComponent4(String) - * @since 9.2.7 - * - * @param component4 the Long with the ISN content to set - * @return the field object to enable build pattern - */ - public Field11S setComponent4(java.lang.Long component4) { - setComponent(4, SwiftFormatUtils.getLong(component4)); - return this; - } /** * Alternative method setter for field's ISN (component 4) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10 becomes an Integer) * * @param component4 the Number with the ISN content to set * @return the field object to enable build pattern - * @see #setISN(java.lang.Long) */ public Field11S setComponent4(java.lang.Number component4) { @@ -723,27 +668,13 @@ public Field11S setISN(String component4) { return setComponent4(component4); } - /** - * Set the ISN (component 4) from a Long object. - * - * @see #setComponent4(java.lang.Long) - * - * @param component4 Long with the ISN content to set - * @return the field object to enable build pattern - * @since 9.2.7 - */ - public Field11S setISN(java.lang.Long component4) { - return setComponent4(component4); - } - /** * Alternative method setter for field's ISN (component 4) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10 becomes an Integer) * * @param component4 the Number with the ISN content to set * @return the field object to enable build pattern - * @see #setISN(java.lang.Long) */ public Field11S setISN(java.lang.Number component4) { return setComponent4(component4); @@ -755,6 +686,7 @@ public Field11S setISN(java.lang.Number component4) { * * @return the list of converted components (a Calendar object or null) */ + @Override public List dates() { return DateResolver.dates(this); } @@ -832,7 +764,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field11S(f)); } @@ -848,6 +780,7 @@ public static List getAll(final SwiftTagListBlock block) { * @return line content or null if not present or if line number is above the expected * @since 7.7 */ + @Override public String getLine(int line) { return getLine(line, 0); } @@ -861,6 +794,7 @@ public String getLine(int line) { * @return line content or null if not present or if line number is above the expected * @since 7.7 */ + @Override public String getLine(int line, int offset) { Field11S cp = newInstance(this); return getLine(cp, line, null, offset); @@ -873,6 +807,7 @@ public String getLine(int line, int offset) { * @return lines content or empty list if field's value is empty * @since 7.7 */ + @Override public List getLines() { return SwiftParseUtils.getLines(getValue()); } @@ -885,6 +820,7 @@ public List getLines() { * @return found lines or empty list if lines are not present or the offset is invalid * @since 7.7 */ + @Override public List getLines(int offset) { Field11S cp = newInstance(this); return SwiftParseUtils.getLines(getLine(cp, null, null, offset)); @@ -899,6 +835,7 @@ public List getLines(int offset) { * @return found lines or empty list if value is empty * @since 7.7 */ + @Override public List getLinesBetween(int start, int end) { return getLinesBetween(start, end, 0); } @@ -913,6 +850,7 @@ public List getLinesBetween(int start, int end) { * @return found lines or empty list if lines are not present or the offset is invalid * @since 7.7 */ + @Override public List getLinesBetween(int start, int end, int offset) { Field11S cp = newInstance(this); return SwiftParseUtils.getLines(getLine(cp, start, end, offset)); diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field12.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field12.java index fafe34a06..eb5104eeb 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field12.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field12.java @@ -31,12 +31,9 @@ import java.math.BigInteger; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -185,19 +182,16 @@ public String getValue() { */ @Override public String getValueDisplay(int component, Locale locale) { - if (component < 1 || component > 1) { + if (component != 1) { throw new IllegalArgumentException("invalid component number " + component + " for field 12"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -344,32 +338,14 @@ public Field12 setComponent1(String component1) { return this; } - /** - * Set the component1 from a Long object. - *
- * If the component being set is a fixed length number, the argument will not be - * padded. It is recommended for these cases to use the setComponent1(String) - * method. - * - * @see #setComponent1(String) - * @since 9.2.7 - * - * @param component1 the Long with the Message Type content to set - * @return the field object to enable build pattern - */ - public Field12 setComponent1(java.lang.Long component1) { - setComponent(1, SwiftFormatUtils.getLong(component1)); - return this; - } /** * Alternative method setter for field's Message Type (component 1) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10 becomes an Integer) * * @param component1 the Number with the Message Type content to set * @return the field object to enable build pattern - * @see #setMessageType(java.lang.Long) */ public Field12 setComponent1(java.lang.Number component1) { @@ -399,27 +375,13 @@ public Field12 setMessageType(String component1) { return setComponent1(component1); } - /** - * Set the Message Type (component 1) from a Long object. - * - * @see #setComponent1(java.lang.Long) - * - * @param component1 Long with the Message Type content to set - * @return the field object to enable build pattern - * @since 9.2.7 - */ - public Field12 setMessageType(java.lang.Long component1) { - return setComponent1(component1); - } - /** * Alternative method setter for field's Message Type (component 1) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10 becomes an Integer) * * @param component1 the Number with the Message Type content to set * @return the field object to enable build pattern - * @see #setMessageType(java.lang.Long) */ public Field12 setMessageType(java.lang.Number component1) { return setComponent1(component1); @@ -490,7 +452,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field12(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field120.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field120.java index 67a303816..6692df42c 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field120.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field120.java @@ -31,12 +31,9 @@ import java.math.BigInteger; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -185,19 +182,16 @@ public String getValue() { */ @Override public String getValueDisplay(int component, Locale locale) { - if (component < 1 || component > 1) { + if (component != 1) { throw new IllegalArgumentException("invalid component number " + component + " for field 120"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -344,32 +338,14 @@ public Field120 setComponent1(String component1) { return this; } - /** - * Set the component1 from a Long object. - *
- * If the component being set is a fixed length number, the argument will not be - * padded. It is recommended for these cases to use the setComponent1(String) - * method. - * - * @see #setComponent1(String) - * @since 9.2.7 - * - * @param component1 the Long with the Identifier content to set - * @return the field object to enable build pattern - */ - public Field120 setComponent1(java.lang.Long component1) { - setComponent(1, SwiftFormatUtils.getLong(component1)); - return this; - } /** * Alternative method setter for field's Identifier (component 1) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10 becomes an Integer) * * @param component1 the Number with the Identifier content to set * @return the field object to enable build pattern - * @see #setIdentifier(java.lang.Long) */ public Field120 setComponent1(java.lang.Number component1) { @@ -399,27 +375,13 @@ public Field120 setIdentifier(String component1) { return setComponent1(component1); } - /** - * Set the Identifier (component 1) from a Long object. - * - * @see #setComponent1(java.lang.Long) - * - * @param component1 Long with the Identifier content to set - * @return the field object to enable build pattern - * @since 9.2.7 - */ - public Field120 setIdentifier(java.lang.Long component1) { - return setComponent1(component1); - } - /** * Alternative method setter for field's Identifier (component 1) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10 becomes an Integer) * * @param component1 the Number with the Identifier content to set * @return the field object to enable build pattern - * @see #setIdentifier(java.lang.Long) */ public Field120 setIdentifier(java.lang.Number component1) { return setComponent1(component1); @@ -490,7 +452,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field120(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field121.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field121.java index 9f9504566..3d56a147f 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field121.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field121.java @@ -29,12 +29,9 @@ -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -183,19 +180,16 @@ public String getValue() { */ @Override public String getValueDisplay(int component, Locale locale) { - if (component < 1 || component > 1) { + if (component != 1) { throw new IllegalArgumentException("invalid component number " + component + " for field 121"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -398,7 +392,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field121(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field123.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field123.java index 9c34dec87..babfb7574 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field123.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field123.java @@ -29,12 +29,9 @@ -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -183,19 +180,16 @@ public String getValue() { */ @Override public String getValueDisplay(int component, Locale locale) { - if (component < 1 || component > 1) { + if (component != 1) { throw new IllegalArgumentException("invalid component number " + component + " for field 123"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -398,7 +392,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field123(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field124.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field124.java index 1fc2a5ff2..b12be4cd2 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field124.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field124.java @@ -31,12 +31,9 @@ import java.math.BigInteger; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -185,19 +182,16 @@ public String getValue() { */ @Override public String getValueDisplay(int component, Locale locale) { - if (component < 1 || component > 1) { + if (component != 1) { throw new IllegalArgumentException("invalid component number " + component + " for field 124"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -400,7 +394,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field124(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field125.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field125.java index cdaf9b3d1..616e89a4e 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field125.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field125.java @@ -31,12 +31,9 @@ import java.math.BigInteger; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -185,19 +182,16 @@ public String getValue() { */ @Override public String getValueDisplay(int component, Locale locale) { - if (component < 1 || component > 1) { + if (component != 1) { throw new IllegalArgumentException("invalid component number " + component + " for field 125"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -344,32 +338,14 @@ public Field125 setComponent1(String component1) { return this; } - /** - * Set the component1 from a Long object. - *
- * If the component being set is a fixed length number, the argument will not be - * padded. It is recommended for these cases to use the setComponent1(String) - * method. - * - * @see #setComponent1(String) - * @since 9.2.7 - * - * @param component1 the Long with the Category content to set - * @return the field object to enable build pattern - */ - public Field125 setComponent1(java.lang.Long component1) { - setComponent(1, SwiftFormatUtils.getLong(component1)); - return this; - } /** * Alternative method setter for field's Category (component 1) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10 becomes an Integer) * * @param component1 the Number with the Category content to set * @return the field object to enable build pattern - * @see #setCategory(java.lang.Long) */ public Field125 setComponent1(java.lang.Number component1) { @@ -399,27 +375,13 @@ public Field125 setCategory(String component1) { return setComponent1(component1); } - /** - * Set the Category (component 1) from a Long object. - * - * @see #setComponent1(java.lang.Long) - * - * @param component1 Long with the Category content to set - * @return the field object to enable build pattern - * @since 9.2.7 - */ - public Field125 setCategory(java.lang.Long component1) { - return setComponent1(component1); - } - /** * Alternative method setter for field's Category (component 1) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10 becomes an Integer) * * @param component1 the Number with the Category content to set * @return the field object to enable build pattern - * @see #setCategory(java.lang.Long) */ public Field125 setCategory(java.lang.Number component1) { return setComponent1(component1); @@ -490,7 +452,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field125(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field126.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field126.java index 7807ed5d7..14ed9e302 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field126.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field126.java @@ -31,12 +31,9 @@ import java.math.BigInteger; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -185,19 +182,16 @@ public String getValue() { */ @Override public String getValueDisplay(int component, Locale locale) { - if (component < 1 || component > 1) { + if (component != 1) { throw new IllegalArgumentException("invalid component number " + component + " for field 126"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -344,32 +338,14 @@ public Field126 setComponent1(String component1) { return this; } - /** - * Set the component1 from a Long object. - *
- * If the component being set is a fixed length number, the argument will not be - * padded. It is recommended for these cases to use the setComponent1(String) - * method. - * - * @see #setComponent1(String) - * @since 9.2.7 - * - * @param component1 the Long with the Seed content to set - * @return the field object to enable build pattern - */ - public Field126 setComponent1(java.lang.Long component1) { - setComponent(1, SwiftFormatUtils.getLong(component1)); - return this; - } /** * Alternative method setter for field's Seed (component 1) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10 becomes an Integer) * * @param component1 the Number with the Seed content to set * @return the field object to enable build pattern - * @see #setSeed(java.lang.Long) */ public Field126 setComponent1(java.lang.Number component1) { @@ -399,27 +375,13 @@ public Field126 setSeed(String component1) { return setComponent1(component1); } - /** - * Set the Seed (component 1) from a Long object. - * - * @see #setComponent1(java.lang.Long) - * - * @param component1 Long with the Seed content to set - * @return the field object to enable build pattern - * @since 9.2.7 - */ - public Field126 setSeed(java.lang.Long component1) { - return setComponent1(component1); - } - /** * Alternative method setter for field's Seed (component 1) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10 becomes an Integer) * * @param component1 the Number with the Seed content to set * @return the field object to enable build pattern - * @see #setSeed(java.lang.Long) */ public Field126 setSeed(java.lang.Number component1) { return setComponent1(component1); @@ -490,7 +452,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field126(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field127.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field127.java index ed1baa3b1..188fc6071 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field127.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field127.java @@ -29,12 +29,9 @@ -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -183,19 +180,16 @@ public String getValue() { */ @Override public String getValueDisplay(int component, Locale locale) { - if (component < 1 || component > 1) { + if (component != 1) { throw new IllegalArgumentException("invalid component number " + component + " for field 127"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -398,7 +392,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field127(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field128.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field128.java index eb10e16f2..60d82606b 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field128.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field128.java @@ -32,12 +32,9 @@ import com.prowidesoftware.swift.model.field.BICContainer; import com.prowidesoftware.swift.model.field.BICResolver; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -202,16 +199,14 @@ public String getValueDisplay(int component, Locale locale) { //default format (as is) return getComponent(1); } - if (component == 2) { - //default format (as is) - return getComponent(2); - } - return null; + // This is the last component, return directly without `if` + //default format (as is) + return getComponent(2); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -430,10 +425,12 @@ public Field128 setBIC(com.prowidesoftware.swift.model.BIC component2) { } + @Override public List bics() { return BICResolver.bics(this); } + @Override public List bicStrings () { return BICResolver.bicStrings(this); } @@ -502,7 +499,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field128(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field129.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field129.java index c7a30f125..99103657b 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field129.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field129.java @@ -31,12 +31,9 @@ import java.math.BigInteger; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -201,16 +198,14 @@ public String getValueDisplay(int component, Locale locale) { //default format (as is) return getComponent(1); } - if (component == 2) { - //default format (as is) - return getComponent(2); - } - return null; + // This is the last component, return directly without `if` + //default format (as is) + return getComponent(2); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -395,32 +390,14 @@ public Field129 setComponent1(String component1) { return this; } - /** - * Set the component1 from a Long object. - *
- * If the component being set is a fixed length number, the argument will not be - * padded. It is recommended for these cases to use the setComponent1(String) - * method. - * - * @see #setComponent1(String) - * @since 9.2.7 - * - * @param component1 the Long with the Section content to set - * @return the field object to enable build pattern - */ - public Field129 setComponent1(java.lang.Long component1) { - setComponent(1, SwiftFormatUtils.getLong(component1)); - return this; - } /** * Alternative method setter for field's Section (component 1) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10 becomes an Integer) * * @param component1 the Number with the Section content to set * @return the field object to enable build pattern - * @see #setSection(java.lang.Long) */ public Field129 setComponent1(java.lang.Number component1) { @@ -450,27 +427,13 @@ public Field129 setSection(String component1) { return setComponent1(component1); } - /** - * Set the Section (component 1) from a Long object. - * - * @see #setComponent1(java.lang.Long) - * - * @param component1 Long with the Section content to set - * @return the field object to enable build pattern - * @since 9.2.7 - */ - public Field129 setSection(java.lang.Long component1) { - return setComponent1(component1); - } - /** * Alternative method setter for field's Section (component 1) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10 becomes an Integer) * * @param component1 the Number with the Section content to set * @return the field object to enable build pattern - * @see #setSection(java.lang.Long) */ public Field129 setSection(java.lang.Number component1) { return setComponent1(component1); @@ -487,32 +450,14 @@ public Field129 setComponent2(String component2) { return this; } - /** - * Set the component2 from a Long object. - *
- * If the component being set is a fixed length number, the argument will not be - * padded. It is recommended for these cases to use the setComponent2(String) - * method. - * - * @see #setComponent2(String) - * @since 9.2.7 - * - * @param component2 the Long with the Total content to set - * @return the field object to enable build pattern - */ - public Field129 setComponent2(java.lang.Long component2) { - setComponent(2, SwiftFormatUtils.getLong(component2)); - return this; - } /** * Alternative method setter for field's Total (component 2) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10 becomes an Integer) * * @param component2 the Number with the Total content to set * @return the field object to enable build pattern - * @see #setTotal(java.lang.Long) */ public Field129 setComponent2(java.lang.Number component2) { @@ -542,27 +487,13 @@ public Field129 setTotal(String component2) { return setComponent2(component2); } - /** - * Set the Total (component 2) from a Long object. - * - * @see #setComponent2(java.lang.Long) - * - * @param component2 Long with the Total content to set - * @return the field object to enable build pattern - * @since 9.2.7 - */ - public Field129 setTotal(java.lang.Long component2) { - return setComponent2(component2); - } - /** * Alternative method setter for field's Total (component 2) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10 becomes an Integer) * * @param component2 the Number with the Total content to set * @return the field object to enable build pattern - * @see #setTotal(java.lang.Long) */ public Field129 setTotal(java.lang.Number component2) { return setComponent2(component2); @@ -633,7 +564,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field129(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field12A.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field12A.java index 194a006b6..8afb8d109 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field12A.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field12A.java @@ -30,12 +30,9 @@ import com.prowidesoftware.swift.model.field.GenericField; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -215,16 +212,14 @@ public String getValueDisplay(int component, Locale locale) { //default format (as is) return getComponent(2); } - if (component == 3) { - //default format (as is) - return getComponent(3); - } - return null; + // This is the last component, return directly without `if` + //default format (as is) + return getComponent(3); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -456,6 +451,7 @@ public Field12A setInstrumentCodeOrDescription(String component3) { * * @return DSS component value or null if the DSS is not set or not available for this field. */ + @Override public String getDSS() { return getComponent2(); } @@ -466,6 +462,7 @@ public String getDSS() { * @see #getDSS() * @return true if DSS is present, false otherwise. */ + @Override public boolean isDSSPresent() { return getComponent2() != null; } @@ -480,6 +477,7 @@ public boolean isDSSPresent() { * * @return for generic fields returns the value of the conditional qualifier or null if not set or not applicable for this field. */ + @Override public String getConditionalQualifier() { return getComponent(CONDITIONAL_QUALIFIER); } @@ -547,7 +545,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field12A(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field12B.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field12B.java index b27d7b599..a5540feeb 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field12B.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field12B.java @@ -30,12 +30,9 @@ import com.prowidesoftware.swift.model.field.GenericField; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -220,16 +217,14 @@ public String getValueDisplay(int component, Locale locale) { //default format (as is) return getComponent(2); } - if (component == 3) { - //default format (as is) - return getComponent(3); - } - return null; + // This is the last component, return directly without `if` + //default format (as is) + return getComponent(3); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -472,6 +467,7 @@ public Field12B setType(String component3) { * * @return DSS component value or null if the DSS is not set or not available for this field. */ + @Override public String getDSS() { return getComponent2(); } @@ -482,6 +478,7 @@ public String getDSS() { * @see #getDSS() * @return true if DSS is present, false otherwise. */ + @Override public boolean isDSSPresent() { return getComponent2() != null; } @@ -496,6 +493,7 @@ public boolean isDSSPresent() { * * @return for generic fields returns the value of the conditional qualifier or null if not set or not applicable for this field. */ + @Override public String getConditionalQualifier() { return getComponent(CONDITIONAL_QUALIFIER); } @@ -563,7 +561,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field12B(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field12C.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field12C.java index ae6c2facb..0384d16b3 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field12C.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field12C.java @@ -30,12 +30,9 @@ import com.prowidesoftware.swift.model.field.GenericField; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -201,16 +198,14 @@ public String getValueDisplay(int component, Locale locale) { //default format (as is) return getComponent(1); } - if (component == 2) { - //default format (as is) - return getComponent(2); - } - return null; + // This is the last component, return directly without `if` + //default format (as is) + return getComponent(2); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -396,6 +391,7 @@ public Field12C setCFICode(String component2) { * * @return DSS component value or null if the DSS is not set or not available for this field. */ + @Override public String getDSS() { return null; } @@ -406,6 +402,7 @@ public String getDSS() { * @see #getDSS() * @return true if DSS is present, false otherwise. */ + @Override public boolean isDSSPresent() { return false; } @@ -420,6 +417,7 @@ public boolean isDSSPresent() { * * @return for generic fields returns the value of the conditional qualifier or null if not set or not applicable for this field. */ + @Override public String getConditionalQualifier() { return getComponent(CONDITIONAL_QUALIFIER); } @@ -487,7 +485,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field12C(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field12D.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field12D.java index 471904dbe..49cfa25d7 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field12D.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field12D.java @@ -29,12 +29,9 @@ -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -183,19 +180,16 @@ public String getValue() { */ @Override public String getValueDisplay(int component, Locale locale) { - if (component < 1 || component > 1) { + if (component != 1) { throw new IllegalArgumentException("invalid component number " + component + " for field 12D"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -398,7 +392,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field12D(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field12E.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field12E.java index 06ed5c222..214f09392 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field12E.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field12E.java @@ -29,12 +29,9 @@ -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -190,19 +187,16 @@ public String getValue() { */ @Override public String getValueDisplay(int component, Locale locale) { - if (component < 1 || component > 1) { + if (component != 1) { throw new IllegalArgumentException("invalid component number " + component + " for field 12E"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -422,7 +416,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field12E(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field12F.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field12F.java index 924224969..5d139277a 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field12F.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field12F.java @@ -29,12 +29,9 @@ -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -183,19 +180,16 @@ public String getValue() { */ @Override public String getValueDisplay(int component, Locale locale) { - if (component < 1 || component > 1) { + if (component != 1) { throw new IllegalArgumentException("invalid component number " + component + " for field 12F"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -398,7 +392,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field12F(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field12G.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field12G.java index bf02eb2fe..14ab84928 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field12G.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field12G.java @@ -29,12 +29,9 @@ -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -183,19 +180,16 @@ public String getValue() { */ @Override public String getValueDisplay(int component, Locale locale) { - if (component < 1 || component > 1) { + if (component != 1) { throw new IllegalArgumentException("invalid component number " + component + " for field 12G"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -398,7 +392,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field12G(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field130.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field130.java index a262580f3..a9963d7f8 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field130.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field130.java @@ -32,12 +32,9 @@ import com.prowidesoftware.swift.model.field.MultiLineField; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -237,16 +234,14 @@ public String getValueDisplay(int component, Locale locale) { //default format (as is) return getComponent(3); } - if (component == 4) { - //default format (as is) - return getComponent(4); - } - return null; + // This is the last component, return directly without `if` + //default format (as is) + return getComponent(4); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -469,32 +464,14 @@ public Field130 setComponent1(String component1) { return this; } - /** - * Set the component1 from a Long object. - *
- * If the component being set is a fixed length number, the argument will not be - * padded. It is recommended for these cases to use the setComponent1(String) - * method. - * - * @see #setComponent1(String) - * @since 9.2.7 - * - * @param component1 the Long with the Heading Code content to set - * @return the field object to enable build pattern - */ - public Field130 setComponent1(java.lang.Long component1) { - setComponent(1, SwiftFormatUtils.getLong(component1)); - return this; - } /** * Alternative method setter for field's Heading Code (component 1) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10 becomes an Integer) * * @param component1 the Number with the Heading Code content to set * @return the field object to enable build pattern - * @see #setHeadingCode(java.lang.Long) */ public Field130 setComponent1(java.lang.Number component1) { @@ -524,27 +501,13 @@ public Field130 setHeadingCode(String component1) { return setComponent1(component1); } - /** - * Set the Heading Code (component 1) from a Long object. - * - * @see #setComponent1(java.lang.Long) - * - * @param component1 Long with the Heading Code content to set - * @return the field object to enable build pattern - * @since 9.2.7 - */ - public Field130 setHeadingCode(java.lang.Long component1) { - return setComponent1(component1); - } - /** * Alternative method setter for field's Heading Code (component 1) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10 becomes an Integer) * * @param component1 the Number with the Heading Code content to set * @return the field object to enable build pattern - * @see #setHeadingCode(java.lang.Long) */ public Field130 setHeadingCode(java.lang.Number component1) { return setComponent1(component1); @@ -582,32 +545,14 @@ public Field130 setComponent3(String component3) { return this; } - /** - * Set the component3 from a Long object. - *
- * If the component being set is a fixed length number, the argument will not be - * padded. It is recommended for these cases to use the setComponent3(String) - * method. - * - * @see #setComponent3(String) - * @since 9.2.7 - * - * @param component3 the Long with the Heading Code 2 content to set - * @return the field object to enable build pattern - */ - public Field130 setComponent3(java.lang.Long component3) { - setComponent(3, SwiftFormatUtils.getLong(component3)); - return this; - } /** * Alternative method setter for field's Heading Code 2 (component 3) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10 becomes an Integer) * * @param component3 the Number with the Heading Code 2 content to set * @return the field object to enable build pattern - * @see #setHeadingCode2(java.lang.Long) */ public Field130 setComponent3(java.lang.Number component3) { @@ -637,27 +582,13 @@ public Field130 setHeadingCode2(String component3) { return setComponent3(component3); } - /** - * Set the Heading Code 2 (component 3) from a Long object. - * - * @see #setComponent3(java.lang.Long) - * - * @param component3 Long with the Heading Code 2 content to set - * @return the field object to enable build pattern - * @since 9.2.7 - */ - public Field130 setHeadingCode2(java.lang.Long component3) { - return setComponent3(component3); - } - /** * Alternative method setter for field's Heading Code 2 (component 3) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10 becomes an Integer) * * @param component3 the Number with the Heading Code 2 content to set * @return the field object to enable build pattern - * @see #setHeadingCode2(java.lang.Long) */ public Field130 setHeadingCode2(java.lang.Number component3) { return setComponent3(component3); @@ -749,7 +680,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field130(f)); } @@ -765,6 +696,7 @@ public static List getAll(final SwiftTagListBlock block) { * @return line content or null if not present or if line number is above the expected * @since 7.7 */ + @Override public String getLine(int line) { return getLine(line, 0); } @@ -778,6 +710,7 @@ public String getLine(int line) { * @return line content or null if not present or if line number is above the expected * @since 7.7 */ + @Override public String getLine(int line, int offset) { Field130 cp = newInstance(this); return getLine(cp, line, null, offset); @@ -790,6 +723,7 @@ public String getLine(int line, int offset) { * @return lines content or empty list if field's value is empty * @since 7.7 */ + @Override public List getLines() { return SwiftParseUtils.getLines(getValue()); } @@ -802,6 +736,7 @@ public List getLines() { * @return found lines or empty list if lines are not present or the offset is invalid * @since 7.7 */ + @Override public List getLines(int offset) { Field130 cp = newInstance(this); return SwiftParseUtils.getLines(getLine(cp, null, null, offset)); @@ -816,6 +751,7 @@ public List getLines(int offset) { * @return found lines or empty list if value is empty * @since 7.7 */ + @Override public List getLinesBetween(int start, int end) { return getLinesBetween(start, end, 0); } @@ -830,6 +766,7 @@ public List getLinesBetween(int start, int end) { * @return found lines or empty list if lines are not present or the offset is invalid * @since 7.7 */ + @Override public List getLinesBetween(int start, int end, int offset) { Field130 cp = newInstance(this); return SwiftParseUtils.getLines(getLine(cp, start, end, offset)); diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field132.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field132.java index 6b6b1fe6b..1b9973ba5 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field132.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field132.java @@ -31,12 +31,9 @@ import java.math.BigInteger; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -199,16 +196,14 @@ public String getValueDisplay(int component, Locale locale) { //default format (as is) return getComponent(1); } - if (component == 2) { - //default format (as is) - return getComponent(2); - } - return null; + // This is the last component, return directly without `if` + //default format (as is) + return getComponent(2); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -398,32 +393,14 @@ public Field132 setComponent2(String component2) { return this; } - /** - * Set the component2 from a Long object. - *
- * If the component being set is a fixed length number, the argument will not be - * padded. It is recommended for these cases to use the setComponent2(String) - * method. - * - * @see #setComponent2(String) - * @since 9.2.7 - * - * @param component2 the Long with the Broadcast Number content to set - * @return the field object to enable build pattern - */ - public Field132 setComponent2(java.lang.Long component2) { - setComponent(2, SwiftFormatUtils.getLong(component2)); - return this; - } /** * Alternative method setter for field's Broadcast Number (component 2) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10 becomes an Integer) * * @param component2 the Number with the Broadcast Number content to set * @return the field object to enable build pattern - * @see #setBroadcastNumber(java.lang.Long) */ public Field132 setComponent2(java.lang.Number component2) { @@ -453,27 +430,13 @@ public Field132 setBroadcastNumber(String component2) { return setComponent2(component2); } - /** - * Set the Broadcast Number (component 2) from a Long object. - * - * @see #setComponent2(java.lang.Long) - * - * @param component2 Long with the Broadcast Number content to set - * @return the field object to enable build pattern - * @since 9.2.7 - */ - public Field132 setBroadcastNumber(java.lang.Long component2) { - return setComponent2(component2); - } - /** * Alternative method setter for field's Broadcast Number (component 2) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10 becomes an Integer) * * @param component2 the Number with the Broadcast Number content to set * @return the field object to enable build pattern - * @see #setBroadcastNumber(java.lang.Long) */ public Field132 setBroadcastNumber(java.lang.Number component2) { return setComponent2(component2); @@ -544,7 +507,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field132(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field133.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field133.java index 53dc8ba49..28e763067 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field133.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field133.java @@ -31,12 +31,9 @@ import java.math.BigInteger; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -234,16 +231,14 @@ public String getValueDisplay(int component, Locale locale) { //default format (as is) return getComponent(3); } - if (component == 4) { - //default format (as is) - return getComponent(4); - } - return null; + // This is the last component, return directly without `if` + //default format (as is) + return getComponent(4); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -510,32 +505,14 @@ public Field133 setComponent4(String component4) { return this; } - /** - * Set the component4 from a Long object. - *
- * If the component being set is a fixed length number, the argument will not be - * padded. It is recommended for these cases to use the setComponent4(String) - * method. - * - * @see #setComponent4(String) - * @since 9.2.7 - * - * @param component4 the Long with the Broadcast Number content to set - * @return the field object to enable build pattern - */ - public Field133 setComponent4(java.lang.Long component4) { - setComponent(4, SwiftFormatUtils.getLong(component4)); - return this; - } /** * Alternative method setter for field's Broadcast Number (component 4) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10 becomes an Integer) * * @param component4 the Number with the Broadcast Number content to set * @return the field object to enable build pattern - * @see #setBroadcastNumber(java.lang.Long) */ public Field133 setComponent4(java.lang.Number component4) { @@ -565,27 +542,13 @@ public Field133 setBroadcastNumber(String component4) { return setComponent4(component4); } - /** - * Set the Broadcast Number (component 4) from a Long object. - * - * @see #setComponent4(java.lang.Long) - * - * @param component4 Long with the Broadcast Number content to set - * @return the field object to enable build pattern - * @since 9.2.7 - */ - public Field133 setBroadcastNumber(java.lang.Long component4) { - return setComponent4(component4); - } - /** * Alternative method setter for field's Broadcast Number (component 4) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10 becomes an Integer) * * @param component4 the Number with the Broadcast Number content to set * @return the field object to enable build pattern - * @see #setBroadcastNumber(java.lang.Long) */ public Field133 setBroadcastNumber(java.lang.Number component4) { return setComponent4(component4); @@ -656,7 +619,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field133(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field134.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field134.java index 2b821acff..da48104a4 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field134.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field134.java @@ -33,12 +33,9 @@ import com.prowidesoftware.swift.model.field.BICContainer; import com.prowidesoftware.swift.model.field.BICResolver; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -219,16 +216,14 @@ public String getValueDisplay(int component, Locale locale) { //default format (as is) return getComponent(2); } - if (component == 3) { - //default format (as is) - return getComponent(3); - } - return null; + // This is the last component, return directly without `if` + //default format (as is) + return getComponent(3); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -487,10 +482,12 @@ public Field134 setBroadcastRequesterCity(String component3) { } + @Override public List bics() { return BICResolver.bics(this); } + @Override public List bicStrings () { return BICResolver.bicStrings(this); } @@ -559,7 +556,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field134(f)); } @@ -575,6 +572,7 @@ public static List getAll(final SwiftTagListBlock block) { * @return line content or null if not present or if line number is above the expected * @since 7.7 */ + @Override public String getLine(int line) { return getLine(line, 0); } @@ -588,6 +586,7 @@ public String getLine(int line) { * @return line content or null if not present or if line number is above the expected * @since 7.7 */ + @Override public String getLine(int line, int offset) { Field134 cp = newInstance(this); return getLine(cp, line, null, offset); @@ -600,6 +599,7 @@ public String getLine(int line, int offset) { * @return lines content or empty list if field's value is empty * @since 7.7 */ + @Override public List getLines() { return SwiftParseUtils.getLines(getValue()); } @@ -612,6 +612,7 @@ public List getLines() { * @return found lines or empty list if lines are not present or the offset is invalid * @since 7.7 */ + @Override public List getLines(int offset) { Field134 cp = newInstance(this); return SwiftParseUtils.getLines(getLine(cp, null, null, offset)); @@ -626,6 +627,7 @@ public List getLines(int offset) { * @return found lines or empty list if value is empty * @since 7.7 */ + @Override public List getLinesBetween(int start, int end) { return getLinesBetween(start, end, 0); } @@ -640,6 +642,7 @@ public List getLinesBetween(int start, int end) { * @return found lines or empty list if lines are not present or the offset is invalid * @since 7.7 */ + @Override public List getLinesBetween(int start, int end, int offset) { Field134 cp = newInstance(this); return SwiftParseUtils.getLines(getLine(cp, start, end, offset)); diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field135.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field135.java index be63e08c5..1127e90d5 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field135.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field135.java @@ -29,12 +29,9 @@ -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -183,19 +180,16 @@ public String getValue() { */ @Override public String getValueDisplay(int component, Locale locale) { - if (component < 1 || component > 1) { + if (component != 1) { throw new IllegalArgumentException("invalid component number " + component + " for field 135"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -398,7 +392,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field135(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field136.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field136.java index cd5b69816..bfec6216f 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field136.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field136.java @@ -31,12 +31,9 @@ import java.math.BigInteger; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -199,16 +196,14 @@ public String getValueDisplay(int component, Locale locale) { //default format (as is) return getComponent(1); } - if (component == 2) { - //default format (as is) - return getComponent(2); - } - return null; + // This is the last component, return directly without `if` + //default format (as is) + return getComponent(2); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -395,32 +390,14 @@ public Field136 setComponent2(String component2) { return this; } - /** - * Set the component2 from a Long object. - *
- * If the component being set is a fixed length number, the argument will not be - * padded. It is recommended for these cases to use the setComponent2(String) - * method. - * - * @see #setComponent2(String) - * @since 9.2.7 - * - * @param component2 the Long with the Broadcast Number content to set - * @return the field object to enable build pattern - */ - public Field136 setComponent2(java.lang.Long component2) { - setComponent(2, SwiftFormatUtils.getLong(component2)); - return this; - } /** * Alternative method setter for field's Broadcast Number (component 2) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10 becomes an Integer) * * @param component2 the Number with the Broadcast Number content to set * @return the field object to enable build pattern - * @see #setBroadcastNumber(java.lang.Long) */ public Field136 setComponent2(java.lang.Number component2) { @@ -450,27 +427,13 @@ public Field136 setBroadcastNumber(String component2) { return setComponent2(component2); } - /** - * Set the Broadcast Number (component 2) from a Long object. - * - * @see #setComponent2(java.lang.Long) - * - * @param component2 Long with the Broadcast Number content to set - * @return the field object to enable build pattern - * @since 9.2.7 - */ - public Field136 setBroadcastNumber(java.lang.Long component2) { - return setComponent2(component2); - } - /** * Alternative method setter for field's Broadcast Number (component 2) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10 becomes an Integer) * * @param component2 the Number with the Broadcast Number content to set * @return the field object to enable build pattern - * @see #setBroadcastNumber(java.lang.Long) */ public Field136 setBroadcastNumber(java.lang.Number component2) { return setComponent2(component2); @@ -541,7 +504,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field136(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field137.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field137.java index fe7b6a43e..d8656223c 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field137.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field137.java @@ -31,12 +31,9 @@ import java.math.BigInteger; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -234,16 +231,14 @@ public String getValueDisplay(int component, Locale locale) { //default format (as is) return getComponent(3); } - if (component == 4) { - //default format (as is) - return getComponent(4); - } - return null; + // This is the last component, return directly without `if` + //default format (as is) + return getComponent(4); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -510,32 +505,14 @@ public Field137 setComponent4(String component4) { return this; } - /** - * Set the component4 from a Long object. - *
- * If the component being set is a fixed length number, the argument will not be - * padded. It is recommended for these cases to use the setComponent4(String) - * method. - * - * @see #setComponent4(String) - * @since 9.2.7 - * - * @param component4 the Long with the Broadcast Number content to set - * @return the field object to enable build pattern - */ - public Field137 setComponent4(java.lang.Long component4) { - setComponent(4, SwiftFormatUtils.getLong(component4)); - return this; - } /** * Alternative method setter for field's Broadcast Number (component 4) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10 becomes an Integer) * * @param component4 the Number with the Broadcast Number content to set * @return the field object to enable build pattern - * @see #setBroadcastNumber(java.lang.Long) */ public Field137 setComponent4(java.lang.Number component4) { @@ -565,27 +542,13 @@ public Field137 setBroadcastNumber(String component4) { return setComponent4(component4); } - /** - * Set the Broadcast Number (component 4) from a Long object. - * - * @see #setComponent4(java.lang.Long) - * - * @param component4 Long with the Broadcast Number content to set - * @return the field object to enable build pattern - * @since 9.2.7 - */ - public Field137 setBroadcastNumber(java.lang.Long component4) { - return setComponent4(component4); - } - /** * Alternative method setter for field's Broadcast Number (component 4) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10 becomes an Integer) * * @param component4 the Number with the Broadcast Number content to set * @return the field object to enable build pattern - * @see #setBroadcastNumber(java.lang.Long) */ public Field137 setBroadcastNumber(java.lang.Number component4) { return setComponent4(component4); @@ -656,7 +619,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field137(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field13A.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field13A.java index ac02ad16d..8a8f0546c 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field13A.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field13A.java @@ -30,12 +30,9 @@ import com.prowidesoftware.swift.model.field.GenericField; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -207,16 +204,14 @@ public String getValueDisplay(int component, Locale locale) { //default format (as is) return getComponent(1); } - if (component == 2) { - //default format (as is) - return getComponent(2); - } - return null; + // This is the last component, return directly without `if` + //default format (as is) + return getComponent(2); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -416,6 +411,7 @@ public Field13A setNumberIdentification(String component2) { * * @return DSS component value or null if the DSS is not set or not available for this field. */ + @Override public String getDSS() { return null; } @@ -426,6 +422,7 @@ public String getDSS() { * @see #getDSS() * @return true if DSS is present, false otherwise. */ + @Override public boolean isDSSPresent() { return false; } @@ -440,6 +437,7 @@ public boolean isDSSPresent() { * * @return for generic fields returns the value of the conditional qualifier or null if not set or not applicable for this field. */ + @Override public String getConditionalQualifier() { return getComponent(CONDITIONAL_QUALIFIER); } @@ -507,7 +505,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field13A(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field13B.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field13B.java index 8a44ae3e8..72ca6e9ae 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field13B.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field13B.java @@ -30,12 +30,9 @@ import com.prowidesoftware.swift.model.field.GenericField; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -214,16 +211,14 @@ public String getValueDisplay(int component, Locale locale) { //default format (as is) return getComponent(2); } - if (component == 3) { - //default format (as is) - return getComponent(3); - } - return null; + // This is the last component, return directly without `if` + //default format (as is) + return getComponent(3); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -452,6 +447,7 @@ public Field13B setNumber(String component3) { * * @return DSS component value or null if the DSS is not set or not available for this field. */ + @Override public String getDSS() { return getComponent2(); } @@ -462,6 +458,7 @@ public String getDSS() { * @see #getDSS() * @return true if DSS is present, false otherwise. */ + @Override public boolean isDSSPresent() { return getComponent2() != null; } @@ -476,6 +473,7 @@ public boolean isDSSPresent() { * * @return for generic fields returns the value of the conditional qualifier or null if not set or not applicable for this field. */ + @Override public String getConditionalQualifier() { return getComponent(CONDITIONAL_QUALIFIER); } @@ -543,7 +541,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field13B(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field13C.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field13C.java index b1a11cb93..29a8393e5 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field13C.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field13C.java @@ -30,12 +30,9 @@ import java.util.Calendar; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -240,16 +237,14 @@ public String getValueDisplay(int component, Locale locale) { //default format (as is) return getComponent(3); } - if (component == 4) { - //default format (as is) - return getComponent(4); - } - return null; + // This is the last component, return directly without `if` + //default format (as is) + return getComponent(4); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -658,7 +653,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field13C(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field13D.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field13D.java index 0e8011435..e64f566ba 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field13D.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field13D.java @@ -32,12 +32,9 @@ import com.prowidesoftware.swift.model.field.DateContainer; import com.prowidesoftware.swift.model.field.DateResolver; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -240,16 +237,14 @@ public String getValueDisplay(int component, Locale locale) { //default format (as is) return getComponent(3); } - if (component == 4) { - //default format (as is) - return getComponent(4); - } - return null; + // This is the last component, return directly without `if` + //default format (as is) + return getComponent(4); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -633,6 +628,7 @@ public Field13D setOffset(java.util.Calendar component4) { * * @return the list of converted components (a Calendar object or null) */ + @Override public List dates() { return DateResolver.dates(this); } @@ -710,7 +706,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field13D(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field13J.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field13J.java index 3590d9014..08df0b000 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field13J.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field13J.java @@ -30,12 +30,9 @@ import com.prowidesoftware.swift.model.field.GenericField; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -202,16 +199,14 @@ public String getValueDisplay(int component, Locale locale) { //default format (as is) return getComponent(1); } - if (component == 2) { - //default format (as is) - return getComponent(2); - } - return null; + // This is the last component, return directly without `if` + //default format (as is) + return getComponent(2); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -400,6 +395,7 @@ public Field13J setExtendedNumberId(String component2) { * * @return DSS component value or null if the DSS is not set or not available for this field. */ + @Override public String getDSS() { return null; } @@ -410,6 +406,7 @@ public String getDSS() { * @see #getDSS() * @return true if DSS is present, false otherwise. */ + @Override public boolean isDSSPresent() { return false; } @@ -424,6 +421,7 @@ public boolean isDSSPresent() { * * @return for generic fields returns the value of the conditional qualifier or null if not set or not applicable for this field. */ + @Override public String getConditionalQualifier() { return getComponent(CONDITIONAL_QUALIFIER); } @@ -491,7 +489,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field13J(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field140.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field140.java index 3903e4500..216ca00e6 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field140.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field140.java @@ -31,12 +31,9 @@ import java.math.BigInteger; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -185,19 +182,16 @@ public String getValue() { */ @Override public String getValueDisplay(int component, Locale locale) { - if (component < 1 || component > 1) { + if (component != 1) { throw new IllegalArgumentException("invalid component number " + component + " for field 140"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -344,32 +338,14 @@ public Field140 setComponent1(String component1) { return this; } - /** - * Set the component1 from a Long object. - *
- * If the component being set is a fixed length number, the argument will not be - * padded. It is recommended for these cases to use the setComponent1(String) - * method. - * - * @see #setComponent1(String) - * @since 9.2.7 - * - * @param component1 the Long with the Identifier content to set - * @return the field object to enable build pattern - */ - public Field140 setComponent1(java.lang.Long component1) { - setComponent(1, SwiftFormatUtils.getLong(component1)); - return this; - } /** * Alternative method setter for field's Identifier (component 1) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10 becomes an Integer) * * @param component1 the Number with the Identifier content to set * @return the field object to enable build pattern - * @see #setIdentifier(java.lang.Long) */ public Field140 setComponent1(java.lang.Number component1) { @@ -399,27 +375,13 @@ public Field140 setIdentifier(String component1) { return setComponent1(component1); } - /** - * Set the Identifier (component 1) from a Long object. - * - * @see #setComponent1(java.lang.Long) - * - * @param component1 Long with the Identifier content to set - * @return the field object to enable build pattern - * @since 9.2.7 - */ - public Field140 setIdentifier(java.lang.Long component1) { - return setComponent1(component1); - } - /** * Alternative method setter for field's Identifier (component 1) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10 becomes an Integer) * * @param component1 the Number with the Identifier content to set * @return the field object to enable build pattern - * @see #setIdentifier(java.lang.Long) */ public Field140 setIdentifier(java.lang.Number component1) { return setComponent1(component1); @@ -490,7 +452,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field140(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field141.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field141.java index 0467d35f2..ce64f645b 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field141.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field141.java @@ -29,12 +29,9 @@ -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -183,19 +180,16 @@ public String getValue() { */ @Override public String getValueDisplay(int component, Locale locale) { - if (component < 1 || component > 1) { + if (component != 1) { throw new IllegalArgumentException("invalid component number " + component + " for field 141"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -398,7 +392,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field141(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field142.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field142.java index 72f2e301c..8df1ada30 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field142.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field142.java @@ -32,12 +32,9 @@ import com.prowidesoftware.swift.model.field.DateContainer; import com.prowidesoftware.swift.model.field.DateResolver; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -186,24 +183,22 @@ public String getValue() { */ @Override public String getValueDisplay(int component, Locale locale) { - if (component < 1 || component > 1) { + if (component != 1) { throw new IllegalArgumentException("invalid component number " + component + " for field 142"); } - if (component == 1) { - //datetime: [YY]YYMMDDHHMM - java.text.DateFormat df = java.text.DateFormat.getDateInstance(java.text.DateFormat.DEFAULT, notNull(locale)); - java.text.DateFormat tf = new java.text.SimpleDateFormat("HH:mm", notNull(locale)); - java.util.Calendar cal = getComponent1AsCalendar(); - if (cal != null) { - return df.format(cal.getTime()) + " " + tf.format(cal.getTime()); - } + //datetime: [YY]YYMMDDHHMM + java.text.DateFormat df = java.text.DateFormat.getDateInstance(java.text.DateFormat.DEFAULT, notNull(locale)); + java.text.DateFormat tf = new java.text.SimpleDateFormat("HH:mm", notNull(locale)); + java.util.Calendar cal = getComponent1AsCalendar(); + if (cal != null) { + return df.format(cal.getTime()) + " " + tf.format(cal.getTime()); } return null; } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -388,6 +383,7 @@ public Field142 setStartDateTime(java.util.Calendar component1) { * @return the list of converted components (a Calendar object or null) * @since 9.2.7 */ + @Override public List dates() { return DateResolver.dates(this); } @@ -466,7 +462,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field142(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field143.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field143.java index 1e16c485f..b7319cfb6 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field143.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field143.java @@ -32,12 +32,9 @@ import com.prowidesoftware.swift.model.field.DateContainer; import com.prowidesoftware.swift.model.field.DateResolver; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -186,24 +183,22 @@ public String getValue() { */ @Override public String getValueDisplay(int component, Locale locale) { - if (component < 1 || component > 1) { + if (component != 1) { throw new IllegalArgumentException("invalid component number " + component + " for field 143"); } - if (component == 1) { - //datetime: [YY]YYMMDDHHMM - java.text.DateFormat df = java.text.DateFormat.getDateInstance(java.text.DateFormat.DEFAULT, notNull(locale)); - java.text.DateFormat tf = new java.text.SimpleDateFormat("HH:mm", notNull(locale)); - java.util.Calendar cal = getComponent1AsCalendar(); - if (cal != null) { - return df.format(cal.getTime()) + " " + tf.format(cal.getTime()); - } + //datetime: [YY]YYMMDDHHMM + java.text.DateFormat df = java.text.DateFormat.getDateInstance(java.text.DateFormat.DEFAULT, notNull(locale)); + java.text.DateFormat tf = new java.text.SimpleDateFormat("HH:mm", notNull(locale)); + java.util.Calendar cal = getComponent1AsCalendar(); + if (cal != null) { + return df.format(cal.getTime()) + " " + tf.format(cal.getTime()); } return null; } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -388,6 +383,7 @@ public Field143 setEndDateTime(java.util.Calendar component1) { * @return the list of converted components (a Calendar object or null) * @since 9.2.7 */ + @Override public List dates() { return DateResolver.dates(this); } @@ -466,7 +462,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field143(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field144.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field144.java index 412ff9eed..c90950d75 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field144.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field144.java @@ -31,12 +31,9 @@ import java.math.BigInteger; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -185,19 +182,16 @@ public String getValue() { */ @Override public String getValueDisplay(int component, Locale locale) { - if (component < 1 || component > 1) { + if (component != 1) { throw new IllegalArgumentException("invalid component number " + component + " for field 144"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -344,32 +338,14 @@ public Field144 setComponent1(String component1) { return this; } - /** - * Set the component1 from a Long object. - *
- * If the component being set is a fixed length number, the argument will not be - * padded. It is recommended for these cases to use the setComponent1(String) - * method. - * - * @see #setComponent1(String) - * @since 9.2.7 - * - * @param component1 the Long with the Status Code content to set - * @return the field object to enable build pattern - */ - public Field144 setComponent1(java.lang.Long component1) { - setComponent(1, SwiftFormatUtils.getLong(component1)); - return this; - } /** * Alternative method setter for field's Status Code (component 1) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10 becomes an Integer) * * @param component1 the Number with the Status Code content to set * @return the field object to enable build pattern - * @see #setStatusCode(java.lang.Long) */ public Field144 setComponent1(java.lang.Number component1) { @@ -399,27 +375,13 @@ public Field144 setStatusCode(String component1) { return setComponent1(component1); } - /** - * Set the Status Code (component 1) from a Long object. - * - * @see #setComponent1(java.lang.Long) - * - * @param component1 Long with the Status Code content to set - * @return the field object to enable build pattern - * @since 9.2.7 - */ - public Field144 setStatusCode(java.lang.Long component1) { - return setComponent1(component1); - } - /** * Alternative method setter for field's Status Code (component 1) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10 becomes an Integer) * * @param component1 the Number with the Status Code content to set * @return the field object to enable build pattern - * @see #setStatusCode(java.lang.Long) */ public Field144 setStatusCode(java.lang.Number component1) { return setComponent1(component1); @@ -490,7 +452,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field144(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field14A.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field14A.java index eb156902f..05c813497 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field14A.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field14A.java @@ -29,12 +29,9 @@ -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -183,19 +180,16 @@ public String getValue() { */ @Override public String getValueDisplay(int component, Locale locale) { - if (component < 1 || component > 1) { + if (component != 1) { throw new IllegalArgumentException("invalid component number " + component + " for field 14A"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -398,7 +392,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field14A(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field14B.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field14B.java index 576402971..1ac403847 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field14B.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field14B.java @@ -29,12 +29,9 @@ -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -183,19 +180,16 @@ public String getValue() { */ @Override public String getValueDisplay(int component, Locale locale) { - if (component < 1 || component > 1) { + if (component != 1) { throw new IllegalArgumentException("invalid component number " + component + " for field 14B"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -398,7 +392,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field14B(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field14C.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field14C.java index a5456ad34..7920253ed 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field14C.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field14C.java @@ -31,12 +31,9 @@ import java.math.BigInteger; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -185,19 +182,16 @@ public String getValue() { */ @Override public String getValueDisplay(int component, Locale locale) { - if (component < 1 || component > 1) { + if (component != 1) { throw new IllegalArgumentException("invalid component number " + component + " for field 14C"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -344,32 +338,14 @@ public Field14C setComponent1(String component1) { return this; } - /** - * Set the component1 from a Long object. - *
- * If the component being set is a fixed length number, the argument will not be - * padded. It is recommended for these cases to use the setComponent1(String) - * method. - * - * @see #setComponent1(String) - * @since 9.2.7 - * - * @param component1 the Long with the Year content to set - * @return the field object to enable build pattern - */ - public Field14C setComponent1(java.lang.Long component1) { - setComponent(1, SwiftFormatUtils.getLong(component1)); - return this; - } /** * Alternative method setter for field's Year (component 1) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10 becomes an Integer) * * @param component1 the Number with the Year content to set * @return the field object to enable build pattern - * @see #setYear(java.lang.Long) */ public Field14C setComponent1(java.lang.Number component1) { @@ -399,27 +375,13 @@ public Field14C setYear(String component1) { return setComponent1(component1); } - /** - * Set the Year (component 1) from a Long object. - * - * @see #setComponent1(java.lang.Long) - * - * @param component1 Long with the Year content to set - * @return the field object to enable build pattern - * @since 9.2.7 - */ - public Field14C setYear(java.lang.Long component1) { - return setComponent1(component1); - } - /** * Alternative method setter for field's Year (component 1) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10 becomes an Integer) * * @param component1 the Number with the Year content to set * @return the field object to enable build pattern - * @see #setYear(java.lang.Long) */ public Field14C setYear(java.lang.Number component1) { return setComponent1(component1); @@ -490,7 +452,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field14C(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field14D.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field14D.java index c4c9aeb40..829f07d31 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field14D.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field14D.java @@ -29,12 +29,9 @@ -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -183,19 +180,16 @@ public String getValue() { */ @Override public String getValueDisplay(int component, Locale locale) { - if (component < 1 || component > 1) { + if (component != 1) { throw new IllegalArgumentException("invalid component number " + component + " for field 14D"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -398,7 +392,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field14D(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field14E.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field14E.java index 4012a6482..772714f23 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field14E.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field14E.java @@ -29,12 +29,9 @@ -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -183,19 +180,16 @@ public String getValue() { */ @Override public String getValueDisplay(int component, Locale locale) { - if (component < 1 || component > 1) { + if (component != 1) { throw new IllegalArgumentException("invalid component number " + component + " for field 14E"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -398,7 +392,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field14E(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field14F.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field14F.java index af55e79de..e7fded607 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field14F.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field14F.java @@ -29,12 +29,9 @@ -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -183,19 +180,16 @@ public String getValue() { */ @Override public String getValueDisplay(int component, Locale locale) { - if (component < 1 || component > 1) { + if (component != 1) { throw new IllegalArgumentException("invalid component number " + component + " for field 14F"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -398,7 +392,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field14F(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field14G.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field14G.java index 198f160d0..e68f84bf7 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field14G.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field14G.java @@ -29,12 +29,9 @@ -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -199,16 +196,14 @@ public String getValueDisplay(int component, Locale locale) { //default format (as is) return getComponent(1); } - if (component == 2) { - //default format (as is) - return getComponent(2); - } - return null; + // This is the last component, return directly without `if` + //default format (as is) + return getComponent(2); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -451,7 +446,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field14G(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field14H.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field14H.java index 31b724c99..c80091052 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field14H.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field14H.java @@ -29,12 +29,9 @@ -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -183,19 +180,16 @@ public String getValue() { */ @Override public String getValueDisplay(int component, Locale locale) { - if (component < 1 || component > 1) { + if (component != 1) { throw new IllegalArgumentException("invalid component number " + component + " for field 14H"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -398,7 +392,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field14H(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field14J.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field14J.java index 19daf2fd2..954d34a6f 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field14J.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field14J.java @@ -29,12 +29,9 @@ -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -183,19 +180,16 @@ public String getValue() { */ @Override public String getValueDisplay(int component, Locale locale) { - if (component < 1 || component > 1) { + if (component != 1) { throw new IllegalArgumentException("invalid component number " + component + " for field 14J"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -398,7 +392,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field14J(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field14K.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field14K.java index c6d74f863..af027ccaf 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field14K.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field14K.java @@ -29,12 +29,9 @@ -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -183,19 +180,16 @@ public String getValue() { */ @Override public String getValueDisplay(int component, Locale locale) { - if (component < 1 || component > 1) { + if (component != 1) { throw new IllegalArgumentException("invalid component number " + component + " for field 14K"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -398,7 +392,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field14K(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field14L.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field14L.java index 93fb4fd6e..0e714650e 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field14L.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field14L.java @@ -29,12 +29,9 @@ -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -183,19 +180,16 @@ public String getValue() { */ @Override public String getValueDisplay(int component, Locale locale) { - if (component < 1 || component > 1) { + if (component != 1) { throw new IllegalArgumentException("invalid component number " + component + " for field 14L"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -398,7 +392,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field14L(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field14M.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field14M.java index 3eda899b4..0b4afa30a 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field14M.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field14M.java @@ -29,12 +29,9 @@ -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -183,19 +180,16 @@ public String getValue() { */ @Override public String getValueDisplay(int component, Locale locale) { - if (component < 1 || component > 1) { + if (component != 1) { throw new IllegalArgumentException("invalid component number " + component + " for field 14M"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -398,7 +392,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field14M(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field14N.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field14N.java index f82b595e1..cf8a60922 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field14N.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field14N.java @@ -29,12 +29,9 @@ -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -183,19 +180,16 @@ public String getValue() { */ @Override public String getValueDisplay(int component, Locale locale) { - if (component < 1 || component > 1) { + if (component != 1) { throw new IllegalArgumentException("invalid component number " + component + " for field 14N"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -398,7 +392,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field14N(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field14O.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field14O.java index 0cb605d46..883e7fa42 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field14O.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field14O.java @@ -29,12 +29,9 @@ -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -183,19 +180,16 @@ public String getValue() { */ @Override public String getValueDisplay(int component, Locale locale) { - if (component < 1 || component > 1) { + if (component != 1) { throw new IllegalArgumentException("invalid component number " + component + " for field 14O"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -398,7 +392,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field14O(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field14S.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field14S.java index e4b2bde3b..94cc2d880 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field14S.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field14S.java @@ -32,12 +32,9 @@ import java.util.Calendar; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -246,16 +243,14 @@ public String getValueDisplay(int component, Locale locale) { return f.format(cal.getTime()); } } - if (component == 4) { - //default format (as is) - return getComponent(4); - } - return null; + // This is the last component, return directly without `if` + //default format (as is) + return getComponent(4); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -503,32 +498,14 @@ public Field14S setComponent2(String component2) { return this; } - /** - * Set the component2 from a Long object. - *
- * If the component being set is a fixed length number, the argument will not be - * padded. It is recommended for these cases to use the setComponent2(String) - * method. - * - * @see #setComponent2(String) - * @since 9.2.7 - * - * @param component2 the Long with the Number content to set - * @return the field object to enable build pattern - */ - public Field14S setComponent2(java.lang.Long component2) { - setComponent(2, SwiftFormatUtils.getLong(component2)); - return this; - } /** * Alternative method setter for field's Number (component 2) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10 becomes an Integer) * * @param component2 the Number with the Number content to set * @return the field object to enable build pattern - * @see #setNumber(java.lang.Long) */ public Field14S setComponent2(java.lang.Number component2) { @@ -558,27 +535,13 @@ public Field14S setNumber(String component2) { return setComponent2(component2); } - /** - * Set the Number (component 2) from a Long object. - * - * @see #setComponent2(java.lang.Long) - * - * @param component2 Long with the Number content to set - * @return the field object to enable build pattern - * @since 9.2.7 - */ - public Field14S setNumber(java.lang.Long component2) { - return setComponent2(component2); - } - /** * Alternative method setter for field's Number (component 2) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10 becomes an Integer) * * @param component2 the Number with the Number content to set * @return the field object to enable build pattern - * @see #setNumber(java.lang.Long) */ public Field14S setNumber(java.lang.Number component2) { return setComponent2(component2); @@ -714,7 +677,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field14S(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field151.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field151.java index 30eef70b5..ad44fd5bb 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field151.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field151.java @@ -31,12 +31,9 @@ import java.math.BigInteger; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -185,19 +182,16 @@ public String getValue() { */ @Override public String getValueDisplay(int component, Locale locale) { - if (component < 1 || component > 1) { + if (component != 1) { throw new IllegalArgumentException("invalid component number " + component + " for field 151"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -344,32 +338,14 @@ public Field151 setComponent1(String component1) { return this; } - /** - * Set the component1 from a Long object. - *
- * If the component being set is a fixed length number, the argument will not be - * padded. It is recommended for these cases to use the setComponent1(String) - * method. - * - * @see #setComponent1(String) - * @since 9.2.7 - * - * @param component1 the Long with the Session Number content to set - * @return the field object to enable build pattern - */ - public Field151 setComponent1(java.lang.Long component1) { - setComponent(1, SwiftFormatUtils.getLong(component1)); - return this; - } /** * Alternative method setter for field's Session Number (component 1) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10 becomes an Integer) * * @param component1 the Number with the Session Number content to set * @return the field object to enable build pattern - * @see #setSessionNumber(java.lang.Long) */ public Field151 setComponent1(java.lang.Number component1) { @@ -399,27 +375,13 @@ public Field151 setSessionNumber(String component1) { return setComponent1(component1); } - /** - * Set the Session Number (component 1) from a Long object. - * - * @see #setComponent1(java.lang.Long) - * - * @param component1 Long with the Session Number content to set - * @return the field object to enable build pattern - * @since 9.2.7 - */ - public Field151 setSessionNumber(java.lang.Long component1) { - return setComponent1(component1); - } - /** * Alternative method setter for field's Session Number (component 1) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10 becomes an Integer) * * @param component1 the Number with the Session Number content to set * @return the field object to enable build pattern - * @see #setSessionNumber(java.lang.Long) */ public Field151 setSessionNumber(java.lang.Number component1) { return setComponent1(component1); @@ -490,7 +452,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field151(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field152.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field152.java index b12a95635..3b5ebb8cb 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field152.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field152.java @@ -31,12 +31,9 @@ import java.math.BigInteger; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -185,19 +182,16 @@ public String getValue() { */ @Override public String getValueDisplay(int component, Locale locale) { - if (component < 1 || component > 1) { + if (component != 1) { throw new IllegalArgumentException("invalid component number " + component + " for field 152"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -344,32 +338,14 @@ public Field152 setComponent1(String component1) { return this; } - /** - * Set the component1 from a Long object. - *
- * If the component being set is a fixed length number, the argument will not be - * padded. It is recommended for these cases to use the setComponent1(String) - * method. - * - * @see #setComponent1(String) - * @since 9.2.7 - * - * @param component1 the Long with the Sequence Number content to set - * @return the field object to enable build pattern - */ - public Field152 setComponent1(java.lang.Long component1) { - setComponent(1, SwiftFormatUtils.getLong(component1)); - return this; - } /** * Alternative method setter for field's Sequence Number (component 1) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10 becomes an Integer) * * @param component1 the Number with the Sequence Number content to set * @return the field object to enable build pattern - * @see #setSequenceNumber(java.lang.Long) */ public Field152 setComponent1(java.lang.Number component1) { @@ -399,27 +375,13 @@ public Field152 setSequenceNumber(String component1) { return setComponent1(component1); } - /** - * Set the Sequence Number (component 1) from a Long object. - * - * @see #setComponent1(java.lang.Long) - * - * @param component1 Long with the Sequence Number content to set - * @return the field object to enable build pattern - * @since 9.2.7 - */ - public Field152 setSequenceNumber(java.lang.Long component1) { - return setComponent1(component1); - } - /** * Alternative method setter for field's Sequence Number (component 1) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10 becomes an Integer) * * @param component1 the Number with the Sequence Number content to set * @return the field object to enable build pattern - * @see #setSequenceNumber(java.lang.Long) */ public Field152 setSequenceNumber(java.lang.Number component1) { return setComponent1(component1); @@ -490,7 +452,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field152(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field153.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field153.java index 905f8601b..8e57d3821 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field153.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field153.java @@ -31,12 +31,9 @@ import java.math.BigInteger; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -185,19 +182,16 @@ public String getValue() { */ @Override public String getValueDisplay(int component, Locale locale) { - if (component < 1 || component > 1) { + if (component != 1) { throw new IllegalArgumentException("invalid component number " + component + " for field 153"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -344,32 +338,14 @@ public Field153 setComponent1(String component1) { return this; } - /** - * Set the component1 from a Long object. - *
- * If the component being set is a fixed length number, the argument will not be - * padded. It is recommended for these cases to use the setComponent1(String) - * method. - * - * @see #setComponent1(String) - * @since 9.2.7 - * - * @param component1 the Long with the Sequence Number content to set - * @return the field object to enable build pattern - */ - public Field153 setComponent1(java.lang.Long component1) { - setComponent(1, SwiftFormatUtils.getLong(component1)); - return this; - } /** * Alternative method setter for field's Sequence Number (component 1) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10 becomes an Integer) * * @param component1 the Number with the Sequence Number content to set * @return the field object to enable build pattern - * @see #setSequenceNumber(java.lang.Long) */ public Field153 setComponent1(java.lang.Number component1) { @@ -399,27 +375,13 @@ public Field153 setSequenceNumber(String component1) { return setComponent1(component1); } - /** - * Set the Sequence Number (component 1) from a Long object. - * - * @see #setComponent1(java.lang.Long) - * - * @param component1 Long with the Sequence Number content to set - * @return the field object to enable build pattern - * @since 9.2.7 - */ - public Field153 setSequenceNumber(java.lang.Long component1) { - return setComponent1(component1); - } - /** * Alternative method setter for field's Sequence Number (component 1) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10 becomes an Integer) * * @param component1 the Number with the Sequence Number content to set * @return the field object to enable build pattern - * @see #setSequenceNumber(java.lang.Long) */ public Field153 setSequenceNumber(java.lang.Number component1) { return setComponent1(component1); @@ -490,7 +452,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field153(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field15A.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field15A.java index 70eba0414..53d3b95e5 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field15A.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field15A.java @@ -29,12 +29,9 @@ -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -178,19 +175,16 @@ public String getValue() { */ @Override public String getValueDisplay(int component, Locale locale) { - if (component < 1 || component > 1) { + if (component != 1) { throw new IllegalArgumentException("invalid component number " + component + " for field 15A"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -373,7 +367,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field15A(f)); } @@ -388,13 +382,11 @@ public static List getAll(final SwiftTagListBlock block) { * @since 7.10.3 * @see Field#fromJson(String) */ + @SuppressWarnings("unused") public static Field15A fromJson(final String json) { - final Field15A field = new Field15A(); - - - return field; + return new Field15A(); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field15B.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field15B.java index 033496fb6..a77b075a1 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field15B.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field15B.java @@ -29,12 +29,9 @@ -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -178,19 +175,16 @@ public String getValue() { */ @Override public String getValueDisplay(int component, Locale locale) { - if (component < 1 || component > 1) { + if (component != 1) { throw new IllegalArgumentException("invalid component number " + component + " for field 15B"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -373,7 +367,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field15B(f)); } @@ -388,13 +382,11 @@ public static List getAll(final SwiftTagListBlock block) { * @since 7.10.3 * @see Field#fromJson(String) */ + @SuppressWarnings("unused") public static Field15B fromJson(final String json) { - final Field15B field = new Field15B(); - - - return field; + return new Field15B(); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field15C.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field15C.java index 24210a01e..0c0943cc2 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field15C.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field15C.java @@ -29,12 +29,9 @@ -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -178,19 +175,16 @@ public String getValue() { */ @Override public String getValueDisplay(int component, Locale locale) { - if (component < 1 || component > 1) { + if (component != 1) { throw new IllegalArgumentException("invalid component number " + component + " for field 15C"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -373,7 +367,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field15C(f)); } @@ -388,13 +382,11 @@ public static List getAll(final SwiftTagListBlock block) { * @since 7.10.3 * @see Field#fromJson(String) */ + @SuppressWarnings("unused") public static Field15C fromJson(final String json) { - final Field15C field = new Field15C(); - - - return field; + return new Field15C(); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field15D.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field15D.java index 2bf0e6dd8..66a489c11 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field15D.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field15D.java @@ -29,12 +29,9 @@ -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -178,19 +175,16 @@ public String getValue() { */ @Override public String getValueDisplay(int component, Locale locale) { - if (component < 1 || component > 1) { + if (component != 1) { throw new IllegalArgumentException("invalid component number " + component + " for field 15D"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -373,7 +367,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field15D(f)); } @@ -388,13 +382,11 @@ public static List getAll(final SwiftTagListBlock block) { * @since 7.10.3 * @see Field#fromJson(String) */ + @SuppressWarnings("unused") public static Field15D fromJson(final String json) { - final Field15D field = new Field15D(); - - - return field; + return new Field15D(); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field15E.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field15E.java index a2b3553f4..1fee666d6 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field15E.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field15E.java @@ -29,12 +29,9 @@ -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -178,19 +175,16 @@ public String getValue() { */ @Override public String getValueDisplay(int component, Locale locale) { - if (component < 1 || component > 1) { + if (component != 1) { throw new IllegalArgumentException("invalid component number " + component + " for field 15E"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -373,7 +367,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field15E(f)); } @@ -388,13 +382,11 @@ public static List getAll(final SwiftTagListBlock block) { * @since 7.10.3 * @see Field#fromJson(String) */ + @SuppressWarnings("unused") public static Field15E fromJson(final String json) { - final Field15E field = new Field15E(); - - - return field; + return new Field15E(); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field15F.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field15F.java index aa8f10821..063aa6da2 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field15F.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field15F.java @@ -29,12 +29,9 @@ -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -178,19 +175,16 @@ public String getValue() { */ @Override public String getValueDisplay(int component, Locale locale) { - if (component < 1 || component > 1) { + if (component != 1) { throw new IllegalArgumentException("invalid component number " + component + " for field 15F"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -373,7 +367,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field15F(f)); } @@ -388,13 +382,11 @@ public static List getAll(final SwiftTagListBlock block) { * @since 7.10.3 * @see Field#fromJson(String) */ + @SuppressWarnings("unused") public static Field15F fromJson(final String json) { - final Field15F field = new Field15F(); - - - return field; + return new Field15F(); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field15G.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field15G.java index c7828cf86..e7833cd81 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field15G.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field15G.java @@ -29,12 +29,9 @@ -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -178,19 +175,16 @@ public String getValue() { */ @Override public String getValueDisplay(int component, Locale locale) { - if (component < 1 || component > 1) { + if (component != 1) { throw new IllegalArgumentException("invalid component number " + component + " for field 15G"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -373,7 +367,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field15G(f)); } @@ -388,13 +382,11 @@ public static List getAll(final SwiftTagListBlock block) { * @since 7.10.3 * @see Field#fromJson(String) */ + @SuppressWarnings("unused") public static Field15G fromJson(final String json) { - final Field15G field = new Field15G(); - - - return field; + return new Field15G(); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field15H.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field15H.java index a90055a64..52fdf6d01 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field15H.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field15H.java @@ -29,12 +29,9 @@ -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -178,19 +175,16 @@ public String getValue() { */ @Override public String getValueDisplay(int component, Locale locale) { - if (component < 1 || component > 1) { + if (component != 1) { throw new IllegalArgumentException("invalid component number " + component + " for field 15H"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -373,7 +367,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field15H(f)); } @@ -388,13 +382,11 @@ public static List getAll(final SwiftTagListBlock block) { * @since 7.10.3 * @see Field#fromJson(String) */ + @SuppressWarnings("unused") public static Field15H fromJson(final String json) { - final Field15H field = new Field15H(); - - - return field; + return new Field15H(); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field15I.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field15I.java index 03c35c256..f52cf252c 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field15I.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field15I.java @@ -29,12 +29,9 @@ -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -178,19 +175,16 @@ public String getValue() { */ @Override public String getValueDisplay(int component, Locale locale) { - if (component < 1 || component > 1) { + if (component != 1) { throw new IllegalArgumentException("invalid component number " + component + " for field 15I"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -373,7 +367,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field15I(f)); } @@ -388,13 +382,11 @@ public static List getAll(final SwiftTagListBlock block) { * @since 7.10.3 * @see Field#fromJson(String) */ + @SuppressWarnings("unused") public static Field15I fromJson(final String json) { - final Field15I field = new Field15I(); - - - return field; + return new Field15I(); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field15J.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field15J.java index 0dcb171a5..2fe1fbbe0 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field15J.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field15J.java @@ -29,12 +29,9 @@ -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -178,19 +175,16 @@ public String getValue() { */ @Override public String getValueDisplay(int component, Locale locale) { - if (component < 1 || component > 1) { + if (component != 1) { throw new IllegalArgumentException("invalid component number " + component + " for field 15J"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -373,7 +367,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field15J(f)); } @@ -388,13 +382,11 @@ public static List getAll(final SwiftTagListBlock block) { * @since 7.10.3 * @see Field#fromJson(String) */ + @SuppressWarnings("unused") public static Field15J fromJson(final String json) { - final Field15J field = new Field15J(); - - - return field; + return new Field15J(); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field15K.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field15K.java index 50449c156..fd001d10a 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field15K.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field15K.java @@ -29,12 +29,9 @@ -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -178,19 +175,16 @@ public String getValue() { */ @Override public String getValueDisplay(int component, Locale locale) { - if (component < 1 || component > 1) { + if (component != 1) { throw new IllegalArgumentException("invalid component number " + component + " for field 15K"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -373,7 +367,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field15K(f)); } @@ -388,13 +382,11 @@ public static List getAll(final SwiftTagListBlock block) { * @since 7.10.3 * @see Field#fromJson(String) */ + @SuppressWarnings("unused") public static Field15K fromJson(final String json) { - final Field15K field = new Field15K(); - - - return field; + return new Field15K(); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field15L.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field15L.java index aa56becf2..96a162f21 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field15L.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field15L.java @@ -29,12 +29,9 @@ -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -178,19 +175,16 @@ public String getValue() { */ @Override public String getValueDisplay(int component, Locale locale) { - if (component < 1 || component > 1) { + if (component != 1) { throw new IllegalArgumentException("invalid component number " + component + " for field 15L"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -373,7 +367,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field15L(f)); } @@ -388,13 +382,11 @@ public static List getAll(final SwiftTagListBlock block) { * @since 7.10.3 * @see Field#fromJson(String) */ + @SuppressWarnings("unused") public static Field15L fromJson(final String json) { - final Field15L field = new Field15L(); - - - return field; + return new Field15L(); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field15M.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field15M.java index 3eaf3ba97..559dfca1f 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field15M.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field15M.java @@ -29,12 +29,9 @@ -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -178,19 +175,16 @@ public String getValue() { */ @Override public String getValueDisplay(int component, Locale locale) { - if (component < 1 || component > 1) { + if (component != 1) { throw new IllegalArgumentException("invalid component number " + component + " for field 15M"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -373,7 +367,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field15M(f)); } @@ -388,13 +382,11 @@ public static List getAll(final SwiftTagListBlock block) { * @since 7.10.3 * @see Field#fromJson(String) */ + @SuppressWarnings("unused") public static Field15M fromJson(final String json) { - final Field15M field = new Field15M(); - - - return field; + return new Field15M(); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field15N.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field15N.java index 34849dd8d..b9fd718d9 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field15N.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field15N.java @@ -29,12 +29,9 @@ -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -178,19 +175,16 @@ public String getValue() { */ @Override public String getValueDisplay(int component, Locale locale) { - if (component < 1 || component > 1) { + if (component != 1) { throw new IllegalArgumentException("invalid component number " + component + " for field 15N"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -373,7 +367,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field15N(f)); } @@ -388,13 +382,11 @@ public static List getAll(final SwiftTagListBlock block) { * @since 7.10.3 * @see Field#fromJson(String) */ + @SuppressWarnings("unused") public static Field15N fromJson(final String json) { - final Field15N field = new Field15N(); - - - return field; + return new Field15N(); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field15O.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field15O.java index 1762eb21d..405c21ac4 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field15O.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field15O.java @@ -29,12 +29,9 @@ -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -178,19 +175,16 @@ public String getValue() { */ @Override public String getValueDisplay(int component, Locale locale) { - if (component < 1 || component > 1) { + if (component != 1) { throw new IllegalArgumentException("invalid component number " + component + " for field 15O"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -373,7 +367,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field15O(f)); } @@ -388,13 +382,11 @@ public static List getAll(final SwiftTagListBlock block) { * @since 7.10.3 * @see Field#fromJson(String) */ + @SuppressWarnings("unused") public static Field15O fromJson(final String json) { - final Field15O field = new Field15O(); - - - return field; + return new Field15O(); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field15P.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field15P.java index c3ce40718..07661a1ab 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field15P.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field15P.java @@ -29,12 +29,9 @@ -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -178,19 +175,16 @@ public String getValue() { */ @Override public String getValueDisplay(int component, Locale locale) { - if (component < 1 || component > 1) { + if (component != 1) { throw new IllegalArgumentException("invalid component number " + component + " for field 15P"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -373,7 +367,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field15P(f)); } @@ -388,13 +382,11 @@ public static List getAll(final SwiftTagListBlock block) { * @since 7.10.3 * @see Field#fromJson(String) */ + @SuppressWarnings("unused") public static Field15P fromJson(final String json) { - final Field15P field = new Field15P(); - - - return field; + return new Field15P(); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field165.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field165.java index aa9b35c0b..c17109bf2 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field165.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field165.java @@ -29,12 +29,9 @@ -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -200,16 +197,14 @@ public String getValueDisplay(int component, Locale locale) { //default format (as is) return getComponent(1); } - if (component == 2) { - //default format (as is) - return getComponent(2); - } - return null; + // This is the last component, return directly without `if` + //default format (as is) + return getComponent(2); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -452,7 +447,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field165(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field16A.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field16A.java index f1a51e675..d4280e342 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field16A.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field16A.java @@ -31,12 +31,9 @@ import java.math.BigInteger; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -185,19 +182,16 @@ public String getValue() { */ @Override public String getValueDisplay(int component, Locale locale) { - if (component < 1 || component > 1) { + if (component != 1) { throw new IllegalArgumentException("invalid component number " + component + " for field 16A"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -344,32 +338,14 @@ public Field16A setComponent1(String component1) { return this; } - /** - * Set the component1 from a Long object. - *
- * If the component being set is a fixed length number, the argument will not be - * padded. It is recommended for these cases to use the setComponent1(String) - * method. - * - * @see #setComponent1(String) - * @since 9.2.7 - * - * @param component1 the Long with the Number content to set - * @return the field object to enable build pattern - */ - public Field16A setComponent1(java.lang.Long component1) { - setComponent(1, SwiftFormatUtils.getLong(component1)); - return this; - } /** * Alternative method setter for field's Number (component 1) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10 becomes an Integer) * * @param component1 the Number with the Number content to set * @return the field object to enable build pattern - * @see #setNumber(java.lang.Long) */ public Field16A setComponent1(java.lang.Number component1) { @@ -399,27 +375,13 @@ public Field16A setNumber(String component1) { return setComponent1(component1); } - /** - * Set the Number (component 1) from a Long object. - * - * @see #setComponent1(java.lang.Long) - * - * @param component1 Long with the Number content to set - * @return the field object to enable build pattern - * @since 9.2.7 - */ - public Field16A setNumber(java.lang.Long component1) { - return setComponent1(component1); - } - /** * Alternative method setter for field's Number (component 1) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10 becomes an Integer) * * @param component1 the Number with the Number content to set * @return the field object to enable build pattern - * @see #setNumber(java.lang.Long) */ public Field16A setNumber(java.lang.Number component1) { return setComponent1(component1); @@ -490,7 +452,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field16A(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field16C.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field16C.java index 9d27d73f1..87f97c80b 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field16C.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field16C.java @@ -31,12 +31,9 @@ import java.math.BigInteger; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -185,19 +182,16 @@ public String getValue() { */ @Override public String getValueDisplay(int component, Locale locale) { - if (component < 1 || component > 1) { + if (component != 1) { throw new IllegalArgumentException("invalid component number " + component + " for field 16C"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -344,32 +338,14 @@ public Field16C setComponent1(String component1) { return this; } - /** - * Set the component1 from a Long object. - *
- * If the component being set is a fixed length number, the argument will not be - * padded. It is recommended for these cases to use the setComponent1(String) - * method. - * - * @see #setComponent1(String) - * @since 9.2.7 - * - * @param component1 the Long with the Number content to set - * @return the field object to enable build pattern - */ - public Field16C setComponent1(java.lang.Long component1) { - setComponent(1, SwiftFormatUtils.getLong(component1)); - return this; - } /** * Alternative method setter for field's Number (component 1) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10 becomes an Integer) * * @param component1 the Number with the Number content to set * @return the field object to enable build pattern - * @see #setNumber(java.lang.Long) */ public Field16C setComponent1(java.lang.Number component1) { @@ -399,27 +375,13 @@ public Field16C setNumber(String component1) { return setComponent1(component1); } - /** - * Set the Number (component 1) from a Long object. - * - * @see #setComponent1(java.lang.Long) - * - * @param component1 Long with the Number content to set - * @return the field object to enable build pattern - * @since 9.2.7 - */ - public Field16C setNumber(java.lang.Long component1) { - return setComponent1(component1); - } - /** * Alternative method setter for field's Number (component 1) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10 becomes an Integer) * * @param component1 the Number with the Number content to set * @return the field object to enable build pattern - * @see #setNumber(java.lang.Long) */ public Field16C setNumber(java.lang.Number component1) { return setComponent1(component1); @@ -490,7 +452,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field16C(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field16R.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field16R.java index 36acac41f..c3947d586 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field16R.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field16R.java @@ -29,12 +29,9 @@ -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -183,19 +180,16 @@ public String getValue() { */ @Override public String getValueDisplay(int component, Locale locale) { - if (component < 1 || component > 1) { + if (component != 1) { throw new IllegalArgumentException("invalid component number " + component + " for field 16R"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -398,7 +392,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field16R(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field16S.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field16S.java index 51bacea0e..3592cc8c2 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field16S.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field16S.java @@ -29,12 +29,9 @@ -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -183,19 +180,16 @@ public String getValue() { */ @Override public String getValueDisplay(int component, Locale locale) { - if (component < 1 || component > 1) { + if (component != 1) { throw new IllegalArgumentException("invalid component number " + component + " for field 16S"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -398,7 +392,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field16S(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field171.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field171.java index 869be3469..c6f3bf38a 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field171.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field171.java @@ -32,12 +32,9 @@ import com.prowidesoftware.swift.model.field.DateContainer; import com.prowidesoftware.swift.model.field.DateResolver; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -186,23 +183,21 @@ public String getValue() { */ @Override public String getValueDisplay(int component, Locale locale) { - if (component < 1 || component > 1) { + if (component != 1) { throw new IllegalArgumentException("invalid component number " + component + " for field 171"); } - if (component == 1) { - //date: [YY]YYMMDD - java.text.DateFormat f = java.text.DateFormat.getDateInstance(java.text.DateFormat.DEFAULT, notNull(locale)); - java.util.Calendar cal = getComponent1AsCalendar(); - if (cal != null) { - return f.format(cal.getTime()); - } + //date: [YY]YYMMDD + java.text.DateFormat f = java.text.DateFormat.getDateInstance(java.text.DateFormat.DEFAULT, notNull(locale)); + java.util.Calendar cal = getComponent1AsCalendar(); + if (cal != null) { + return f.format(cal.getTime()); } return null; } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -386,6 +381,7 @@ public Field171 setDate(java.util.Calendar component1) { * * @return the list of converted components (a Calendar object or null) */ + @Override public List dates() { return DateResolver.dates(this); } @@ -463,7 +459,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field171(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field172.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field172.java index afddfa1c7..2e6f7fed0 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field172.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field172.java @@ -32,12 +32,9 @@ import com.prowidesoftware.swift.model.field.DateContainer; import com.prowidesoftware.swift.model.field.DateResolver; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -210,20 +207,19 @@ public String getValueDisplay(int component, Locale locale) { return f.format(cal.getTime()); } } - if (component == 2) { - //month and day: MMDD - java.text.DateFormat f = new java.text.SimpleDateFormat("MMM dd", notNull(locale)); - java.util.Calendar cal = getComponent2AsCalendar(); - if (cal != null) { - return f.format(cal.getTime()); - } + // This is the last component, return directly without `if` + //month and day: MMDD + java.text.DateFormat f = new java.text.SimpleDateFormat("MMM dd", notNull(locale)); + java.util.Calendar cal = getComponent2AsCalendar(); + if (cal != null) { + return f.format(cal.getTime()); } return null; } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -488,6 +484,7 @@ public Field172 setEndDate(java.util.Calendar component2) { * @return the list of converted components (a Calendar object or null) * @since 9.2.7 */ + @Override public List dates() { return DateResolver.dates(this); } @@ -566,7 +563,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field172(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field173.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field173.java index 1c914e8df..e741d7667 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field173.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field173.java @@ -32,12 +32,9 @@ import com.prowidesoftware.swift.model.field.DateContainer; import com.prowidesoftware.swift.model.field.DateResolver; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -186,24 +183,22 @@ public String getValue() { */ @Override public String getValueDisplay(int component, Locale locale) { - if (component < 1 || component > 1) { + if (component != 1) { throw new IllegalArgumentException("invalid component number " + component + " for field 173"); } - if (component == 1) { - //day + time: DDHHMM - java.text.DateFormat df = new java.text.SimpleDateFormat("dd", notNull(locale)); - java.text.DateFormat tf = new java.text.SimpleDateFormat("HH:mm", notNull(locale)); - java.util.Calendar cal = getComponent1AsCalendar(); - if (cal != null) { - return df.format(cal.getTime()) + " " + tf.format(cal.getTime()); - } + //day + time: DDHHMM + java.text.DateFormat df = new java.text.SimpleDateFormat("dd", notNull(locale)); + java.text.DateFormat tf = new java.text.SimpleDateFormat("HH:mm", notNull(locale)); + java.util.Calendar cal = getComponent1AsCalendar(); + if (cal != null) { + return df.format(cal.getTime()) + " " + tf.format(cal.getTime()); } return null; } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -388,6 +383,7 @@ public Field173 setDayTime(java.util.Calendar component1) { * @return the list of converted components (a Calendar object or null) * @since 9.2.7 */ + @Override public List dates() { return DateResolver.dates(this); } @@ -466,7 +462,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field173(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field174.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field174.java index 1b163c8dd..06bca17dd 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field174.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field174.java @@ -30,12 +30,9 @@ import java.util.Calendar; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -184,19 +181,16 @@ public String getValue() { */ @Override public String getValueDisplay(int component, Locale locale) { - if (component < 1 || component > 1) { + if (component != 1) { throw new IllegalArgumentException("invalid component number " + component + " for field 174"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -439,7 +433,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field174(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field175.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field175.java index f0047e1cf..4c16e5009 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field175.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field175.java @@ -30,12 +30,9 @@ import java.util.Calendar; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -184,23 +181,21 @@ public String getValue() { */ @Override public String getValueDisplay(int component, Locale locale) { - if (component < 1 || component > 1) { + if (component != 1) { throw new IllegalArgumentException("invalid component number " + component + " for field 175"); } - if (component == 1) { - //time: HH[mm] - java.text.DateFormat f = new java.text.SimpleDateFormat("HH:mm", notNull(locale)); - java.util.Calendar cal = getComponent1AsCalendar(); - if (cal != null) { - return f.format(cal.getTime()); - } + //time: HH[mm] + java.text.DateFormat f = new java.text.SimpleDateFormat("HH:mm", notNull(locale)); + java.util.Calendar cal = getComponent1AsCalendar(); + if (cal != null) { + return f.format(cal.getTime()); } return null; } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -443,7 +438,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field175(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field177.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field177.java index 27dd2c223..3e0dfe82f 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field177.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field177.java @@ -32,12 +32,9 @@ import com.prowidesoftware.swift.model.field.DateContainer; import com.prowidesoftware.swift.model.field.DateResolver; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -186,24 +183,22 @@ public String getValue() { */ @Override public String getValueDisplay(int component, Locale locale) { - if (component < 1 || component > 1) { + if (component != 1) { throw new IllegalArgumentException("invalid component number " + component + " for field 177"); } - if (component == 1) { - //datetime: [YY]YYMMDDHHMM - java.text.DateFormat df = java.text.DateFormat.getDateInstance(java.text.DateFormat.DEFAULT, notNull(locale)); - java.text.DateFormat tf = new java.text.SimpleDateFormat("HH:mm", notNull(locale)); - java.util.Calendar cal = getComponent1AsCalendar(); - if (cal != null) { - return df.format(cal.getTime()) + " " + tf.format(cal.getTime()); - } + //datetime: [YY]YYMMDDHHMM + java.text.DateFormat df = java.text.DateFormat.getDateInstance(java.text.DateFormat.DEFAULT, notNull(locale)); + java.text.DateFormat tf = new java.text.SimpleDateFormat("HH:mm", notNull(locale)); + java.util.Calendar cal = getComponent1AsCalendar(); + if (cal != null) { + return df.format(cal.getTime()) + " " + tf.format(cal.getTime()); } return null; } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -388,6 +383,7 @@ public Field177 setDateTime(java.util.Calendar component1) { * @return the list of converted components (a Calendar object or null) * @since 9.2.7 */ + @Override public List dates() { return DateResolver.dates(this); } @@ -466,7 +462,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field177(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field179.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field179.java index f872d92a8..1f2cca101 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field179.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field179.java @@ -30,12 +30,9 @@ import java.util.Calendar; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -179,23 +176,21 @@ public String getValue() { */ @Override public String getValueDisplay(int component, Locale locale) { - if (component < 1 || component > 1) { + if (component != 1) { throw new IllegalArgumentException("invalid component number " + component + " for field 179"); } - if (component == 1) { - //time with seconds: HHmmss - java.text.DateFormat f = new java.text.SimpleDateFormat("HH:mm:ss", notNull(locale)); - java.util.Calendar cal = getComponent1AsCalendar(); - if (cal != null) { - return f.format(cal.getTime()); - } + //time with seconds: HHmmss + java.text.DateFormat f = new java.text.SimpleDateFormat("HH:mm:ss", notNull(locale)); + java.util.Calendar cal = getComponent1AsCalendar(); + if (cal != null) { + return f.format(cal.getTime()); } return null; } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -398,7 +393,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field179(f)); } @@ -413,13 +408,11 @@ public static List getAll(final SwiftTagListBlock block) { * @since 7.10.3 * @see Field#fromJson(String) */ + @SuppressWarnings("unused") public static Field179 fromJson(final String json) { - final Field179 field = new Field179(); - - - return field; + return new Field179(); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field17A.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field17A.java index ac9af9354..140bd9f07 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field17A.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field17A.java @@ -29,12 +29,9 @@ -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -183,19 +180,16 @@ public String getValue() { */ @Override public String getValueDisplay(int component, Locale locale) { - if (component < 1 || component > 1) { + if (component != 1) { throw new IllegalArgumentException("invalid component number " + component + " for field 17A"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -398,7 +392,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field17A(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field17B.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field17B.java index c64148c81..78b36ae34 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field17B.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field17B.java @@ -30,12 +30,9 @@ import com.prowidesoftware.swift.model.field.GenericField; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -201,16 +198,14 @@ public String getValueDisplay(int component, Locale locale) { //default format (as is) return getComponent(1); } - if (component == 2) { - //default format (as is) - return getComponent(2); - } - return null; + // This is the last component, return directly without `if` + //default format (as is) + return getComponent(2); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -396,6 +391,7 @@ public Field17B setFlag(String component2) { * * @return DSS component value or null if the DSS is not set or not available for this field. */ + @Override public String getDSS() { return null; } @@ -406,6 +402,7 @@ public String getDSS() { * @see #getDSS() * @return true if DSS is present, false otherwise. */ + @Override public boolean isDSSPresent() { return false; } @@ -420,6 +417,7 @@ public boolean isDSSPresent() { * * @return for generic fields returns the value of the conditional qualifier or null if not set or not applicable for this field. */ + @Override public String getConditionalQualifier() { return getComponent(CONDITIONAL_QUALIFIER); } @@ -487,7 +485,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field17B(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field17C.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field17C.java index 362ae7074..92a3066e2 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field17C.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field17C.java @@ -29,12 +29,9 @@ -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -183,19 +180,16 @@ public String getValue() { */ @Override public String getValueDisplay(int component, Locale locale) { - if (component < 1 || component > 1) { + if (component != 1) { throw new IllegalArgumentException("invalid component number " + component + " for field 17C"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -398,7 +392,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field17C(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field17E.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field17E.java index a30c5c050..9c7124cc6 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field17E.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field17E.java @@ -29,12 +29,9 @@ -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -183,19 +180,16 @@ public String getValue() { */ @Override public String getValueDisplay(int component, Locale locale) { - if (component < 1 || component > 1) { + if (component != 1) { throw new IllegalArgumentException("invalid component number " + component + " for field 17E"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -398,7 +392,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field17E(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field17F.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field17F.java index 66c7929df..490ce7600 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field17F.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field17F.java @@ -29,12 +29,9 @@ -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -183,19 +180,16 @@ public String getValue() { */ @Override public String getValueDisplay(int component, Locale locale) { - if (component < 1 || component > 1) { + if (component != 1) { throw new IllegalArgumentException("invalid component number " + component + " for field 17F"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -398,7 +392,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field17F(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field17G.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field17G.java index 38b074d72..9748c1bd5 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field17G.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field17G.java @@ -29,12 +29,9 @@ -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -183,19 +180,16 @@ public String getValue() { */ @Override public String getValueDisplay(int component, Locale locale) { - if (component < 1 || component > 1) { + if (component != 1) { throw new IllegalArgumentException("invalid component number " + component + " for field 17G"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -398,7 +392,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field17G(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field17H.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field17H.java index 8083fee30..ea4b32fd9 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field17H.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field17H.java @@ -29,12 +29,9 @@ -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -183,19 +180,16 @@ public String getValue() { */ @Override public String getValueDisplay(int component, Locale locale) { - if (component < 1 || component > 1) { + if (component != 1) { throw new IllegalArgumentException("invalid component number " + component + " for field 17H"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -398,7 +392,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field17H(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field17I.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field17I.java index 1c66f0131..1c13f45ec 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field17I.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field17I.java @@ -29,12 +29,9 @@ -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -183,19 +180,16 @@ public String getValue() { */ @Override public String getValueDisplay(int component, Locale locale) { - if (component < 1 || component > 1) { + if (component != 1) { throw new IllegalArgumentException("invalid component number " + component + " for field 17I"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -398,7 +392,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field17I(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field17L.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field17L.java index 3bbd3049c..0629ede84 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field17L.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field17L.java @@ -29,12 +29,9 @@ -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -183,19 +180,16 @@ public String getValue() { */ @Override public String getValueDisplay(int component, Locale locale) { - if (component < 1 || component > 1) { + if (component != 1) { throw new IllegalArgumentException("invalid component number " + component + " for field 17L"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -398,7 +392,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field17L(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field17M.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field17M.java index 0178ff4a3..986bb5f74 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field17M.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field17M.java @@ -29,12 +29,9 @@ -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -183,19 +180,16 @@ public String getValue() { */ @Override public String getValueDisplay(int component, Locale locale) { - if (component < 1 || component > 1) { + if (component != 1) { throw new IllegalArgumentException("invalid component number " + component + " for field 17M"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -398,7 +392,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field17M(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field17N.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field17N.java index e811990e6..5099fa5be 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field17N.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field17N.java @@ -29,12 +29,9 @@ -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -183,19 +180,16 @@ public String getValue() { */ @Override public String getValueDisplay(int component, Locale locale) { - if (component < 1 || component > 1) { + if (component != 1) { throw new IllegalArgumentException("invalid component number " + component + " for field 17N"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -398,7 +392,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field17N(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field17O.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field17O.java index cc088b70c..8772f78a9 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field17O.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field17O.java @@ -29,12 +29,9 @@ -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -183,19 +180,16 @@ public String getValue() { */ @Override public String getValueDisplay(int component, Locale locale) { - if (component < 1 || component > 1) { + if (component != 1) { throw new IllegalArgumentException("invalid component number " + component + " for field 17O"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -398,7 +392,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field17O(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field17P.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field17P.java index b1381ae8e..39c864c5c 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field17P.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field17P.java @@ -29,12 +29,9 @@ -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -183,19 +180,16 @@ public String getValue() { */ @Override public String getValueDisplay(int component, Locale locale) { - if (component < 1 || component > 1) { + if (component != 1) { throw new IllegalArgumentException("invalid component number " + component + " for field 17P"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -398,7 +392,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field17P(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field17Q.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field17Q.java index 38122f884..e6ba54c18 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field17Q.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field17Q.java @@ -29,12 +29,9 @@ -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -183,19 +180,16 @@ public String getValue() { */ @Override public String getValueDisplay(int component, Locale locale) { - if (component < 1 || component > 1) { + if (component != 1) { throw new IllegalArgumentException("invalid component number " + component + " for field 17Q"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -398,7 +392,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field17Q(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field17R.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field17R.java index e21a38180..31ec32303 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field17R.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field17R.java @@ -29,12 +29,9 @@ -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -183,19 +180,16 @@ public String getValue() { */ @Override public String getValueDisplay(int component, Locale locale) { - if (component < 1 || component > 1) { + if (component != 1) { throw new IllegalArgumentException("invalid component number " + component + " for field 17R"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -398,7 +392,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field17R(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field17S.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field17S.java index cb7c877be..dc1debbf0 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field17S.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field17S.java @@ -29,12 +29,9 @@ -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -183,19 +180,16 @@ public String getValue() { */ @Override public String getValueDisplay(int component, Locale locale) { - if (component < 1 || component > 1) { + if (component != 1) { throw new IllegalArgumentException("invalid component number " + component + " for field 17S"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -398,7 +392,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field17S(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field17T.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field17T.java index 10b79012b..3761d33c8 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field17T.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field17T.java @@ -29,12 +29,9 @@ -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -183,19 +180,16 @@ public String getValue() { */ @Override public String getValueDisplay(int component, Locale locale) { - if (component < 1 || component > 1) { + if (component != 1) { throw new IllegalArgumentException("invalid component number " + component + " for field 17T"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -398,7 +392,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field17T(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field17U.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field17U.java index fc9dc7b2a..2c5f28a26 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field17U.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field17U.java @@ -29,12 +29,9 @@ -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -183,19 +180,16 @@ public String getValue() { */ @Override public String getValueDisplay(int component, Locale locale) { - if (component < 1 || component > 1) { + if (component != 1) { throw new IllegalArgumentException("invalid component number " + component + " for field 17U"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -398,7 +392,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field17U(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field17V.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field17V.java index bf9e4d25a..3417a30ad 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field17V.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field17V.java @@ -29,12 +29,9 @@ -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -183,19 +180,16 @@ public String getValue() { */ @Override public String getValueDisplay(int component, Locale locale) { - if (component < 1 || component > 1) { + if (component != 1) { throw new IllegalArgumentException("invalid component number " + component + " for field 17V"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -398,7 +392,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field17V(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field17W.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field17W.java index bed8258bb..077002978 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field17W.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field17W.java @@ -29,12 +29,9 @@ -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -183,19 +180,16 @@ public String getValue() { */ @Override public String getValueDisplay(int component, Locale locale) { - if (component < 1 || component > 1) { + if (component != 1) { throw new IllegalArgumentException("invalid component number " + component + " for field 17W"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -398,7 +392,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field17W(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field17X.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field17X.java index 63c41b511..0237e1792 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field17X.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field17X.java @@ -29,12 +29,9 @@ -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -183,19 +180,16 @@ public String getValue() { */ @Override public String getValueDisplay(int component, Locale locale) { - if (component < 1 || component > 1) { + if (component != 1) { throw new IllegalArgumentException("invalid component number " + component + " for field 17X"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -398,7 +392,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field17X(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field17Y.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field17Y.java index 7e50c7529..180c93e0f 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field17Y.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field17Y.java @@ -29,12 +29,9 @@ -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -183,19 +180,16 @@ public String getValue() { */ @Override public String getValueDisplay(int component, Locale locale) { - if (component < 1 || component > 1) { + if (component != 1) { throw new IllegalArgumentException("invalid component number " + component + " for field 17Y"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -398,7 +392,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field17Y(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field17Z.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field17Z.java index f84d16d65..4610d37b2 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field17Z.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field17Z.java @@ -29,12 +29,9 @@ -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -183,19 +180,16 @@ public String getValue() { */ @Override public String getValueDisplay(int component, Locale locale) { - if (component < 1 || component > 1) { + if (component != 1) { throw new IllegalArgumentException("invalid component number " + component + " for field 17Z"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -398,7 +392,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field17Z(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field18A.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field18A.java index 9e367f313..9547639f2 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field18A.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field18A.java @@ -31,12 +31,9 @@ import java.math.BigInteger; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -185,19 +182,16 @@ public String getValue() { */ @Override public String getValueDisplay(int component, Locale locale) { - if (component < 1 || component > 1) { + if (component != 1) { throw new IllegalArgumentException("invalid component number " + component + " for field 18A"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -344,32 +338,14 @@ public Field18A setComponent1(String component1) { return this; } - /** - * Set the component1 from a Long object. - *
- * If the component being set is a fixed length number, the argument will not be - * padded. It is recommended for these cases to use the setComponent1(String) - * method. - * - * @see #setComponent1(String) - * @since 9.2.7 - * - * @param component1 the Long with the Number content to set - * @return the field object to enable build pattern - */ - public Field18A setComponent1(java.lang.Long component1) { - setComponent(1, SwiftFormatUtils.getLong(component1)); - return this; - } /** * Alternative method setter for field's Number (component 1) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10 becomes an Integer) * * @param component1 the Number with the Number content to set * @return the field object to enable build pattern - * @see #setNumber(java.lang.Long) */ public Field18A setComponent1(java.lang.Number component1) { @@ -399,27 +375,13 @@ public Field18A setNumber(String component1) { return setComponent1(component1); } - /** - * Set the Number (component 1) from a Long object. - * - * @see #setComponent1(java.lang.Long) - * - * @param component1 Long with the Number content to set - * @return the field object to enable build pattern - * @since 9.2.7 - */ - public Field18A setNumber(java.lang.Long component1) { - return setComponent1(component1); - } - /** * Alternative method setter for field's Number (component 1) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10 becomes an Integer) * * @param component1 the Number with the Number content to set * @return the field object to enable build pattern - * @see #setNumber(java.lang.Long) */ public Field18A setNumber(java.lang.Number component1) { return setComponent1(component1); @@ -490,7 +452,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field18A(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field18B.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field18B.java index ee7f55f8c..3f6451bee 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field18B.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field18B.java @@ -31,12 +31,9 @@ import java.math.BigInteger; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -185,19 +182,16 @@ public String getValue() { */ @Override public String getValueDisplay(int component, Locale locale) { - if (component < 1 || component > 1) { + if (component != 1) { throw new IllegalArgumentException("invalid component number " + component + " for field 18B"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -344,32 +338,14 @@ public Field18B setComponent1(String component1) { return this; } - /** - * Set the component1 from a Long object. - *
- * If the component being set is a fixed length number, the argument will not be - * padded. It is recommended for these cases to use the setComponent1(String) - * method. - * - * @see #setComponent1(String) - * @since 9.2.7 - * - * @param component1 the Long with the Number content to set - * @return the field object to enable build pattern - */ - public Field18B setComponent1(java.lang.Long component1) { - setComponent(1, SwiftFormatUtils.getLong(component1)); - return this; - } /** * Alternative method setter for field's Number (component 1) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10 becomes an Integer) * * @param component1 the Number with the Number content to set * @return the field object to enable build pattern - * @see #setNumber(java.lang.Long) */ public Field18B setComponent1(java.lang.Number component1) { @@ -399,27 +375,13 @@ public Field18B setNumber(String component1) { return setComponent1(component1); } - /** - * Set the Number (component 1) from a Long object. - * - * @see #setComponent1(java.lang.Long) - * - * @param component1 Long with the Number content to set - * @return the field object to enable build pattern - * @since 9.2.7 - */ - public Field18B setNumber(java.lang.Long component1) { - return setComponent1(component1); - } - /** * Alternative method setter for field's Number (component 1) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10 becomes an Integer) * * @param component1 the Number with the Number content to set * @return the field object to enable build pattern - * @see #setNumber(java.lang.Long) */ public Field18B setNumber(java.lang.Number component1) { return setComponent1(component1); @@ -490,7 +452,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field18B(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field18C.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field18C.java index 45cd81bdf..8708de596 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field18C.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field18C.java @@ -31,12 +31,9 @@ import java.math.BigInteger; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -185,19 +182,16 @@ public String getValue() { */ @Override public String getValueDisplay(int component, Locale locale) { - if (component < 1 || component > 1) { + if (component != 1) { throw new IllegalArgumentException("invalid component number " + component + " for field 18C"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -344,32 +338,14 @@ public Field18C setComponent1(String component1) { return this; } - /** - * Set the component1 from a Long object. - *
- * If the component being set is a fixed length number, the argument will not be - * padded. It is recommended for these cases to use the setComponent1(String) - * method. - * - * @see #setComponent1(String) - * @since 9.2.7 - * - * @param component1 the Long with the Number content to set - * @return the field object to enable build pattern - */ - public Field18C setComponent1(java.lang.Long component1) { - setComponent(1, SwiftFormatUtils.getLong(component1)); - return this; - } /** * Alternative method setter for field's Number (component 1) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10 becomes an Integer) * * @param component1 the Number with the Number content to set * @return the field object to enable build pattern - * @see #setNumber(java.lang.Long) */ public Field18C setComponent1(java.lang.Number component1) { @@ -399,27 +375,13 @@ public Field18C setNumber(String component1) { return setComponent1(component1); } - /** - * Set the Number (component 1) from a Long object. - * - * @see #setComponent1(java.lang.Long) - * - * @param component1 Long with the Number content to set - * @return the field object to enable build pattern - * @since 9.2.7 - */ - public Field18C setNumber(java.lang.Long component1) { - return setComponent1(component1); - } - /** * Alternative method setter for field's Number (component 1) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10 becomes an Integer) * * @param component1 the Number with the Number content to set * @return the field object to enable build pattern - * @see #setNumber(java.lang.Long) */ public Field18C setNumber(java.lang.Number component1) { return setComponent1(component1); @@ -490,7 +452,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field18C(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field18D.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field18D.java index aec83428c..a1e9a37a4 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field18D.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field18D.java @@ -31,12 +31,9 @@ import java.math.BigInteger; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -185,19 +182,16 @@ public String getValue() { */ @Override public String getValueDisplay(int component, Locale locale) { - if (component < 1 || component > 1) { + if (component != 1) { throw new IllegalArgumentException("invalid component number " + component + " for field 18D"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -344,32 +338,14 @@ public Field18D setComponent1(String component1) { return this; } - /** - * Set the component1 from a Long object. - *
- * If the component being set is a fixed length number, the argument will not be - * padded. It is recommended for these cases to use the setComponent1(String) - * method. - * - * @see #setComponent1(String) - * @since 9.2.7 - * - * @param component1 the Long with the Number content to set - * @return the field object to enable build pattern - */ - public Field18D setComponent1(java.lang.Long component1) { - setComponent(1, SwiftFormatUtils.getLong(component1)); - return this; - } /** * Alternative method setter for field's Number (component 1) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10 becomes an Integer) * * @param component1 the Number with the Number content to set * @return the field object to enable build pattern - * @see #setNumber(java.lang.Long) */ public Field18D setComponent1(java.lang.Number component1) { @@ -399,27 +375,13 @@ public Field18D setNumber(String component1) { return setComponent1(component1); } - /** - * Set the Number (component 1) from a Long object. - * - * @see #setComponent1(java.lang.Long) - * - * @param component1 Long with the Number content to set - * @return the field object to enable build pattern - * @since 9.2.7 - */ - public Field18D setNumber(java.lang.Long component1) { - return setComponent1(component1); - } - /** * Alternative method setter for field's Number (component 1) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10 becomes an Integer) * * @param component1 the Number with the Number content to set * @return the field object to enable build pattern - * @see #setNumber(java.lang.Long) */ public Field18D setNumber(java.lang.Number component1) { return setComponent1(component1); @@ -490,7 +452,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field18D(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field19.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field19.java index 25f98e776..875711d56 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field19.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field19.java @@ -33,12 +33,9 @@ import com.prowidesoftware.swift.model.field.AmountContainer; import com.prowidesoftware.swift.model.field.AmountResolver; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -187,24 +184,22 @@ public String getValue() { */ @Override public String getValueDisplay(int component, Locale locale) { - if (component < 1 || component > 1) { + if (component != 1) { throw new IllegalArgumentException("invalid component number " + component + " for field 19"); } - if (component == 1) { - //amount, rate - java.text.NumberFormat f = java.text.NumberFormat.getNumberInstance(notNull(locale)); - f.setMaximumFractionDigits(13); - BigDecimal n = getComponent1AsBigDecimal(); - if (n != null) { - return f.format(n); - } + //amount, rate + java.text.NumberFormat f = java.text.NumberFormat.getNumberInstance(notNull(locale)); + f.setMaximumFractionDigits(13); + BigDecimal n = getComponent1AsBigDecimal(); + if (n != null) { + return f.format(n); } return null; } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -351,32 +346,13 @@ public Field19 setComponent1(String component1) { return this; } - /** - * Set the component1 from a BigDecimal object. - *
- * Parses the BigDecimal into a SWIFT amount with truncated zero decimals and mandatory decimal separator. - *

- * @since 9.2.7 - * - * @param component1 the BigDecimal with the Amount content to set - * @return the field object to enable build pattern - */ - public Field19 setComponent1(java.math.BigDecimal component1) { - setComponent(1, SwiftFormatUtils.getBigDecimal(component1)); - return this; - } /** * Alternative method setter for field's Amount (component 1) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10.0 becomes an Float) * * @param component1 the Number with the Amount content to set * @return the field object to enable build pattern - * @see #setAmount(java.math.BigDecimal) */ public Field19 setComponent1(java.lang.Number component1) { @@ -408,27 +384,13 @@ public Field19 setAmount(String component1) { return setComponent1(component1); } - /** - * Set the Amount (component 1) from a BigDecimal object. - * - * @see #setComponent1(java.math.BigDecimal) - * - * @param component1 BigDecimal with the Amount content to set - * @return the field object to enable build pattern - * @since 9.2.7 - */ - public Field19 setAmount(java.math.BigDecimal component1) { - return setComponent1(component1); - } - /** * Alternative method setter for field's Amount (component 1) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10 becomes an Integer) * * @param component1 the Number with the Amount content to set * @return the field object to enable build pattern - * @see #setAmount(java.math.BigDecimal) */ public Field19 setAmount(java.lang.Number component1) { return setComponent1(component1); @@ -451,6 +413,7 @@ public List amounts() { * @return the first amount as BigDecimal value. Can be null * @see AmountResolver#amount(Field) */ + @Override public BigDecimal amount() { return AmountResolver.amount(this); } @@ -519,7 +482,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field19(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field199.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field199.java index 5dad19d05..b7712de5a 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field199.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field199.java @@ -29,12 +29,9 @@ -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -178,19 +175,16 @@ public String getValue() { */ @Override public String getValueDisplay(int component, Locale locale) { - if (component < 1 || component > 1) { + if (component != 1) { throw new IllegalArgumentException("invalid component number " + component + " for field 199"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -373,7 +367,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field199(f)); } @@ -388,13 +382,11 @@ public static List getAll(final SwiftTagListBlock block) { * @since 7.10.3 * @see Field#fromJson(String) */ + @SuppressWarnings("unused") public static Field199 fromJson(final String json) { - final Field199 field = new Field199(); - - - return field; + return new Field199(); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field19A.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field19A.java index 3a9971376..7e7084a61 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field19A.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field19A.java @@ -35,12 +35,9 @@ import com.prowidesoftware.swift.model.field.MonetaryAmountContainer; import com.prowidesoftware.swift.model.field.MonetaryAmountResolver; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -240,21 +237,20 @@ public String getValueDisplay(int component, Locale locale) { //default format (as is) return getComponent(3); } - if (component == 4) { - //amount, rate - java.text.NumberFormat f = java.text.NumberFormat.getNumberInstance(notNull(locale)); - f.setMaximumFractionDigits(13); - BigDecimal n = getComponent4AsBigDecimal(); - if (n != null) { - return f.format(n); - } + // This is the last component, return directly without `if` + //amount, rate + java.text.NumberFormat f = java.text.NumberFormat.getNumberInstance(notNull(locale)); + f.setMaximumFractionDigits(13); + BigDecimal n = getComponent4AsBigDecimal(); + if (n != null) { + return f.format(n); } return null; } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -567,32 +563,13 @@ public Field19A setComponent4(String component4) { return this; } - /** - * Set the component4 from a BigDecimal object. - *
- * Parses the BigDecimal into a SWIFT amount with truncated zero decimals and mandatory decimal separator. - *

- * @since 9.2.7 - * - * @param component4 the BigDecimal with the Amount content to set - * @return the field object to enable build pattern - */ - public Field19A setComponent4(java.math.BigDecimal component4) { - setComponent(4, SwiftFormatUtils.getBigDecimal(component4)); - return this; - } /** * Alternative method setter for field's Amount (component 4) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10.0 becomes an Float) * * @param component4 the Number with the Amount content to set * @return the field object to enable build pattern - * @see #setAmount(java.math.BigDecimal) */ public Field19A setComponent4(java.lang.Number component4) { @@ -624,53 +601,45 @@ public Field19A setAmount(String component4) { return setComponent4(component4); } - /** - * Set the Amount (component 4) from a BigDecimal object. - * - * @see #setComponent4(java.math.BigDecimal) - * - * @param component4 BigDecimal with the Amount content to set - * @return the field object to enable build pattern - * @since 9.2.7 - */ - public Field19A setAmount(java.math.BigDecimal component4) { - return setComponent4(component4); - } - /** * Alternative method setter for field's Amount (component 4) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10 becomes an Integer) * * @param component4 the Number with the Amount content to set * @return the field object to enable build pattern - * @see #setAmount(java.math.BigDecimal) */ public Field19A setAmount(java.lang.Number component4) { return setComponent4(component4); } + @Override public List currencyStrings() { return MonetaryAmountResolver.currencyStrings(this); } + @Override public List currencies() { return MonetaryAmountResolver.currencies(this); } + @Override public Currency currency() { return MonetaryAmountResolver.resolveCurrency(this); } + @Override public String currencyString() { return MonetaryAmountResolver.resolveCurrencyString(this); } + @Override public void initializeCurrencies(String cur) { MonetaryAmountResolver.resolveSetCurrency(this, cur); } + @Override public void initializeCurrencies(Currency cur) { MonetaryAmountResolver.resolveSetCurrency(this, cur); } @@ -691,6 +660,7 @@ public List amounts() { * @return the first amount as BigDecimal value. Can be null * @see MonetaryAmountResolver#amount(Field) */ + @Override public BigDecimal amount() { return MonetaryAmountResolver.amount(this); } @@ -702,6 +672,7 @@ public BigDecimal amount() { * * @return DSS component value or null if the DSS is not set or not available for this field. */ + @Override public String getDSS() { return null; } @@ -712,6 +683,7 @@ public String getDSS() { * @see #getDSS() * @return true if DSS is present, false otherwise. */ + @Override public boolean isDSSPresent() { return false; } @@ -726,6 +698,7 @@ public boolean isDSSPresent() { * * @return for generic fields returns the value of the conditional qualifier or null if not set or not applicable for this field. */ + @Override public String getConditionalQualifier() { return getComponent(CONDITIONAL_QUALIFIER); } @@ -793,7 +766,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field19A(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field19B.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field19B.java index 9c6966b7a..13ee5e921 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field19B.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field19B.java @@ -35,12 +35,9 @@ import com.prowidesoftware.swift.model.field.MonetaryAmountContainer; import com.prowidesoftware.swift.model.field.MonetaryAmountResolver; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -220,21 +217,20 @@ public String getValueDisplay(int component, Locale locale) { //default format (as is) return getComponent(2); } - if (component == 3) { - //amount, rate - java.text.NumberFormat f = java.text.NumberFormat.getNumberInstance(notNull(locale)); - f.setMaximumFractionDigits(13); - BigDecimal n = getComponent3AsBigDecimal(); - if (n != null) { - return f.format(n); - } + // This is the last component, return directly without `if` + //amount, rate + java.text.NumberFormat f = java.text.NumberFormat.getNumberInstance(notNull(locale)); + f.setMaximumFractionDigits(13); + BigDecimal n = getComponent3AsBigDecimal(); + if (n != null) { + return f.format(n); } return null; } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -504,32 +500,13 @@ public Field19B setComponent3(String component3) { return this; } - /** - * Set the component3 from a BigDecimal object. - *
- * Parses the BigDecimal into a SWIFT amount with truncated zero decimals and mandatory decimal separator. - *

- * @since 9.2.7 - * - * @param component3 the BigDecimal with the Amount content to set - * @return the field object to enable build pattern - */ - public Field19B setComponent3(java.math.BigDecimal component3) { - setComponent(3, SwiftFormatUtils.getBigDecimal(component3)); - return this; - } /** * Alternative method setter for field's Amount (component 3) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10.0 becomes an Float) * * @param component3 the Number with the Amount content to set * @return the field object to enable build pattern - * @see #setAmount(java.math.BigDecimal) */ public Field19B setComponent3(java.lang.Number component3) { @@ -561,53 +538,45 @@ public Field19B setAmount(String component3) { return setComponent3(component3); } - /** - * Set the Amount (component 3) from a BigDecimal object. - * - * @see #setComponent3(java.math.BigDecimal) - * - * @param component3 BigDecimal with the Amount content to set - * @return the field object to enable build pattern - * @since 9.2.7 - */ - public Field19B setAmount(java.math.BigDecimal component3) { - return setComponent3(component3); - } - /** * Alternative method setter for field's Amount (component 3) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10 becomes an Integer) * * @param component3 the Number with the Amount content to set * @return the field object to enable build pattern - * @see #setAmount(java.math.BigDecimal) */ public Field19B setAmount(java.lang.Number component3) { return setComponent3(component3); } + @Override public List currencyStrings() { return MonetaryAmountResolver.currencyStrings(this); } + @Override public List currencies() { return MonetaryAmountResolver.currencies(this); } + @Override public Currency currency() { return MonetaryAmountResolver.resolveCurrency(this); } + @Override public String currencyString() { return MonetaryAmountResolver.resolveCurrencyString(this); } + @Override public void initializeCurrencies(String cur) { MonetaryAmountResolver.resolveSetCurrency(this, cur); } + @Override public void initializeCurrencies(Currency cur) { MonetaryAmountResolver.resolveSetCurrency(this, cur); } @@ -628,6 +597,7 @@ public List amounts() { * @return the first amount as BigDecimal value. Can be null * @see MonetaryAmountResolver#amount(Field) */ + @Override public BigDecimal amount() { return MonetaryAmountResolver.amount(this); } @@ -639,6 +609,7 @@ public BigDecimal amount() { * * @return DSS component value or null if the DSS is not set or not available for this field. */ + @Override public String getDSS() { return null; } @@ -649,6 +620,7 @@ public String getDSS() { * @see #getDSS() * @return true if DSS is present, false otherwise. */ + @Override public boolean isDSSPresent() { return false; } @@ -663,6 +635,7 @@ public boolean isDSSPresent() { * * @return for generic fields returns the value of the conditional qualifier or null if not set or not applicable for this field. */ + @Override public String getConditionalQualifier() { return getComponent(CONDITIONAL_QUALIFIER); } @@ -730,7 +703,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field19B(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field20.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field20.java index 7beb7433c..b6fbc9dcf 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field20.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field20.java @@ -29,12 +29,9 @@ -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -183,19 +180,16 @@ public String getValue() { */ @Override public String getValueDisplay(int component, Locale locale) { - if (component < 1 || component > 1) { + if (component != 1) { throw new IllegalArgumentException("invalid component number " + component + " for field 20"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -398,7 +392,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field20(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field202.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field202.java index 81e63cb0c..88123d5e2 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field202.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field202.java @@ -31,12 +31,9 @@ import java.math.BigInteger; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -185,19 +182,16 @@ public String getValue() { */ @Override public String getValueDisplay(int component, Locale locale) { - if (component < 1 || component > 1) { + if (component != 1) { throw new IllegalArgumentException("invalid component number " + component + " for field 202"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -344,32 +338,14 @@ public Field202 setComponent1(String component1) { return this; } - /** - * Set the component1 from a Long object. - *
- * If the component being set is a fixed length number, the argument will not be - * padded. It is recommended for these cases to use the setComponent1(String) - * method. - * - * @see #setComponent1(String) - * @since 9.2.7 - * - * @param component1 the Long with the Section Number content to set - * @return the field object to enable build pattern - */ - public Field202 setComponent1(java.lang.Long component1) { - setComponent(1, SwiftFormatUtils.getLong(component1)); - return this; - } /** * Alternative method setter for field's Section Number (component 1) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10 becomes an Integer) * * @param component1 the Number with the Section Number content to set * @return the field object to enable build pattern - * @see #setSectionNumber(java.lang.Long) */ public Field202 setComponent1(java.lang.Number component1) { @@ -399,27 +375,13 @@ public Field202 setSectionNumber(String component1) { return setComponent1(component1); } - /** - * Set the Section Number (component 1) from a Long object. - * - * @see #setComponent1(java.lang.Long) - * - * @param component1 Long with the Section Number content to set - * @return the field object to enable build pattern - * @since 9.2.7 - */ - public Field202 setSectionNumber(java.lang.Long component1) { - return setComponent1(component1); - } - /** * Alternative method setter for field's Section Number (component 1) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10 becomes an Integer) * * @param component1 the Number with the Section Number content to set * @return the field object to enable build pattern - * @see #setSectionNumber(java.lang.Long) */ public Field202 setSectionNumber(java.lang.Number component1) { return setComponent1(component1); @@ -490,7 +452,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field202(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field203.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field203.java index fa45302b3..d1c75e82e 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field203.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field203.java @@ -31,12 +31,9 @@ import java.math.BigInteger; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -185,19 +182,16 @@ public String getValue() { */ @Override public String getValueDisplay(int component, Locale locale) { - if (component < 1 || component > 1) { + if (component != 1) { throw new IllegalArgumentException("invalid component number " + component + " for field 203"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -344,32 +338,14 @@ public Field203 setComponent1(String component1) { return this; } - /** - * Set the component1 from a Long object. - *
- * If the component being set is a fixed length number, the argument will not be - * padded. It is recommended for these cases to use the setComponent1(String) - * method. - * - * @see #setComponent1(String) - * @since 9.2.7 - * - * @param component1 the Long with the Total Sections content to set - * @return the field object to enable build pattern - */ - public Field203 setComponent1(java.lang.Long component1) { - setComponent(1, SwiftFormatUtils.getLong(component1)); - return this; - } /** * Alternative method setter for field's Total Sections (component 1) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10 becomes an Integer) * * @param component1 the Number with the Total Sections content to set * @return the field object to enable build pattern - * @see #setTotalSections(java.lang.Long) */ public Field203 setComponent1(java.lang.Number component1) { @@ -399,27 +375,13 @@ public Field203 setTotalSections(String component1) { return setComponent1(component1); } - /** - * Set the Total Sections (component 1) from a Long object. - * - * @see #setComponent1(java.lang.Long) - * - * @param component1 Long with the Total Sections content to set - * @return the field object to enable build pattern - * @since 9.2.7 - */ - public Field203 setTotalSections(java.lang.Long component1) { - return setComponent1(component1); - } - /** * Alternative method setter for field's Total Sections (component 1) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10 becomes an Integer) * * @param component1 the Number with the Total Sections content to set * @return the field object to enable build pattern - * @see #setTotalSections(java.lang.Long) */ public Field203 setTotalSections(java.lang.Number component1) { return setComponent1(component1); @@ -490,7 +452,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field203(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field204.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field204.java index 5b67f1d3b..d15742a62 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field204.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field204.java @@ -29,12 +29,9 @@ -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -183,19 +180,16 @@ public String getValue() { */ @Override public String getValueDisplay(int component, Locale locale) { - if (component < 1 || component > 1) { + if (component != 1) { throw new IllegalArgumentException("invalid component number " + component + " for field 204"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -398,7 +392,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field204(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field206.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field206.java index 0e90a095c..79dda567c 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field206.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field206.java @@ -29,12 +29,9 @@ -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -183,19 +180,16 @@ public String getValue() { */ @Override public String getValueDisplay(int component, Locale locale) { - if (component < 1 || component > 1) { + if (component != 1) { throw new IllegalArgumentException("invalid component number " + component + " for field 206"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -438,7 +432,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field206(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field208.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field208.java index 9dac25f13..3c55959ec 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field208.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field208.java @@ -29,12 +29,9 @@ -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -183,19 +180,16 @@ public String getValue() { */ @Override public String getValueDisplay(int component, Locale locale) { - if (component < 1 || component > 1) { + if (component != 1) { throw new IllegalArgumentException("invalid component number " + component + " for field 208"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -438,7 +432,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field208(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field209.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field209.java index bfbfa9962..cd473a5c4 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field209.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field209.java @@ -31,12 +31,9 @@ import java.math.BigInteger; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -185,19 +182,16 @@ public String getValue() { */ @Override public String getValueDisplay(int component, Locale locale) { - if (component < 1 || component > 1) { + if (component != 1) { throw new IllegalArgumentException("invalid component number " + component + " for field 209"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -344,32 +338,14 @@ public Field209 setComponent1(String component1) { return this; } - /** - * Set the component1 from a Long object. - *
- * If the component being set is a fixed length number, the argument will not be - * padded. It is recommended for these cases to use the setComponent1(String) - * method. - * - * @see #setComponent1(String) - * @since 9.2.7 - * - * @param component1 the Long with the Type content to set - * @return the field object to enable build pattern - */ - public Field209 setComponent1(java.lang.Long component1) { - setComponent(1, SwiftFormatUtils.getLong(component1)); - return this; - } /** * Alternative method setter for field's Type (component 1) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10 becomes an Integer) * * @param component1 the Number with the Type content to set * @return the field object to enable build pattern - * @see #setType(java.lang.Long) */ public Field209 setComponent1(java.lang.Number component1) { @@ -399,27 +375,13 @@ public Field209 setType(String component1) { return setComponent1(component1); } - /** - * Set the Type (component 1) from a Long object. - * - * @see #setComponent1(java.lang.Long) - * - * @param component1 Long with the Type content to set - * @return the field object to enable build pattern - * @since 9.2.7 - */ - public Field209 setType(java.lang.Long component1) { - return setComponent1(component1); - } - /** * Alternative method setter for field's Type (component 1) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10 becomes an Integer) * * @param component1 the Number with the Type content to set * @return the field object to enable build pattern - * @see #setType(java.lang.Long) */ public Field209 setType(java.lang.Number component1) { return setComponent1(component1); @@ -490,7 +452,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field209(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field20C.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field20C.java index 193950ad3..6e36f6c32 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field20C.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field20C.java @@ -30,12 +30,9 @@ import com.prowidesoftware.swift.model.field.GenericField; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -201,16 +198,14 @@ public String getValueDisplay(int component, Locale locale) { //default format (as is) return getComponent(1); } - if (component == 2) { - //default format (as is) - return getComponent(2); - } - return null; + // This is the last component, return directly without `if` + //default format (as is) + return getComponent(2); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -396,6 +391,7 @@ public Field20C setReference(String component2) { * * @return DSS component value or null if the DSS is not set or not available for this field. */ + @Override public String getDSS() { return null; } @@ -406,6 +402,7 @@ public String getDSS() { * @see #getDSS() * @return true if DSS is present, false otherwise. */ + @Override public boolean isDSSPresent() { return false; } @@ -420,6 +417,7 @@ public boolean isDSSPresent() { * * @return for generic fields returns the value of the conditional qualifier or null if not set or not applicable for this field. */ + @Override public String getConditionalQualifier() { return getComponent(CONDITIONAL_QUALIFIER); } @@ -487,7 +485,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field20C(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field20D.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field20D.java index fc05ddd56..54dfbd8c6 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field20D.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field20D.java @@ -30,12 +30,9 @@ import com.prowidesoftware.swift.model.field.GenericField; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -201,16 +198,14 @@ public String getValueDisplay(int component, Locale locale) { //default format (as is) return getComponent(1); } - if (component == 2) { - //default format (as is) - return getComponent(2); - } - return null; + // This is the last component, return directly without `if` + //default format (as is) + return getComponent(2); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -396,6 +391,7 @@ public Field20D setReference(String component2) { * * @return DSS component value or null if the DSS is not set or not available for this field. */ + @Override public String getDSS() { return null; } @@ -406,6 +402,7 @@ public String getDSS() { * @see #getDSS() * @return true if DSS is present, false otherwise. */ + @Override public boolean isDSSPresent() { return false; } @@ -420,6 +417,7 @@ public boolean isDSSPresent() { * * @return for generic fields returns the value of the conditional qualifier or null if not set or not applicable for this field. */ + @Override public String getConditionalQualifier() { return getComponent(CONDITIONAL_QUALIFIER); } @@ -487,7 +485,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field20D(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field20U.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field20U.java index a8ee06d79..64c0fb301 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field20U.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field20U.java @@ -30,12 +30,9 @@ import com.prowidesoftware.swift.model.field.GenericField; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -201,16 +198,14 @@ public String getValueDisplay(int component, Locale locale) { //default format (as is) return getComponent(1); } - if (component == 2) { - //default format (as is) - return getComponent(2); - } - return null; + // This is the last component, return directly without `if` + //default format (as is) + return getComponent(2); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -396,6 +391,7 @@ public Field20U setReference(String component2) { * * @return DSS component value or null if the DSS is not set or not available for this field. */ + @Override public String getDSS() { return null; } @@ -406,6 +402,7 @@ public String getDSS() { * @see #getDSS() * @return true if DSS is present, false otherwise. */ + @Override public boolean isDSSPresent() { return false; } @@ -420,6 +417,7 @@ public boolean isDSSPresent() { * * @return for generic fields returns the value of the conditional qualifier or null if not set or not applicable for this field. */ + @Override public String getConditionalQualifier() { return getComponent(CONDITIONAL_QUALIFIER); } @@ -487,7 +485,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field20U(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field21.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field21.java index fd3257db3..87a6aa48d 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field21.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field21.java @@ -29,12 +29,9 @@ -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -183,19 +180,16 @@ public String getValue() { */ @Override public String getValueDisplay(int component, Locale locale) { - if (component < 1 || component > 1) { + if (component != 1) { throw new IllegalArgumentException("invalid component number " + component + " for field 21"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -398,7 +392,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field21(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field21A.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field21A.java index 0bb6e2fcb..00a6d27e6 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field21A.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field21A.java @@ -29,12 +29,9 @@ -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -183,19 +180,16 @@ public String getValue() { */ @Override public String getValueDisplay(int component, Locale locale) { - if (component < 1 || component > 1) { + if (component != 1) { throw new IllegalArgumentException("invalid component number " + component + " for field 21A"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -398,7 +392,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field21A(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field21B.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field21B.java index a99aacdc8..1daa327fb 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field21B.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field21B.java @@ -29,12 +29,9 @@ -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -195,19 +192,16 @@ public String getValue() { */ @Override public String getValueDisplay(int component, Locale locale) { - if (component < 1 || component > 1) { + if (component != 1) { throw new IllegalArgumentException("invalid component number " + component + " for field 21B"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -438,7 +432,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field21B(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field21C.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field21C.java index 290236d36..706df486a 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field21C.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field21C.java @@ -29,12 +29,9 @@ -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -183,19 +180,16 @@ public String getValue() { */ @Override public String getValueDisplay(int component, Locale locale) { - if (component < 1 || component > 1) { + if (component != 1) { throw new IllegalArgumentException("invalid component number " + component + " for field 21C"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -398,7 +392,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field21C(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field21D.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field21D.java index 1e006d67b..c462766c6 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field21D.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field21D.java @@ -29,12 +29,9 @@ -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -183,19 +180,16 @@ public String getValue() { */ @Override public String getValueDisplay(int component, Locale locale) { - if (component < 1 || component > 1) { + if (component != 1) { throw new IllegalArgumentException("invalid component number " + component + " for field 21D"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -398,7 +392,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field21D(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field21E.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field21E.java index 67869510e..727cb2ded 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field21E.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field21E.java @@ -29,12 +29,9 @@ -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -183,19 +180,16 @@ public String getValue() { */ @Override public String getValueDisplay(int component, Locale locale) { - if (component < 1 || component > 1) { + if (component != 1) { throw new IllegalArgumentException("invalid component number " + component + " for field 21E"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -398,7 +392,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field21E(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field21F.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field21F.java index 5656e92be..b720b2cb8 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field21F.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field21F.java @@ -29,12 +29,9 @@ -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -183,19 +180,16 @@ public String getValue() { */ @Override public String getValueDisplay(int component, Locale locale) { - if (component < 1 || component > 1) { + if (component != 1) { throw new IllegalArgumentException("invalid component number " + component + " for field 21F"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -398,7 +392,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field21F(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field21G.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field21G.java index 9faa795cb..5ca323902 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field21G.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field21G.java @@ -29,12 +29,9 @@ -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -183,19 +180,16 @@ public String getValue() { */ @Override public String getValueDisplay(int component, Locale locale) { - if (component < 1 || component > 1) { + if (component != 1) { throw new IllegalArgumentException("invalid component number " + component + " for field 21G"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -398,7 +392,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field21G(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field21H.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field21H.java index 197d698d3..a13759d66 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field21H.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field21H.java @@ -29,12 +29,9 @@ -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -200,16 +197,14 @@ public String getValueDisplay(int component, Locale locale) { //default format (as is) return getComponent(1); } - if (component == 2) { - //default format (as is) - return getComponent(2); - } - return null; + // This is the last component, return directly without `if` + //default format (as is) + return getComponent(2); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -455,7 +450,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field21H(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field21N.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field21N.java index 163c9a9c6..3364cfccf 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field21N.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field21N.java @@ -29,12 +29,9 @@ -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -195,19 +192,16 @@ public String getValue() { */ @Override public String getValueDisplay(int component, Locale locale) { - if (component < 1 || component > 1) { + if (component != 1) { throw new IllegalArgumentException("invalid component number " + component + " for field 21N"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -438,7 +432,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field21N(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field21P.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field21P.java index 4c5c4ce97..954c362ac 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field21P.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field21P.java @@ -29,12 +29,9 @@ -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -183,19 +180,16 @@ public String getValue() { */ @Override public String getValueDisplay(int component, Locale locale) { - if (component < 1 || component > 1) { + if (component != 1) { throw new IllegalArgumentException("invalid component number " + component + " for field 21P"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -398,7 +392,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field21P(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field21R.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field21R.java index 579ca42b5..2d66765fe 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field21R.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field21R.java @@ -29,12 +29,9 @@ -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -183,19 +180,16 @@ public String getValue() { */ @Override public String getValueDisplay(int component, Locale locale) { - if (component < 1 || component > 1) { + if (component != 1) { throw new IllegalArgumentException("invalid component number " + component + " for field 21R"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -398,7 +392,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field21R(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field22.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field22.java index a9b21cd82..1249d1055 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field22.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field22.java @@ -29,12 +29,9 @@ -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -199,16 +196,14 @@ public String getValueDisplay(int component, Locale locale) { //default format (as is) return getComponent(1); } - if (component == 2) { - //default format (as is) - return getComponent(2); - } - return null; + // This is the last component, return directly without `if` + //default format (as is) + return getComponent(2); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -451,7 +446,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field22(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field22A.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field22A.java index bfa529015..48ee2da78 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field22A.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field22A.java @@ -29,12 +29,9 @@ -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -195,19 +192,16 @@ public String getValue() { */ @Override public String getValueDisplay(int component, Locale locale) { - if (component < 1 || component > 1) { + if (component != 1) { throw new IllegalArgumentException("invalid component number " + component + " for field 22A"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -438,7 +432,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field22A(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field22B.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field22B.java index 88be30b12..d0ae42fc2 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field22B.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field22B.java @@ -29,12 +29,9 @@ -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -195,19 +192,16 @@ public String getValue() { */ @Override public String getValueDisplay(int component, Locale locale) { - if (component < 1 || component > 1) { + if (component != 1) { throw new IllegalArgumentException("invalid component number " + component + " for field 22B"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -438,7 +432,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field22B(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field22C.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field22C.java index de598563b..d0e179861 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field22C.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field22C.java @@ -31,12 +31,9 @@ import java.math.BigInteger; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -244,16 +241,14 @@ public String getValueDisplay(int component, Locale locale) { //default format (as is) return getComponent(4); } - if (component == 5) { - //default format (as is) - return getComponent(5); - } - return null; + // This is the last component, return directly without `if` + //default format (as is) + return getComponent(5); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -518,32 +513,14 @@ public Field22C setComponent3(String component3) { return this; } - /** - * Set the component3 from a Long object. - *
- * If the component being set is a fixed length number, the argument will not be - * padded. It is recommended for these cases to use the setComponent3(String) - * method. - * - * @see #setComponent3(String) - * @since 9.2.7 - * - * @param component3 the Long with the Reference Code content to set - * @return the field object to enable build pattern - */ - public Field22C setComponent3(java.lang.Long component3) { - setComponent(3, SwiftFormatUtils.getLong(component3)); - return this; - } /** * Alternative method setter for field's Reference Code (component 3) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10 becomes an Integer) * * @param component3 the Number with the Reference Code content to set * @return the field object to enable build pattern - * @see #setReferenceCode(java.lang.Long) */ public Field22C setComponent3(java.lang.Number component3) { @@ -573,27 +550,13 @@ public Field22C setReferenceCode(String component3) { return setComponent3(component3); } - /** - * Set the Reference Code (component 3) from a Long object. - * - * @see #setComponent3(java.lang.Long) - * - * @param component3 Long with the Reference Code content to set - * @return the field object to enable build pattern - * @since 9.2.7 - */ - public Field22C setReferenceCode(java.lang.Long component3) { - return setComponent3(component3); - } - /** * Alternative method setter for field's Reference Code (component 3) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10 becomes an Integer) * * @param component3 the Number with the Reference Code content to set * @return the field object to enable build pattern - * @see #setReferenceCode(java.lang.Long) */ public Field22C setReferenceCode(java.lang.Number component3) { return setComponent3(component3); @@ -706,7 +669,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field22C(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field22D.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field22D.java index bd8c681e3..15240d7d0 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field22D.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field22D.java @@ -29,12 +29,9 @@ -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -195,19 +192,16 @@ public String getValue() { */ @Override public String getValueDisplay(int component, Locale locale) { - if (component < 1 || component > 1) { + if (component != 1) { throw new IllegalArgumentException("invalid component number " + component + " for field 22D"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -438,7 +432,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field22D(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field22E.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field22E.java index 149e8a3df..f8772d4ee 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field22E.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field22E.java @@ -29,12 +29,9 @@ -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -189,19 +186,16 @@ public String getValue() { */ @Override public String getValueDisplay(int component, Locale locale) { - if (component < 1 || component > 1) { + if (component != 1) { throw new IllegalArgumentException("invalid component number " + component + " for field 22E"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -418,7 +412,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field22E(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field22F.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field22F.java index d7d4158bb..5798f59cd 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field22F.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field22F.java @@ -30,12 +30,9 @@ import com.prowidesoftware.swift.model.field.GenericField; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -214,16 +211,14 @@ public String getValueDisplay(int component, Locale locale) { //default format (as is) return getComponent(2); } - if (component == 3) { - //default format (as is) - return getComponent(3); - } - return null; + // This is the last component, return directly without `if` + //default format (as is) + return getComponent(3); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -452,6 +447,7 @@ public Field22F setIndicator(String component3) { * * @return DSS component value or null if the DSS is not set or not available for this field. */ + @Override public String getDSS() { return getComponent2(); } @@ -462,6 +458,7 @@ public String getDSS() { * @see #getDSS() * @return true if DSS is present, false otherwise. */ + @Override public boolean isDSSPresent() { return getComponent2() != null; } @@ -476,6 +473,7 @@ public boolean isDSSPresent() { * * @return for generic fields returns the value of the conditional qualifier or null if not set or not applicable for this field. */ + @Override public String getConditionalQualifier() { return getComponent(CONDITIONAL_QUALIFIER); } @@ -543,7 +541,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field22F(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field22G.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field22G.java index 42da1e9b6..f2e64d007 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field22G.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field22G.java @@ -29,12 +29,9 @@ -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -195,19 +192,16 @@ public String getValue() { */ @Override public String getValueDisplay(int component, Locale locale) { - if (component < 1 || component > 1) { + if (component != 1) { throw new IllegalArgumentException("invalid component number " + component + " for field 22G"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -438,7 +432,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field22G(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field22H.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field22H.java index 48be7dab9..f9c33d170 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field22H.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field22H.java @@ -30,12 +30,9 @@ import com.prowidesoftware.swift.model.field.GenericField; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -202,16 +199,14 @@ public String getValueDisplay(int component, Locale locale) { //default format (as is) return getComponent(1); } - if (component == 2) { - //default format (as is) - return getComponent(2); - } - return null; + // This is the last component, return directly without `if` + //default format (as is) + return getComponent(2); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -400,6 +395,7 @@ public Field22H setIndicator(String component2) { * * @return DSS component value or null if the DSS is not set or not available for this field. */ + @Override public String getDSS() { return null; } @@ -410,6 +406,7 @@ public String getDSS() { * @see #getDSS() * @return true if DSS is present, false otherwise. */ + @Override public boolean isDSSPresent() { return false; } @@ -424,6 +421,7 @@ public boolean isDSSPresent() { * * @return for generic fields returns the value of the conditional qualifier or null if not set or not applicable for this field. */ + @Override public String getConditionalQualifier() { return getComponent(CONDITIONAL_QUALIFIER); } @@ -491,7 +489,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field22H(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field22K.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field22K.java index 3d1999d2b..b5c434862 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field22K.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field22K.java @@ -29,12 +29,9 @@ -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -206,16 +203,14 @@ public String getValueDisplay(int component, Locale locale) { //default format (as is) return getComponent(1); } - if (component == 2) { - //default format (as is) - return getComponent(2); - } - return null; + // This is the last component, return directly without `if` + //default format (as is) + return getComponent(2); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -475,7 +470,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field22K(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field22L.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field22L.java index 8885979c7..57d74e945 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field22L.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field22L.java @@ -29,12 +29,9 @@ -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -184,19 +181,16 @@ public String getValue() { */ @Override public String getValueDisplay(int component, Locale locale) { - if (component < 1 || component > 1) { + if (component != 1) { throw new IllegalArgumentException("invalid component number " + component + " for field 22L"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -402,7 +396,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field22L(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field22M.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field22M.java index 3f68192e3..6619354fd 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field22M.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field22M.java @@ -29,12 +29,9 @@ -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -196,19 +193,16 @@ public String getValue() { */ @Override public String getValueDisplay(int component, Locale locale) { - if (component < 1 || component > 1) { + if (component != 1) { throw new IllegalArgumentException("invalid component number " + component + " for field 22M"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -442,7 +436,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field22M(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field22N.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field22N.java index cf0234bb0..573a56726 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field22N.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field22N.java @@ -29,12 +29,9 @@ -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -183,19 +180,16 @@ public String getValue() { */ @Override public String getValueDisplay(int component, Locale locale) { - if (component < 1 || component > 1) { + if (component != 1) { throw new IllegalArgumentException("invalid component number " + component + " for field 22N"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -398,7 +392,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field22N(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field22P.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field22P.java index 73865718a..01a3edcbb 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field22P.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field22P.java @@ -29,12 +29,9 @@ -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -196,19 +193,16 @@ public String getValue() { */ @Override public String getValueDisplay(int component, Locale locale) { - if (component < 1 || component > 1) { + if (component != 1) { throw new IllegalArgumentException("invalid component number " + component + " for field 22P"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -442,7 +436,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field22P(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field22Q.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field22Q.java index e0c0db95e..271fef9ef 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field22Q.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field22Q.java @@ -29,12 +29,9 @@ -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -184,19 +181,16 @@ public String getValue() { */ @Override public String getValueDisplay(int component, Locale locale) { - if (component < 1 || component > 1) { + if (component != 1) { throw new IllegalArgumentException("invalid component number " + component + " for field 22Q"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -402,7 +396,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field22Q(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field22R.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field22R.java index 9b4db15e0..b688c49fa 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field22R.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field22R.java @@ -29,12 +29,9 @@ -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -183,19 +180,16 @@ public String getValue() { */ @Override public String getValueDisplay(int component, Locale locale) { - if (component < 1 || component > 1) { + if (component != 1) { throw new IllegalArgumentException("invalid component number " + component + " for field 22R"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -398,7 +392,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field22R(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field22S.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field22S.java index 4c153ff68..04a8068e2 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field22S.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field22S.java @@ -29,12 +29,9 @@ -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -199,16 +196,14 @@ public String getValueDisplay(int component, Locale locale) { //default format (as is) return getComponent(1); } - if (component == 2) { - //default format (as is) - return getComponent(2); - } - return null; + // This is the last component, return directly without `if` + //default format (as is) + return getComponent(2); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -451,7 +446,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field22S(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field22T.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field22T.java index 1e8befe44..7e98131b0 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field22T.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field22T.java @@ -29,12 +29,9 @@ -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -183,19 +180,16 @@ public String getValue() { */ @Override public String getValueDisplay(int component, Locale locale) { - if (component < 1 || component > 1) { + if (component != 1) { throw new IllegalArgumentException("invalid component number " + component + " for field 22T"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -398,7 +392,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field22T(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field22U.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field22U.java index 34bbb4429..e47d5c13e 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field22U.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field22U.java @@ -29,12 +29,9 @@ -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -183,19 +180,16 @@ public String getValue() { */ @Override public String getValueDisplay(int component, Locale locale) { - if (component < 1 || component > 1) { + if (component != 1) { throw new IllegalArgumentException("invalid component number " + component + " for field 22U"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -398,7 +392,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field22U(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field22V.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field22V.java index 73dad8e48..da32eb0a2 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field22V.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field22V.java @@ -29,12 +29,9 @@ -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -183,19 +180,16 @@ public String getValue() { */ @Override public String getValueDisplay(int component, Locale locale) { - if (component < 1 || component > 1) { + if (component != 1) { throw new IllegalArgumentException("invalid component number " + component + " for field 22V"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -398,7 +392,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field22V(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field22W.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field22W.java index a3372c6cd..1727c41d6 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field22W.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field22W.java @@ -29,12 +29,9 @@ -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -183,19 +180,16 @@ public String getValue() { */ @Override public String getValueDisplay(int component, Locale locale) { - if (component < 1 || component > 1) { + if (component != 1) { throw new IllegalArgumentException("invalid component number " + component + " for field 22W"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -398,7 +392,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field22W(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field22X.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field22X.java index 9381e38c6..a5f7781ca 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field22X.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field22X.java @@ -29,12 +29,9 @@ -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -183,19 +180,16 @@ public String getValue() { */ @Override public String getValueDisplay(int component, Locale locale) { - if (component < 1 || component > 1) { + if (component != 1) { throw new IllegalArgumentException("invalid component number " + component + " for field 22X"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -398,7 +392,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field22X(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field22Y.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field22Y.java index d0c7d5284..95b1275e5 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field22Y.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field22Y.java @@ -29,12 +29,9 @@ -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -190,19 +187,16 @@ public String getValue() { */ @Override public String getValueDisplay(int component, Locale locale) { - if (component < 1 || component > 1) { + if (component != 1) { throw new IllegalArgumentException("invalid component number " + component + " for field 22Y"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -422,7 +416,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field22Y(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field22Z.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field22Z.java index 942e6e533..abfef55fd 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field22Z.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field22Z.java @@ -29,12 +29,9 @@ -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -183,19 +180,16 @@ public String getValue() { */ @Override public String getValueDisplay(int component, Locale locale) { - if (component < 1 || component > 1) { + if (component != 1) { throw new IllegalArgumentException("invalid component number " + component + " for field 22Z"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -398,7 +392,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field22Z(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field23.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field23.java index 9d2a4c809..9e7cb32a1 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field23.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field23.java @@ -32,12 +32,9 @@ import com.prowidesoftware.swift.model.field.CurrencyContainer; import com.prowidesoftware.swift.model.field.CurrencyResolver; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -265,16 +262,14 @@ public String getValueDisplay(int component, Locale locale) { //default format (as is) return getComponent(3); } - if (component == 4) { - //default format (as is) - return getComponent(4); - } - return null; + // This is the last component, return directly without `if` + //default format (as is) + return getComponent(4); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -649,26 +644,32 @@ public Field23 setManualAutomaticIndicator(java.util.Currency component4) { } + @Override public List currencyStrings() { return CurrencyResolver.currencyStrings(this); } + @Override public List currencies() { return CurrencyResolver.currencies(this); } + @Override public Currency currency() { return CurrencyResolver.resolveCurrency(this); } + @Override public String currencyString() { return CurrencyResolver.resolveCurrencyString(this); } + @Override public void initializeCurrencies(String cur) { CurrencyResolver.resolveSetCurrency(this, cur); } + @Override public void initializeCurrencies(Currency cur) { CurrencyResolver.resolveSetCurrency(this, cur); } @@ -737,7 +738,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field23(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field23A.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field23A.java index efac53491..e55d888cd 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field23A.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field23A.java @@ -29,12 +29,9 @@ -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -201,16 +198,14 @@ public String getValueDisplay(int component, Locale locale) { //default format (as is) return getComponent(1); } - if (component == 2) { - //default format (as is) - return getComponent(2); - } - return null; + // This is the last component, return directly without `if` + //default format (as is) + return getComponent(2); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -459,7 +454,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field23A(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field23B.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field23B.java index 14a4f52cf..be3394c1a 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field23B.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field23B.java @@ -29,12 +29,9 @@ -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -183,19 +180,16 @@ public String getValue() { */ @Override public String getValueDisplay(int component, Locale locale) { - if (component < 1 || component > 1) { + if (component != 1) { throw new IllegalArgumentException("invalid component number " + component + " for field 23B"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -398,7 +392,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field23B(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field23C.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field23C.java index cf02faff3..0334a38c0 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field23C.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field23C.java @@ -29,12 +29,9 @@ -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -184,19 +181,16 @@ public String getValue() { */ @Override public String getValueDisplay(int component, Locale locale) { - if (component < 1 || component > 1) { + if (component != 1) { throw new IllegalArgumentException("invalid component number " + component + " for field 23C"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -402,7 +396,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field23C(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field23D.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field23D.java index 70f867a33..d05be97e9 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field23D.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field23D.java @@ -29,12 +29,9 @@ -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -183,19 +180,16 @@ public String getValue() { */ @Override public String getValueDisplay(int component, Locale locale) { - if (component < 1 || component > 1) { + if (component != 1) { throw new IllegalArgumentException("invalid component number " + component + " for field 23D"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -398,7 +392,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field23D(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field23E.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field23E.java index 9db428e1b..feb5d3013 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field23E.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field23E.java @@ -29,12 +29,9 @@ -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -213,16 +210,14 @@ public String getValueDisplay(int component, Locale locale) { //default format (as is) return getComponent(1); } - if (component == 2) { - //default format (as is) - return getComponent(2); - } - return null; + // This is the last component, return directly without `if` + //default format (as is) + return getComponent(2); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -499,7 +494,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field23E(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field23F.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field23F.java index 4e46e8f70..b80b1d409 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field23F.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field23F.java @@ -29,12 +29,9 @@ -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -200,16 +197,14 @@ public String getValueDisplay(int component, Locale locale) { //default format (as is) return getComponent(1); } - if (component == 2) { - //default format (as is) - return getComponent(2); - } - return null; + // This is the last component, return directly without `if` + //default format (as is) + return getComponent(2); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -455,7 +450,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field23F(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field23G.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field23G.java index 3d90c0698..1c5d973bd 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field23G.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field23G.java @@ -29,12 +29,9 @@ -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -200,16 +197,14 @@ public String getValueDisplay(int component, Locale locale) { //default format (as is) return getComponent(1); } - if (component == 2) { - //default format (as is) - return getComponent(2); - } - return null; + // This is the last component, return directly without `if` + //default format (as is) + return getComponent(2); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -455,7 +450,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field23G(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field23H.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field23H.java index ba7f3b604..8b1e6f50f 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field23H.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field23H.java @@ -29,12 +29,9 @@ -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -183,19 +180,16 @@ public String getValue() { */ @Override public String getValueDisplay(int component, Locale locale) { - if (component < 1 || component > 1) { + if (component != 1) { throw new IllegalArgumentException("invalid component number " + component + " for field 23H"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -398,7 +392,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field23H(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field23R.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field23R.java index 9b66dec01..caac88ccb 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field23R.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field23R.java @@ -30,12 +30,9 @@ import com.prowidesoftware.swift.model.field.MultiLineField; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -223,16 +220,14 @@ public String getValueDisplay(int component, Locale locale) { //default format (as is) return getComponent(6); } - if (component == 7) { - //default format (as is) - return getComponent(7); - } - return null; + // This is the last component, return directly without `if` + //default format (as is) + return getComponent(7); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -733,7 +728,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field23R(f)); } @@ -749,6 +744,7 @@ public static List getAll(final SwiftTagListBlock block) { * @return line content or null if not present or if line number is above the expected * @since 7.7 */ + @Override public String getLine(int line) { return getLine(line, 0); } @@ -762,6 +758,7 @@ public String getLine(int line) { * @return line content or null if not present or if line number is above the expected * @since 7.7 */ + @Override public String getLine(int line, int offset) { Field23R cp = newInstance(this); return getLine(cp, line, null, offset); @@ -774,6 +771,7 @@ public String getLine(int line, int offset) { * @return lines content or empty list if field's value is empty * @since 7.7 */ + @Override public List getLines() { return SwiftParseUtils.getLines(getValue()); } @@ -786,6 +784,7 @@ public List getLines() { * @return found lines or empty list if lines are not present or the offset is invalid * @since 7.7 */ + @Override public List getLines(int offset) { Field23R cp = newInstance(this); return SwiftParseUtils.getLines(getLine(cp, null, null, offset)); @@ -800,6 +799,7 @@ public List getLines(int offset) { * @return found lines or empty list if value is empty * @since 7.7 */ + @Override public List getLinesBetween(int start, int end) { return getLinesBetween(start, end, 0); } @@ -814,6 +814,7 @@ public List getLinesBetween(int start, int end) { * @return found lines or empty list if lines are not present or the offset is invalid * @since 7.7 */ + @Override public List getLinesBetween(int start, int end, int offset) { Field23R cp = newInstance(this); return SwiftParseUtils.getLines(getLine(cp, start, end, offset)); diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field23S.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field23S.java index 1187abf81..45d9b2640 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field23S.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field23S.java @@ -29,12 +29,9 @@ -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -183,19 +180,16 @@ public String getValue() { */ @Override public String getValueDisplay(int component, Locale locale) { - if (component < 1 || component > 1) { + if (component != 1) { throw new IllegalArgumentException("invalid component number " + component + " for field 23S"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -398,7 +392,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field23S(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field23X.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field23X.java index b87e25abb..d93ad7151 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field23X.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field23X.java @@ -29,12 +29,9 @@ -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -199,16 +196,14 @@ public String getValueDisplay(int component, Locale locale) { //default format (as is) return getComponent(1); } - if (component == 2) { - //default format (as is) - return getComponent(2); - } - return null; + // This is the last component, return directly without `if` + //default format (as is) + return getComponent(2); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -451,7 +446,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field23X(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field242.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field242.java index 3bdb6b64c..6956ca163 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field242.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field242.java @@ -29,12 +29,9 @@ -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -183,19 +180,16 @@ public String getValue() { */ @Override public String getValueDisplay(int component, Locale locale) { - if (component < 1 || component > 1) { + if (component != 1) { throw new IllegalArgumentException("invalid component number " + component + " for field 242"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -398,7 +392,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field242(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field243.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field243.java index 1a14c939e..781df9453 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field243.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field243.java @@ -31,12 +31,9 @@ import java.math.BigInteger; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -185,19 +182,16 @@ public String getValue() { */ @Override public String getValueDisplay(int component, Locale locale) { - if (component < 1 || component > 1) { + if (component != 1) { throw new IllegalArgumentException("invalid component number " + component + " for field 243"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -344,32 +338,14 @@ public Field243 setComponent1(String component1) { return this; } - /** - * Set the component1 from a Long object. - *
- * If the component being set is a fixed length number, the argument will not be - * padded. It is recommended for these cases to use the setComponent1(String) - * method. - * - * @see #setComponent1(String) - * @since 9.2.7 - * - * @param component1 the Long with the Type content to set - * @return the field object to enable build pattern - */ - public Field243 setComponent1(java.lang.Long component1) { - setComponent(1, SwiftFormatUtils.getLong(component1)); - return this; - } /** * Alternative method setter for field's Type (component 1) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10 becomes an Integer) * * @param component1 the Number with the Type content to set * @return the field object to enable build pattern - * @see #setType(java.lang.Long) */ public Field243 setComponent1(java.lang.Number component1) { @@ -399,27 +375,13 @@ public Field243 setType(String component1) { return setComponent1(component1); } - /** - * Set the Type (component 1) from a Long object. - * - * @see #setComponent1(java.lang.Long) - * - * @param component1 Long with the Type content to set - * @return the field object to enable build pattern - * @since 9.2.7 - */ - public Field243 setType(java.lang.Long component1) { - return setComponent1(component1); - } - /** * Alternative method setter for field's Type (component 1) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10 becomes an Integer) * * @param component1 the Number with the Type content to set * @return the field object to enable build pattern - * @see #setType(java.lang.Long) */ public Field243 setType(java.lang.Number component1) { return setComponent1(component1); @@ -490,7 +452,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field243(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field24B.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field24B.java index c768b2d7d..309a4f903 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field24B.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field24B.java @@ -30,12 +30,9 @@ import com.prowidesoftware.swift.model.field.GenericField; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -214,16 +211,14 @@ public String getValueDisplay(int component, Locale locale) { //default format (as is) return getComponent(2); } - if (component == 3) { - //default format (as is) - return getComponent(3); - } - return null; + // This is the last component, return directly without `if` + //default format (as is) + return getComponent(3); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -452,6 +447,7 @@ public Field24B setReasonCode(String component3) { * * @return DSS component value or null if the DSS is not set or not available for this field. */ + @Override public String getDSS() { return getComponent2(); } @@ -462,6 +458,7 @@ public String getDSS() { * @see #getDSS() * @return true if DSS is present, false otherwise. */ + @Override public boolean isDSSPresent() { return getComponent2() != null; } @@ -476,6 +473,7 @@ public boolean isDSSPresent() { * * @return for generic fields returns the value of the conditional qualifier or null if not set or not applicable for this field. */ + @Override public String getConditionalQualifier() { return getComponent(CONDITIONAL_QUALIFIER); } @@ -543,7 +541,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field24B(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field24D.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field24D.java index 3270ae399..1c7b2e98c 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field24D.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field24D.java @@ -29,12 +29,9 @@ -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -206,16 +203,14 @@ public String getValueDisplay(int component, Locale locale) { //default format (as is) return getComponent(1); } - if (component == 2) { - //default format (as is) - return getComponent(2); - } - return null; + // This is the last component, return directly without `if` + //default format (as is) + return getComponent(2); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -475,7 +470,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field24D(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field24E.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field24E.java index 52b58edf4..87689a8e1 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field24E.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field24E.java @@ -29,12 +29,9 @@ -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -200,16 +197,14 @@ public String getValueDisplay(int component, Locale locale) { //default format (as is) return getComponent(1); } - if (component == 2) { - //default format (as is) - return getComponent(2); - } - return null; + // This is the last component, return directly without `if` + //default format (as is) + return getComponent(2); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -455,7 +450,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field24E(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field24G.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field24G.java index 7a892a711..6bb0eb43a 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field24G.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field24G.java @@ -30,12 +30,9 @@ import com.prowidesoftware.swift.model.field.MultiLineField; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -254,16 +251,14 @@ public String getValueDisplay(int component, Locale locale) { //default format (as is) return getComponent(12); } - if (component == 13) { - //default format (as is) - return getComponent(13); - } - return null; + // This is the last component, return directly without `if` + //default format (as is) + return getComponent(13); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -1058,7 +1053,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field24G(f)); } @@ -1074,6 +1069,7 @@ public static List getAll(final SwiftTagListBlock block) { * @return line content or null if not present or if line number is above the expected * @since 7.7 */ + @Override public String getLine(int line) { return getLine(line, 0); } @@ -1087,6 +1083,7 @@ public String getLine(int line) { * @return line content or null if not present or if line number is above the expected * @since 7.7 */ + @Override public String getLine(int line, int offset) { Field24G cp = newInstance(this); return getLine(cp, line, null, offset); @@ -1099,6 +1096,7 @@ public String getLine(int line, int offset) { * @return lines content or empty list if field's value is empty * @since 7.7 */ + @Override public List getLines() { return SwiftParseUtils.getLines(getValue()); } @@ -1111,6 +1109,7 @@ public List getLines() { * @return found lines or empty list if lines are not present or the offset is invalid * @since 7.7 */ + @Override public List getLines(int offset) { Field24G cp = newInstance(this); return SwiftParseUtils.getLines(getLine(cp, null, null, offset)); @@ -1125,6 +1124,7 @@ public List getLines(int offset) { * @return found lines or empty list if value is empty * @since 7.7 */ + @Override public List getLinesBetween(int start, int end) { return getLinesBetween(start, end, 0); } @@ -1139,6 +1139,7 @@ public List getLinesBetween(int start, int end) { * @return found lines or empty list if lines are not present or the offset is invalid * @since 7.7 */ + @Override public List getLinesBetween(int start, int end, int offset) { Field24G cp = newInstance(this); return SwiftParseUtils.getLines(getLine(cp, start, end, offset)); diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field25.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field25.java index f354b26b6..6617ab8bf 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field25.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field25.java @@ -29,12 +29,9 @@ -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -183,19 +180,16 @@ public String getValue() { */ @Override public String getValueDisplay(int component, Locale locale) { - if (component < 1 || component > 1) { + if (component != 1) { throw new IllegalArgumentException("invalid component number " + component + " for field 25"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -407,7 +401,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field25(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field251.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field251.java index dee030a1f..99a2cd1e9 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field251.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field251.java @@ -30,12 +30,9 @@ import com.prowidesoftware.swift.model.MIR; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -184,19 +181,16 @@ public String getValue() { */ @Override public String getValueDisplay(int component, Locale locale) { - if (component < 1 || component > 1) { + if (component != 1) { throw new IllegalArgumentException("invalid component number " + component + " for field 251"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -439,7 +433,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field251(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field252.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field252.java index 55c3cebf5..d7f7defb9 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field252.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field252.java @@ -31,12 +31,9 @@ import java.util.Calendar; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -238,20 +235,19 @@ public String getValueDisplay(int component, Locale locale) { return f.format(cal.getTime()); } } - if (component == 4) { - //time: HH[mm] - java.text.DateFormat f = new java.text.SimpleDateFormat("HH:mm", notNull(locale)); - java.util.Calendar cal = getComponent4AsCalendar(); - if (cal != null) { - return f.format(cal.getTime()); - } + // This is the last component, return directly without `if` + //time: HH[mm] + java.text.DateFormat f = new java.text.SimpleDateFormat("HH:mm", notNull(locale)); + java.util.Calendar cal = getComponent4AsCalendar(); + if (cal != null) { + return f.format(cal.getTime()); } return null; } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -734,7 +730,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field252(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field253.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field253.java index fa48859a8..adb7cc704 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field253.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field253.java @@ -30,12 +30,9 @@ import com.prowidesoftware.swift.model.MOR; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -184,19 +181,16 @@ public String getValue() { */ @Override public String getValueDisplay(int component, Locale locale) { - if (component < 1 || component > 1) { + if (component != 1) { throw new IllegalArgumentException("invalid component number " + component + " for field 253"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -439,7 +433,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field253(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field254.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field254.java index d4e2118ae..1a0948145 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field254.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field254.java @@ -31,12 +31,9 @@ import java.util.Calendar; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -238,20 +235,19 @@ public String getValueDisplay(int component, Locale locale) { return f.format(cal.getTime()); } } - if (component == 4) { - //time: HH[mm] - java.text.DateFormat f = new java.text.SimpleDateFormat("HH:mm", notNull(locale)); - java.util.Calendar cal = getComponent4AsCalendar(); - if (cal != null) { - return f.format(cal.getTime()); - } + // This is the last component, return directly without `if` + //time: HH[mm] + java.text.DateFormat f = new java.text.SimpleDateFormat("HH:mm", notNull(locale)); + java.util.Calendar cal = getComponent4AsCalendar(); + if (cal != null) { + return f.format(cal.getTime()); } return null; } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -734,7 +730,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field254(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field255.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field255.java index bc061d29e..967c01912 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field255.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field255.java @@ -35,12 +35,9 @@ import com.prowidesoftware.swift.model.field.DateContainer; import com.prowidesoftware.swift.model.field.DateResolver; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -274,20 +271,19 @@ public String getValueDisplay(int component, Locale locale) { return f.format(cal.getTime()); } } - if (component == 6) { - //time: HH[mm] - java.text.DateFormat f = new java.text.SimpleDateFormat("HH:mm", notNull(locale)); - java.util.Calendar cal = getComponent6AsCalendar(); - if (cal != null) { - return f.format(cal.getTime()); - } + // This is the last component, return directly without `if` + //time: HH[mm] + java.text.DateFormat f = new java.text.SimpleDateFormat("HH:mm", notNull(locale)); + java.util.Calendar cal = getComponent6AsCalendar(); + if (cal != null) { + return f.format(cal.getTime()); } return null; } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -641,32 +637,14 @@ public Field255 setComponent2(String component2) { return this; } - /** - * Set the component2 from a Long object. - *
- * If the component being set is a fixed length number, the argument will not be - * padded. It is recommended for these cases to use the setComponent2(String) - * method. - * - * @see #setComponent2(String) - * @since 9.2.7 - * - * @param component2 the Long with the Session Number content to set - * @return the field object to enable build pattern - */ - public Field255 setComponent2(java.lang.Long component2) { - setComponent(2, SwiftFormatUtils.getLong(component2)); - return this; - } /** * Alternative method setter for field's Session Number (component 2) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10 becomes an Integer) * * @param component2 the Number with the Session Number content to set * @return the field object to enable build pattern - * @see #setSessionNumber(java.lang.Long) */ public Field255 setComponent2(java.lang.Number component2) { @@ -696,27 +674,13 @@ public Field255 setSessionNumber(String component2) { return setComponent2(component2); } - /** - * Set the Session Number (component 2) from a Long object. - * - * @see #setComponent2(java.lang.Long) - * - * @param component2 Long with the Session Number content to set - * @return the field object to enable build pattern - * @since 9.2.7 - */ - public Field255 setSessionNumber(java.lang.Long component2) { - return setComponent2(component2); - } - /** * Alternative method setter for field's Session Number (component 2) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10 becomes an Integer) * * @param component2 the Number with the Session Number content to set * @return the field object to enable build pattern - * @see #setSessionNumber(java.lang.Long) */ public Field255 setSessionNumber(java.lang.Number component2) { return setComponent2(component2); @@ -881,6 +845,7 @@ public Field255 setEndTime(java.util.Calendar component6) { * * @return the list of converted components (a Calendar object or null) */ + @Override public List dates() { return DateResolver.dates(this); } @@ -958,7 +923,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field255(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field256.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field256.java index 8b89686f2..2ed25e475 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field256.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field256.java @@ -35,12 +35,9 @@ import com.prowidesoftware.swift.model.field.DateContainer; import com.prowidesoftware.swift.model.field.DateResolver; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -274,20 +271,19 @@ public String getValueDisplay(int component, Locale locale) { return f.format(cal.getTime()); } } - if (component == 6) { - //time: HH[mm] - java.text.DateFormat f = new java.text.SimpleDateFormat("HH:mm", notNull(locale)); - java.util.Calendar cal = getComponent6AsCalendar(); - if (cal != null) { - return f.format(cal.getTime()); - } + // This is the last component, return directly without `if` + //time: HH[mm] + java.text.DateFormat f = new java.text.SimpleDateFormat("HH:mm", notNull(locale)); + java.util.Calendar cal = getComponent6AsCalendar(); + if (cal != null) { + return f.format(cal.getTime()); } return null; } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -660,32 +656,14 @@ public Field256 setComponent2(String component2) { return this; } - /** - * Set the component2 from a Long object. - *
- * If the component being set is a fixed length number, the argument will not be - * padded. It is recommended for these cases to use the setComponent2(String) - * method. - * - * @see #setComponent2(String) - * @since 9.2.7 - * - * @param component2 the Long with the Session Number content to set - * @return the field object to enable build pattern - */ - public Field256 setComponent2(java.lang.Long component2) { - setComponent(2, SwiftFormatUtils.getLong(component2)); - return this; - } /** * Alternative method setter for field's Session Number (component 2) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10 becomes an Integer) * * @param component2 the Number with the Session Number content to set * @return the field object to enable build pattern - * @see #setSessionNumber(java.lang.Long) */ public Field256 setComponent2(java.lang.Number component2) { @@ -715,27 +693,13 @@ public Field256 setSessionNumber(String component2) { return setComponent2(component2); } - /** - * Set the Session Number (component 2) from a Long object. - * - * @see #setComponent2(java.lang.Long) - * - * @param component2 Long with the Session Number content to set - * @return the field object to enable build pattern - * @since 9.2.7 - */ - public Field256 setSessionNumber(java.lang.Long component2) { - return setComponent2(component2); - } - /** * Alternative method setter for field's Session Number (component 2) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10 becomes an Integer) * * @param component2 the Number with the Session Number content to set * @return the field object to enable build pattern - * @see #setSessionNumber(java.lang.Long) */ public Field256 setSessionNumber(java.lang.Number component2) { return setComponent2(component2); @@ -752,32 +716,14 @@ public Field256 setComponent3(String component3) { return this; } - /** - * Set the component3 from a Long object. - *
- * If the component being set is a fixed length number, the argument will not be - * padded. It is recommended for these cases to use the setComponent3(String) - * method. - * - * @see #setComponent3(String) - * @since 9.2.7 - * - * @param component3 the Long with the Message Category content to set - * @return the field object to enable build pattern - */ - public Field256 setComponent3(java.lang.Long component3) { - setComponent(3, SwiftFormatUtils.getLong(component3)); - return this; - } /** * Alternative method setter for field's Message Category (component 3) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10 becomes an Integer) * * @param component3 the Number with the Message Category content to set * @return the field object to enable build pattern - * @see #setMessageCategory(java.lang.Long) */ public Field256 setComponent3(java.lang.Number component3) { @@ -807,27 +753,13 @@ public Field256 setMessageCategory(String component3) { return setComponent3(component3); } - /** - * Set the Message Category (component 3) from a Long object. - * - * @see #setComponent3(java.lang.Long) - * - * @param component3 Long with the Message Category content to set - * @return the field object to enable build pattern - * @since 9.2.7 - */ - public Field256 setMessageCategory(java.lang.Long component3) { - return setComponent3(component3); - } - /** * Alternative method setter for field's Message Category (component 3) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10 becomes an Integer) * * @param component3 the Number with the Message Category content to set * @return the field object to enable build pattern - * @see #setMessageCategory(java.lang.Long) */ public Field256 setMessageCategory(java.lang.Number component3) { return setComponent3(component3); @@ -971,6 +903,7 @@ public Field256 setEndTime(java.util.Calendar component6) { * * @return the list of converted components (a Calendar object or null) */ + @Override public List dates() { return DateResolver.dates(this); } @@ -1048,7 +981,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field256(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field257.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field257.java index 0ee938f0e..a6f88c6f1 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field257.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field257.java @@ -35,12 +35,9 @@ import com.prowidesoftware.swift.model.field.DateContainer; import com.prowidesoftware.swift.model.field.DateResolver; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -264,16 +261,14 @@ public String getValueDisplay(int component, Locale locale) { return f.format(cal.getTime()); } } - if (component == 5) { - //default format (as is) - return getComponent(5); - } - return null; + // This is the last component, return directly without `if` + //default format (as is) + return getComponent(5); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -740,32 +735,14 @@ public Field257 setComponent5(String component5) { return this; } - /** - * Set the component5 from a Long object. - *
- * If the component being set is a fixed length number, the argument will not be - * padded. It is recommended for these cases to use the setComponent5(String) - * method. - * - * @see #setComponent5(String) - * @since 9.2.7 - * - * @param component5 the Long with the Session Number content to set - * @return the field object to enable build pattern - */ - public Field257 setComponent5(java.lang.Long component5) { - setComponent(5, SwiftFormatUtils.getLong(component5)); - return this; - } /** * Alternative method setter for field's Session Number (component 5) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10 becomes an Integer) * * @param component5 the Number with the Session Number content to set * @return the field object to enable build pattern - * @see #setSessionNumber(java.lang.Long) */ public Field257 setComponent5(java.lang.Number component5) { @@ -795,27 +772,13 @@ public Field257 setSessionNumber(String component5) { return setComponent5(component5); } - /** - * Set the Session Number (component 5) from a Long object. - * - * @see #setComponent5(java.lang.Long) - * - * @param component5 Long with the Session Number content to set - * @return the field object to enable build pattern - * @since 9.2.7 - */ - public Field257 setSessionNumber(java.lang.Long component5) { - return setComponent5(component5); - } - /** * Alternative method setter for field's Session Number (component 5) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10 becomes an Integer) * * @param component5 the Number with the Session Number content to set * @return the field object to enable build pattern - * @see #setSessionNumber(java.lang.Long) */ public Field257 setSessionNumber(java.lang.Number component5) { return setComponent5(component5); @@ -827,6 +790,7 @@ public Field257 setSessionNumber(java.lang.Number component5) { * * @return the list of converted components (a Calendar object or null) */ + @Override public List dates() { return DateResolver.dates(this); } @@ -904,7 +868,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field257(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field258.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field258.java index ea1cd07cf..5f8c9d7d0 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field258.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field258.java @@ -35,12 +35,9 @@ import com.prowidesoftware.swift.model.field.DateContainer; import com.prowidesoftware.swift.model.field.DateResolver; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -274,20 +271,19 @@ public String getValueDisplay(int component, Locale locale) { return f.format(cal.getTime()); } } - if (component == 6) { - //time: HH[mm] - java.text.DateFormat f = new java.text.SimpleDateFormat("HH:mm", notNull(locale)); - java.util.Calendar cal = getComponent6AsCalendar(); - if (cal != null) { - return f.format(cal.getTime()); - } + // This is the last component, return directly without `if` + //time: HH[mm] + java.text.DateFormat f = new java.text.SimpleDateFormat("HH:mm", notNull(locale)); + java.util.Calendar cal = getComponent6AsCalendar(); + if (cal != null) { + return f.format(cal.getTime()); } return null; } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -641,32 +637,14 @@ public Field258 setComponent2(String component2) { return this; } - /** - * Set the component2 from a Long object. - *
- * If the component being set is a fixed length number, the argument will not be - * padded. It is recommended for these cases to use the setComponent2(String) - * method. - * - * @see #setComponent2(String) - * @since 9.2.7 - * - * @param component2 the Long with the Session Number content to set - * @return the field object to enable build pattern - */ - public Field258 setComponent2(java.lang.Long component2) { - setComponent(2, SwiftFormatUtils.getLong(component2)); - return this; - } /** * Alternative method setter for field's Session Number (component 2) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10 becomes an Integer) * * @param component2 the Number with the Session Number content to set * @return the field object to enable build pattern - * @see #setSessionNumber(java.lang.Long) */ public Field258 setComponent2(java.lang.Number component2) { @@ -696,27 +674,13 @@ public Field258 setSessionNumber(String component2) { return setComponent2(component2); } - /** - * Set the Session Number (component 2) from a Long object. - * - * @see #setComponent2(java.lang.Long) - * - * @param component2 Long with the Session Number content to set - * @return the field object to enable build pattern - * @since 9.2.7 - */ - public Field258 setSessionNumber(java.lang.Long component2) { - return setComponent2(component2); - } - /** * Alternative method setter for field's Session Number (component 2) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10 becomes an Integer) * * @param component2 the Number with the Session Number content to set * @return the field object to enable build pattern - * @see #setSessionNumber(java.lang.Long) */ public Field258 setSessionNumber(java.lang.Number component2) { return setComponent2(component2); @@ -881,6 +845,7 @@ public Field258 setEndTime(java.util.Calendar component6) { * * @return the list of converted components (a Calendar object or null) */ + @Override public List dates() { return DateResolver.dates(this); } @@ -958,7 +923,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field258(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field259.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field259.java index 60c4ece46..2d8442d8f 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field259.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field259.java @@ -35,12 +35,9 @@ import com.prowidesoftware.swift.model.field.DateContainer; import com.prowidesoftware.swift.model.field.DateResolver; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -269,20 +266,19 @@ public String getValueDisplay(int component, Locale locale) { return f.format(cal.getTime()); } } - if (component == 6) { - //time: HH[mm] - java.text.DateFormat f = new java.text.SimpleDateFormat("HH:mm", notNull(locale)); - java.util.Calendar cal = getComponent6AsCalendar(); - if (cal != null) { - return f.format(cal.getTime()); - } + // This is the last component, return directly without `if` + //time: HH[mm] + java.text.DateFormat f = new java.text.SimpleDateFormat("HH:mm", notNull(locale)); + java.util.Calendar cal = getComponent6AsCalendar(); + if (cal != null) { + return f.format(cal.getTime()); } return null; } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -655,32 +651,14 @@ public Field259 setComponent2(String component2) { return this; } - /** - * Set the component2 from a Long object. - *
- * If the component being set is a fixed length number, the argument will not be - * padded. It is recommended for these cases to use the setComponent2(String) - * method. - * - * @see #setComponent2(String) - * @since 9.2.7 - * - * @param component2 the Long with the Session Number content to set - * @return the field object to enable build pattern - */ - public Field259 setComponent2(java.lang.Long component2) { - setComponent(2, SwiftFormatUtils.getLong(component2)); - return this; - } /** * Alternative method setter for field's Session Number (component 2) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10 becomes an Integer) * * @param component2 the Number with the Session Number content to set * @return the field object to enable build pattern - * @see #setSessionNumber(java.lang.Long) */ public Field259 setComponent2(java.lang.Number component2) { @@ -710,27 +688,13 @@ public Field259 setSessionNumber(String component2) { return setComponent2(component2); } - /** - * Set the Session Number (component 2) from a Long object. - * - * @see #setComponent2(java.lang.Long) - * - * @param component2 Long with the Session Number content to set - * @return the field object to enable build pattern - * @since 9.2.7 - */ - public Field259 setSessionNumber(java.lang.Long component2) { - return setComponent2(component2); - } - /** * Alternative method setter for field's Session Number (component 2) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10 becomes an Integer) * * @param component2 the Number with the Session Number content to set * @return the field object to enable build pattern - * @see #setSessionNumber(java.lang.Long) */ public Field259 setSessionNumber(java.lang.Number component2) { return setComponent2(component2); @@ -747,32 +711,14 @@ public Field259 setComponent3(String component3) { return this; } - /** - * Set the component3 from a Long object. - *
- * If the component being set is a fixed length number, the argument will not be - * padded. It is recommended for these cases to use the setComponent3(String) - * method. - * - * @see #setComponent3(String) - * @since 9.2.7 - * - * @param component3 the Long with the Message Category content to set - * @return the field object to enable build pattern - */ - public Field259 setComponent3(java.lang.Long component3) { - setComponent(3, SwiftFormatUtils.getLong(component3)); - return this; - } /** * Alternative method setter for field's Message Category (component 3) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10 becomes an Integer) * * @param component3 the Number with the Message Category content to set * @return the field object to enable build pattern - * @see #setMessageCategory(java.lang.Long) */ public Field259 setComponent3(java.lang.Number component3) { @@ -802,27 +748,13 @@ public Field259 setMessageCategory(String component3) { return setComponent3(component3); } - /** - * Set the Message Category (component 3) from a Long object. - * - * @see #setComponent3(java.lang.Long) - * - * @param component3 Long with the Message Category content to set - * @return the field object to enable build pattern - * @since 9.2.7 - */ - public Field259 setMessageCategory(java.lang.Long component3) { - return setComponent3(component3); - } - /** * Alternative method setter for field's Message Category (component 3) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10 becomes an Integer) * * @param component3 the Number with the Message Category content to set * @return the field object to enable build pattern - * @see #setMessageCategory(java.lang.Long) */ public Field259 setMessageCategory(java.lang.Number component3) { return setComponent3(component3); @@ -966,6 +898,7 @@ public Field259 setEndTime(java.util.Calendar component6) { * * @return the list of converted components (a Calendar object or null) */ + @Override public List dates() { return DateResolver.dates(this); } @@ -1043,7 +976,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field259(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field25A.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field25A.java index 55d36dcd6..90ed46554 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field25A.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field25A.java @@ -29,12 +29,9 @@ -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -184,19 +181,16 @@ public String getValue() { */ @Override public String getValueDisplay(int component, Locale locale) { - if (component < 1 || component > 1) { + if (component != 1) { throw new IllegalArgumentException("invalid component number " + component + " for field 25A"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -408,7 +402,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field25A(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field25D.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field25D.java index 0eeef1030..3d75f4067 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field25D.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field25D.java @@ -30,12 +30,9 @@ import com.prowidesoftware.swift.model.field.GenericField; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -215,16 +212,14 @@ public String getValueDisplay(int component, Locale locale) { //default format (as is) return getComponent(2); } - if (component == 3) { - //default format (as is) - return getComponent(3); - } - return null; + // This is the last component, return directly without `if` + //default format (as is) + return getComponent(3); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -456,6 +451,7 @@ public Field25D setStatusCode(String component3) { * * @return DSS component value or null if the DSS is not set or not available for this field. */ + @Override public String getDSS() { return getComponent2(); } @@ -466,6 +462,7 @@ public String getDSS() { * @see #getDSS() * @return true if DSS is present, false otherwise. */ + @Override public boolean isDSSPresent() { return getComponent2() != null; } @@ -480,6 +477,7 @@ public boolean isDSSPresent() { * * @return for generic fields returns the value of the conditional qualifier or null if not set or not applicable for this field. */ + @Override public String getConditionalQualifier() { return getComponent(CONDITIONAL_QUALIFIER); } @@ -547,7 +545,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field25D(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field25P.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field25P.java index a05e1ffe8..98f2528d0 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field25P.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field25P.java @@ -33,12 +33,9 @@ import com.prowidesoftware.swift.model.field.BICContainer; import com.prowidesoftware.swift.model.field.BICResolver; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -207,16 +204,14 @@ public String getValueDisplay(int component, Locale locale) { //default format (as is) return getComponent(1); } - if (component == 2) { - //default format (as is) - return getComponent(2); - } - return null; + // This is the last component, return directly without `if` + //default format (as is) + return getComponent(2); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -450,10 +445,12 @@ public Field25P setIdentifierCode(com.prowidesoftware.swift.model.BIC component2 } + @Override public List bics() { return BICResolver.bics(this); } + @Override public List bicStrings () { return BICResolver.bicStrings(this); } @@ -522,7 +519,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field25P(f)); } @@ -538,6 +535,7 @@ public static List getAll(final SwiftTagListBlock block) { * @return line content or null if not present or if line number is above the expected * @since 7.7 */ + @Override public String getLine(int line) { return getLine(line, 0); } @@ -551,6 +549,7 @@ public String getLine(int line) { * @return line content or null if not present or if line number is above the expected * @since 7.7 */ + @Override public String getLine(int line, int offset) { Field25P cp = newInstance(this); return getLine(cp, line, null, offset); @@ -563,6 +562,7 @@ public String getLine(int line, int offset) { * @return lines content or empty list if field's value is empty * @since 7.7 */ + @Override public List getLines() { return SwiftParseUtils.getLines(getValue()); } @@ -575,6 +575,7 @@ public List getLines() { * @return found lines or empty list if lines are not present or the offset is invalid * @since 7.7 */ + @Override public List getLines(int offset) { Field25P cp = newInstance(this); return SwiftParseUtils.getLines(getLine(cp, null, null, offset)); @@ -589,6 +590,7 @@ public List getLines(int offset) { * @return found lines or empty list if value is empty * @since 7.7 */ + @Override public List getLinesBetween(int start, int end) { return getLinesBetween(start, end, 0); } @@ -603,6 +605,7 @@ public List getLinesBetween(int start, int end) { * @return found lines or empty list if lines are not present or the offset is invalid * @since 7.7 */ + @Override public List getLinesBetween(int start, int end, int offset) { Field25P cp = newInstance(this); return SwiftParseUtils.getLines(getLine(cp, start, end, offset)); diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field260.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field260.java index 6bbe9ca71..5a01cd428 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field260.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field260.java @@ -35,12 +35,9 @@ import com.prowidesoftware.swift.model.field.DateContainer; import com.prowidesoftware.swift.model.field.DateResolver; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -264,16 +261,14 @@ public String getValueDisplay(int component, Locale locale) { return f.format(cal.getTime()); } } - if (component == 5) { - //default format (as is) - return getComponent(5); - } - return null; + // This is the last component, return directly without `if` + //default format (as is) + return getComponent(5); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -740,32 +735,14 @@ public Field260 setComponent5(String component5) { return this; } - /** - * Set the component5 from a Long object. - *
- * If the component being set is a fixed length number, the argument will not be - * padded. It is recommended for these cases to use the setComponent5(String) - * method. - * - * @see #setComponent5(String) - * @since 9.2.7 - * - * @param component5 the Long with the Session Number content to set - * @return the field object to enable build pattern - */ - public Field260 setComponent5(java.lang.Long component5) { - setComponent(5, SwiftFormatUtils.getLong(component5)); - return this; - } /** * Alternative method setter for field's Session Number (component 5) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10 becomes an Integer) * * @param component5 the Number with the Session Number content to set * @return the field object to enable build pattern - * @see #setSessionNumber(java.lang.Long) */ public Field260 setComponent5(java.lang.Number component5) { @@ -795,27 +772,13 @@ public Field260 setSessionNumber(String component5) { return setComponent5(component5); } - /** - * Set the Session Number (component 5) from a Long object. - * - * @see #setComponent5(java.lang.Long) - * - * @param component5 Long with the Session Number content to set - * @return the field object to enable build pattern - * @since 9.2.7 - */ - public Field260 setSessionNumber(java.lang.Long component5) { - return setComponent5(component5); - } - /** * Alternative method setter for field's Session Number (component 5) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10 becomes an Integer) * * @param component5 the Number with the Session Number content to set * @return the field object to enable build pattern - * @see #setSessionNumber(java.lang.Long) */ public Field260 setSessionNumber(java.lang.Number component5) { return setComponent5(component5); @@ -827,6 +790,7 @@ public Field260 setSessionNumber(java.lang.Number component5) { * * @return the list of converted components (a Calendar object or null) */ + @Override public List dates() { return DateResolver.dates(this); } @@ -904,7 +868,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field260(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field263.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field263.java index 38a5e6bef..d844c51a8 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field263.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field263.java @@ -35,12 +35,9 @@ import com.prowidesoftware.swift.model.field.DateContainer; import com.prowidesoftware.swift.model.field.DateResolver; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -264,16 +261,14 @@ public String getValueDisplay(int component, Locale locale) { return f.format(cal.getTime()); } } - if (component == 5) { - //default format (as is) - return getComponent(5); - } - return null; + // This is the last component, return directly without `if` + //default format (as is) + return getComponent(5); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -740,32 +735,14 @@ public Field263 setComponent5(String component5) { return this; } - /** - * Set the component5 from a Long object. - *
- * If the component being set is a fixed length number, the argument will not be - * padded. It is recommended for these cases to use the setComponent5(String) - * method. - * - * @see #setComponent5(String) - * @since 9.2.7 - * - * @param component5 the Long with the Session Number content to set - * @return the field object to enable build pattern - */ - public Field263 setComponent5(java.lang.Long component5) { - setComponent(5, SwiftFormatUtils.getLong(component5)); - return this; - } /** * Alternative method setter for field's Session Number (component 5) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10 becomes an Integer) * * @param component5 the Number with the Session Number content to set * @return the field object to enable build pattern - * @see #setSessionNumber(java.lang.Long) */ public Field263 setComponent5(java.lang.Number component5) { @@ -795,27 +772,13 @@ public Field263 setSessionNumber(String component5) { return setComponent5(component5); } - /** - * Set the Session Number (component 5) from a Long object. - * - * @see #setComponent5(java.lang.Long) - * - * @param component5 Long with the Session Number content to set - * @return the field object to enable build pattern - * @since 9.2.7 - */ - public Field263 setSessionNumber(java.lang.Long component5) { - return setComponent5(component5); - } - /** * Alternative method setter for field's Session Number (component 5) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10 becomes an Integer) * * @param component5 the Number with the Session Number content to set * @return the field object to enable build pattern - * @see #setSessionNumber(java.lang.Long) */ public Field263 setSessionNumber(java.lang.Number component5) { return setComponent5(component5); @@ -827,6 +790,7 @@ public Field263 setSessionNumber(java.lang.Number component5) { * * @return the list of converted components (a Calendar object or null) */ + @Override public List dates() { return DateResolver.dates(this); } @@ -904,7 +868,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field263(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field264.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field264.java index bd2bff250..3cb492316 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field264.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field264.java @@ -35,12 +35,9 @@ import com.prowidesoftware.swift.model.field.DateContainer; import com.prowidesoftware.swift.model.field.DateResolver; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -264,16 +261,14 @@ public String getValueDisplay(int component, Locale locale) { return f.format(cal.getTime()); } } - if (component == 5) { - //default format (as is) - return getComponent(5); - } - return null; + // This is the last component, return directly without `if` + //default format (as is) + return getComponent(5); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -740,32 +735,14 @@ public Field264 setComponent5(String component5) { return this; } - /** - * Set the component5 from a Long object. - *
- * If the component being set is a fixed length number, the argument will not be - * padded. It is recommended for these cases to use the setComponent5(String) - * method. - * - * @see #setComponent5(String) - * @since 9.2.7 - * - * @param component5 the Long with the Session Number content to set - * @return the field object to enable build pattern - */ - public Field264 setComponent5(java.lang.Long component5) { - setComponent(5, SwiftFormatUtils.getLong(component5)); - return this; - } /** * Alternative method setter for field's Session Number (component 5) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10 becomes an Integer) * * @param component5 the Number with the Session Number content to set * @return the field object to enable build pattern - * @see #setSessionNumber(java.lang.Long) */ public Field264 setComponent5(java.lang.Number component5) { @@ -795,27 +772,13 @@ public Field264 setSessionNumber(String component5) { return setComponent5(component5); } - /** - * Set the Session Number (component 5) from a Long object. - * - * @see #setComponent5(java.lang.Long) - * - * @param component5 Long with the Session Number content to set - * @return the field object to enable build pattern - * @since 9.2.7 - */ - public Field264 setSessionNumber(java.lang.Long component5) { - return setComponent5(component5); - } - /** * Alternative method setter for field's Session Number (component 5) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10 becomes an Integer) * * @param component5 the Number with the Session Number content to set * @return the field object to enable build pattern - * @see #setSessionNumber(java.lang.Long) */ public Field264 setSessionNumber(java.lang.Number component5) { return setComponent5(component5); @@ -827,6 +790,7 @@ public Field264 setSessionNumber(java.lang.Number component5) { * * @return the list of converted components (a Calendar object or null) */ + @Override public List dates() { return DateResolver.dates(this); } @@ -904,7 +868,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field264(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field26A.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field26A.java index 564cea121..331d28ca2 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field26A.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field26A.java @@ -29,12 +29,9 @@ -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -200,16 +197,14 @@ public String getValueDisplay(int component, Locale locale) { //default format (as is) return getComponent(1); } - if (component == 2) { - //default format (as is) - return getComponent(2); - } - return null; + // This is the last component, return directly without `if` + //default format (as is) + return getComponent(2); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -455,7 +450,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field26A(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field26B.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field26B.java index 39ca2881e..61e84b7de 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field26B.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field26B.java @@ -29,12 +29,9 @@ -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -183,19 +180,16 @@ public String getValue() { */ @Override public String getValueDisplay(int component, Locale locale) { - if (component < 1 || component > 1) { + if (component != 1) { throw new IllegalArgumentException("invalid component number " + component + " for field 26B"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -398,7 +392,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field26B(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field26C.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field26C.java index cd1781d88..588bd3293 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field26C.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field26C.java @@ -29,12 +29,9 @@ -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -270,16 +267,14 @@ public String getValueDisplay(int component, Locale locale) { //default format (as is) return getComponent(5); } - if (component == 6) { - //default format (as is) - return getComponent(6); - } - return null; + // This is the last component, return directly without `if` + //default format (as is) + return getComponent(6); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -691,7 +686,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field26C(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field26D.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field26D.java index c5ef52f66..f9a30cbda 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field26D.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field26D.java @@ -30,12 +30,9 @@ import com.prowidesoftware.swift.model.field.MultiLineField; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -333,16 +330,14 @@ public String getValueDisplay(int component, Locale locale) { //default format (as is) return getComponent(29); } - if (component == 30) { - //default format (as is) - return getComponent(30); - } - return null; + // This is the last component, return directly without `if` + //default format (as is) + return getComponent(30); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -1832,7 +1827,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field26D(f)); } @@ -1848,6 +1843,7 @@ public static List getAll(final SwiftTagListBlock block) { * @return line content or null if not present or if line number is above the expected * @since 7.7 */ + @Override public String getLine(int line) { return getLine(line, 0); } @@ -1861,6 +1857,7 @@ public String getLine(int line) { * @return line content or null if not present or if line number is above the expected * @since 7.7 */ + @Override public String getLine(int line, int offset) { Field26D cp = newInstance(this); return getLine(cp, line, null, offset); @@ -1873,6 +1870,7 @@ public String getLine(int line, int offset) { * @return lines content or empty list if field's value is empty * @since 7.7 */ + @Override public List getLines() { return SwiftParseUtils.getLines(getValue()); } @@ -1885,6 +1883,7 @@ public List getLines() { * @return found lines or empty list if lines are not present or the offset is invalid * @since 7.7 */ + @Override public List getLines(int offset) { Field26D cp = newInstance(this); return SwiftParseUtils.getLines(getLine(cp, null, null, offset)); @@ -1899,6 +1898,7 @@ public List getLines(int offset) { * @return found lines or empty list if value is empty * @since 7.7 */ + @Override public List getLinesBetween(int start, int end) { return getLinesBetween(start, end, 0); } @@ -1913,6 +1913,7 @@ public List getLinesBetween(int start, int end) { * @return found lines or empty list if lines are not present or the offset is invalid * @since 7.7 */ + @Override public List getLinesBetween(int start, int end, int offset) { Field26D cp = newInstance(this); return SwiftParseUtils.getLines(getLine(cp, start, end, offset)); diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field26F.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field26F.java index 841eb150d..571d6f9ff 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field26F.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field26F.java @@ -29,12 +29,9 @@ -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -183,19 +180,16 @@ public String getValue() { */ @Override public String getValueDisplay(int component, Locale locale) { - if (component < 1 || component > 1) { + if (component != 1) { throw new IllegalArgumentException("invalid component number " + component + " for field 26F"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -398,7 +392,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field26F(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field26H.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field26H.java index 32d4488d9..982628099 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field26H.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field26H.java @@ -29,12 +29,9 @@ -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -190,19 +187,16 @@ public String getValue() { */ @Override public String getValueDisplay(int component, Locale locale) { - if (component < 1 || component > 1) { + if (component != 1) { throw new IllegalArgumentException("invalid component number " + component + " for field 26H"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -422,7 +416,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field26H(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field26K.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field26K.java index e83743e87..34f3f1212 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field26K.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field26K.java @@ -29,12 +29,9 @@ -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -183,19 +180,16 @@ public String getValue() { */ @Override public String getValueDisplay(int component, Locale locale) { - if (component < 1 || component > 1) { + if (component != 1) { throw new IllegalArgumentException("invalid component number " + component + " for field 26K"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -398,7 +392,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field26K(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field26T.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field26T.java index d8229fec8..783c8fd59 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field26T.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field26T.java @@ -29,12 +29,9 @@ -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -183,19 +180,16 @@ public String getValue() { */ @Override public String getValueDisplay(int component, Locale locale) { - if (component < 1 || component > 1) { + if (component != 1) { throw new IllegalArgumentException("invalid component number " + component + " for field 26T"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -398,7 +392,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field26T(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field270.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field270.java index 326c7dce0..dadfdf439 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field270.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field270.java @@ -32,12 +32,9 @@ import com.prowidesoftware.swift.model.field.DateContainer; import com.prowidesoftware.swift.model.field.DateResolver; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -211,16 +208,14 @@ public String getValueDisplay(int component, Locale locale) { return df.format(cal.getTime()) + " " + tf.format(cal.getTime()); } } - if (component == 2) { - //default format (as is) - return getComponent(2); - } - return null; + // This is the last component, return directly without `if` + //default format (as is) + return getComponent(2); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -445,6 +440,7 @@ public Field270 setLoginBlock(String component2) { * @return the list of converted components (a Calendar object or null) * @since 9.2.7 */ + @Override public List dates() { return DateResolver.dates(this); } @@ -523,7 +519,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field270(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field271.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field271.java index b0d056899..b7a544824 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field271.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field271.java @@ -32,12 +32,9 @@ import com.prowidesoftware.swift.model.field.DateContainer; import com.prowidesoftware.swift.model.field.DateResolver; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -211,16 +208,14 @@ public String getValueDisplay(int component, Locale locale) { return df.format(cal.getTime()) + " " + tf.format(cal.getTime()); } } - if (component == 2) { - //default format (as is) - return getComponent(2); - } - return null; + // This is the last component, return directly without `if` + //default format (as is) + return getComponent(2); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -445,6 +440,7 @@ public Field271 setLogoutBlock(String component2) { * @return the list of converted components (a Calendar object or null) * @since 9.2.7 */ + @Override public List dates() { return DateResolver.dates(this); } @@ -523,7 +519,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field271(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field272.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field272.java index 4c4eded14..ed0451640 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field272.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field272.java @@ -32,12 +32,9 @@ import com.prowidesoftware.swift.model.field.DateContainer; import com.prowidesoftware.swift.model.field.DateResolver; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -211,16 +208,14 @@ public String getValueDisplay(int component, Locale locale) { return df.format(cal.getTime()) + " " + tf.format(cal.getTime()); } } - if (component == 2) { - //default format (as is) - return getComponent(2); - } - return null; + // This is the last component, return directly without `if` + //default format (as is) + return getComponent(2); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -445,6 +440,7 @@ public Field272 setAbort(String component2) { * @return the list of converted components (a Calendar object or null) * @since 9.2.7 */ + @Override public List dates() { return DateResolver.dates(this); } @@ -523,7 +519,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field272(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field280.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field280.java index da52be872..15c64dfec 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field280.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field280.java @@ -31,12 +31,9 @@ import java.util.Calendar; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -235,16 +232,14 @@ public String getValueDisplay(int component, Locale locale) { //default format (as is) return getComponent(3); } - if (component == 4) { - //default format (as is) - return getComponent(4); - } - return null; + // This is the last component, return directly without `if` + //default format (as is) + return getComponent(4); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -687,7 +682,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field280(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field281.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field281.java index 2d7822c9e..04d6dbaf5 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field281.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field281.java @@ -31,12 +31,9 @@ import java.util.Calendar; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -235,16 +232,14 @@ public String getValueDisplay(int component, Locale locale) { //default format (as is) return getComponent(3); } - if (component == 4) { - //default format (as is) - return getComponent(4); - } - return null; + // This is the last component, return directly without `if` + //default format (as is) + return getComponent(4); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -687,7 +682,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field281(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field28C.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field28C.java index 904efdba1..e5f7277ad 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field28C.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field28C.java @@ -31,12 +31,9 @@ import java.math.BigInteger; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -202,16 +199,14 @@ public String getValueDisplay(int component, Locale locale) { //default format (as is) return getComponent(1); } - if (component == 2) { - //default format (as is) - return getComponent(2); - } - return null; + // This is the last component, return directly without `if` + //default format (as is) + return getComponent(2); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -399,32 +394,14 @@ public Field28C setComponent1(String component1) { return this; } - /** - * Set the component1 from a Long object. - *
- * If the component being set is a fixed length number, the argument will not be - * padded. It is recommended for these cases to use the setComponent1(String) - * method. - * - * @see #setComponent1(String) - * @since 9.2.7 - * - * @param component1 the Long with the Statement Number content to set - * @return the field object to enable build pattern - */ - public Field28C setComponent1(java.lang.Long component1) { - setComponent(1, SwiftFormatUtils.getLong(component1)); - return this; - } /** * Alternative method setter for field's Statement Number (component 1) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10 becomes an Integer) * * @param component1 the Number with the Statement Number content to set * @return the field object to enable build pattern - * @see #setStatementNumber(java.lang.Long) */ public Field28C setComponent1(java.lang.Number component1) { @@ -454,27 +431,13 @@ public Field28C setStatementNumber(String component1) { return setComponent1(component1); } - /** - * Set the Statement Number (component 1) from a Long object. - * - * @see #setComponent1(java.lang.Long) - * - * @param component1 Long with the Statement Number content to set - * @return the field object to enable build pattern - * @since 9.2.7 - */ - public Field28C setStatementNumber(java.lang.Long component1) { - return setComponent1(component1); - } - /** * Alternative method setter for field's Statement Number (component 1) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10 becomes an Integer) * * @param component1 the Number with the Statement Number content to set * @return the field object to enable build pattern - * @see #setStatementNumber(java.lang.Long) */ public Field28C setStatementNumber(java.lang.Number component1) { return setComponent1(component1); @@ -491,32 +454,14 @@ public Field28C setComponent2(String component2) { return this; } - /** - * Set the component2 from a Long object. - *
- * If the component being set is a fixed length number, the argument will not be - * padded. It is recommended for these cases to use the setComponent2(String) - * method. - * - * @see #setComponent2(String) - * @since 9.2.7 - * - * @param component2 the Long with the Sequence Number content to set - * @return the field object to enable build pattern - */ - public Field28C setComponent2(java.lang.Long component2) { - setComponent(2, SwiftFormatUtils.getLong(component2)); - return this; - } /** * Alternative method setter for field's Sequence Number (component 2) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10 becomes an Integer) * * @param component2 the Number with the Sequence Number content to set * @return the field object to enable build pattern - * @see #setSequenceNumber(java.lang.Long) */ public Field28C setComponent2(java.lang.Number component2) { @@ -546,27 +491,13 @@ public Field28C setSequenceNumber(String component2) { return setComponent2(component2); } - /** - * Set the Sequence Number (component 2) from a Long object. - * - * @see #setComponent2(java.lang.Long) - * - * @param component2 Long with the Sequence Number content to set - * @return the field object to enable build pattern - * @since 9.2.7 - */ - public Field28C setSequenceNumber(java.lang.Long component2) { - return setComponent2(component2); - } - /** * Alternative method setter for field's Sequence Number (component 2) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10 becomes an Integer) * * @param component2 the Number with the Sequence Number content to set * @return the field object to enable build pattern - * @see #setSequenceNumber(java.lang.Long) */ public Field28C setSequenceNumber(java.lang.Number component2) { return setComponent2(component2); @@ -637,7 +568,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field28C(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field28E.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field28E.java index ef1adfbc0..7d8839cf9 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field28E.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field28E.java @@ -31,12 +31,9 @@ import java.math.BigInteger; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -201,16 +198,14 @@ public String getValueDisplay(int component, Locale locale) { //default format (as is) return getComponent(1); } - if (component == 2) { - //default format (as is) - return getComponent(2); - } - return null; + // This is the last component, return directly without `if` + //default format (as is) + return getComponent(2); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -376,32 +371,14 @@ public Field28E setComponent1(String component1) { return this; } - /** - * Set the component1 from a Long object. - *
- * If the component being set is a fixed length number, the argument will not be - * padded. It is recommended for these cases to use the setComponent1(String) - * method. - * - * @see #setComponent1(String) - * @since 9.2.7 - * - * @param component1 the Long with the Page Number content to set - * @return the field object to enable build pattern - */ - public Field28E setComponent1(java.lang.Long component1) { - setComponent(1, SwiftFormatUtils.getLong(component1)); - return this; - } /** * Alternative method setter for field's Page Number (component 1) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10 becomes an Integer) * * @param component1 the Number with the Page Number content to set * @return the field object to enable build pattern - * @see #setPageNumber(java.lang.Long) */ public Field28E setComponent1(java.lang.Number component1) { @@ -431,27 +408,13 @@ public Field28E setPageNumber(String component1) { return setComponent1(component1); } - /** - * Set the Page Number (component 1) from a Long object. - * - * @see #setComponent1(java.lang.Long) - * - * @param component1 Long with the Page Number content to set - * @return the field object to enable build pattern - * @since 9.2.7 - */ - public Field28E setPageNumber(java.lang.Long component1) { - return setComponent1(component1); - } - /** * Alternative method setter for field's Page Number (component 1) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10 becomes an Integer) * * @param component1 the Number with the Page Number content to set * @return the field object to enable build pattern - * @see #setPageNumber(java.lang.Long) */ public Field28E setPageNumber(java.lang.Number component1) { return setComponent1(component1); @@ -543,7 +506,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field28E(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field29A.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field29A.java index 60c24540c..55defdcdc 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field29A.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field29A.java @@ -30,12 +30,9 @@ import com.prowidesoftware.swift.model.field.MultiLineField; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -246,7 +243,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field29A(f)); } @@ -262,6 +259,7 @@ public static List getAll(final SwiftTagListBlock block) { * @return line content or null if not present or if line number is above the expected * @since 7.7 */ + @Override public String getLine(int line) { return getLine(line, 0); } @@ -275,6 +273,7 @@ public String getLine(int line) { * @return line content or null if not present or if line number is above the expected * @since 7.7 */ + @Override public String getLine(int line, int offset) { Field29A cp = newInstance(this); return getLine(cp, line, null, offset); @@ -287,6 +286,7 @@ public String getLine(int line, int offset) { * @return lines content or empty list if field's value is empty * @since 7.7 */ + @Override public List getLines() { return SwiftParseUtils.getLines(getValue()); } @@ -299,6 +299,7 @@ public List getLines() { * @return found lines or empty list if lines are not present or the offset is invalid * @since 7.7 */ + @Override public List getLines(int offset) { Field29A cp = newInstance(this); return SwiftParseUtils.getLines(getLine(cp, null, null, offset)); @@ -313,6 +314,7 @@ public List getLines(int offset) { * @return found lines or empty list if value is empty * @since 7.7 */ + @Override public List getLinesBetween(int start, int end) { return getLinesBetween(start, end, 0); } @@ -327,6 +329,7 @@ public List getLinesBetween(int start, int end) { * @return found lines or empty list if lines are not present or the offset is invalid * @since 7.7 */ + @Override public List getLinesBetween(int start, int end, int offset) { Field29A cp = newInstance(this); return SwiftParseUtils.getLines(getLine(cp, start, end, offset)); diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field29B.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field29B.java index 126575bbe..e758eda84 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field29B.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field29B.java @@ -30,12 +30,9 @@ import com.prowidesoftware.swift.model.field.MultiLineField; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -203,16 +200,14 @@ public String getValueDisplay(int component, Locale locale) { //default format (as is) return getComponent(3); } - if (component == 4) { - //default format (as is) - return getComponent(4); - } - return null; + // This is the last component, return directly without `if` + //default format (as is) + return getComponent(4); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -584,7 +579,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field29B(f)); } @@ -600,6 +595,7 @@ public static List getAll(final SwiftTagListBlock block) { * @return line content or null if not present or if line number is above the expected * @since 7.7 */ + @Override public String getLine(int line) { return getLine(line, 0); } @@ -613,6 +609,7 @@ public String getLine(int line) { * @return line content or null if not present or if line number is above the expected * @since 7.7 */ + @Override public String getLine(int line, int offset) { Field29B cp = newInstance(this); return getLine(cp, line, null, offset); @@ -625,6 +622,7 @@ public String getLine(int line, int offset) { * @return lines content or empty list if field's value is empty * @since 7.7 */ + @Override public List getLines() { return SwiftParseUtils.getLines(getValue()); } @@ -637,6 +635,7 @@ public List getLines() { * @return found lines or empty list if lines are not present or the offset is invalid * @since 7.7 */ + @Override public List getLines(int offset) { Field29B cp = newInstance(this); return SwiftParseUtils.getLines(getLine(cp, null, null, offset)); @@ -651,6 +650,7 @@ public List getLines(int offset) { * @return found lines or empty list if value is empty * @since 7.7 */ + @Override public List getLinesBetween(int start, int end) { return getLinesBetween(start, end, 0); } @@ -665,6 +665,7 @@ public List getLinesBetween(int start, int end) { * @return found lines or empty list if lines are not present or the offset is invalid * @since 7.7 */ + @Override public List getLinesBetween(int start, int end, int offset) { Field29B cp = newInstance(this); return SwiftParseUtils.getLines(getLine(cp, start, end, offset)); diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field29E.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field29E.java index 639558ad9..1bc780329 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field29E.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field29E.java @@ -30,12 +30,9 @@ import java.util.Calendar; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -200,20 +197,19 @@ public String getValueDisplay(int component, Locale locale) { //default format (as is) return getComponent(1); } - if (component == 2) { - //time: HH[mm] - java.text.DateFormat f = new java.text.SimpleDateFormat("HH:mm", notNull(locale)); - java.util.Calendar cal = getComponent2AsCalendar(); - if (cal != null) { - return f.format(cal.getTime()); - } + // This is the last component, return directly without `if` + //time: HH[mm] + java.text.DateFormat f = new java.text.SimpleDateFormat("HH:mm", notNull(locale)); + java.util.Calendar cal = getComponent2AsCalendar(); + if (cal != null) { + return f.format(cal.getTime()); } return null; } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -496,7 +492,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field29E(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field29H.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field29H.java index dd629e17c..a83d78025 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field29H.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field29H.java @@ -29,12 +29,9 @@ -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -183,19 +180,16 @@ public String getValue() { */ @Override public String getValueDisplay(int component, Locale locale) { - if (component < 1 || component > 1) { + if (component != 1) { throw new IllegalArgumentException("invalid component number " + component + " for field 29H"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -398,7 +392,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field29H(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field29I.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field29I.java index 5159938df..a8ed10310 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field29I.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field29I.java @@ -29,12 +29,9 @@ -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -183,19 +180,16 @@ public String getValue() { */ @Override public String getValueDisplay(int component, Locale locale) { - if (component < 1 || component > 1) { + if (component != 1) { throw new IllegalArgumentException("invalid component number " + component + " for field 29I"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -398,7 +392,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field29I(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field29J.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field29J.java index 806ed56d5..dc7e24646 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field29J.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field29J.java @@ -30,12 +30,9 @@ import java.util.Calendar; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -200,20 +197,19 @@ public String getValueDisplay(int component, Locale locale) { //default format (as is) return getComponent(1); } - if (component == 2) { - //time: HH[mm] - java.text.DateFormat f = new java.text.SimpleDateFormat("HH:mm", notNull(locale)); - java.util.Calendar cal = getComponent2AsCalendar(); - if (cal != null) { - return f.format(cal.getTime()); - } + // This is the last component, return directly without `if` + //time: HH[mm] + java.text.DateFormat f = new java.text.SimpleDateFormat("HH:mm", notNull(locale)); + java.util.Calendar cal = getComponent2AsCalendar(); + if (cal != null) { + return f.format(cal.getTime()); } return null; } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -496,7 +492,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field29J(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field29L.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field29L.java index 6ad4da3ba..4e7c856b0 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field29L.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field29L.java @@ -32,12 +32,9 @@ import com.prowidesoftware.swift.model.field.DateContainer; import com.prowidesoftware.swift.model.field.DateResolver; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -220,20 +217,19 @@ public String getValueDisplay(int component, Locale locale) { //default format (as is) return getComponent(2); } - if (component == 3) { - //time: HH[mm] - java.text.DateFormat f = new java.text.SimpleDateFormat("HH:mm", notNull(locale)); - java.util.Calendar cal = getComponent3AsCalendar(); - if (cal != null) { - return f.format(cal.getTime()); - } + // This is the last component, return directly without `if` + //time: HH[mm] + java.text.DateFormat f = new java.text.SimpleDateFormat("HH:mm", notNull(locale)); + java.util.Calendar cal = getComponent3AsCalendar(); + if (cal != null) { + return f.format(cal.getTime()); } return null; } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -537,6 +533,7 @@ public Field29L setTime(java.util.Calendar component3) { * * @return the list of converted components (a Calendar object or null) */ + @Override public List dates() { return DateResolver.dates(this); } @@ -614,7 +611,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field29L(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field29M.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field29M.java index 13c97a02a..2c7be1c82 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field29M.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field29M.java @@ -30,12 +30,9 @@ import java.util.Calendar; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -200,20 +197,19 @@ public String getValueDisplay(int component, Locale locale) { //default format (as is) return getComponent(1); } - if (component == 2) { - //time: HH[mm] - java.text.DateFormat f = new java.text.SimpleDateFormat("HH:mm", notNull(locale)); - java.util.Calendar cal = getComponent2AsCalendar(); - if (cal != null) { - return f.format(cal.getTime()); - } + // This is the last component, return directly without `if` + //time: HH[mm] + java.text.DateFormat f = new java.text.SimpleDateFormat("HH:mm", notNull(locale)); + java.util.Calendar cal = getComponent2AsCalendar(); + if (cal != null) { + return f.format(cal.getTime()); } return null; } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -496,7 +492,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field29M(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field29N.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field29N.java index 0dff3444c..2c63a5258 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field29N.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field29N.java @@ -32,12 +32,9 @@ import com.prowidesoftware.swift.model.field.DateContainer; import com.prowidesoftware.swift.model.field.DateResolver; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -220,20 +217,19 @@ public String getValueDisplay(int component, Locale locale) { //default format (as is) return getComponent(2); } - if (component == 3) { - //time: HH[mm] - java.text.DateFormat f = new java.text.SimpleDateFormat("HH:mm", notNull(locale)); - java.util.Calendar cal = getComponent3AsCalendar(); - if (cal != null) { - return f.format(cal.getTime()); - } + // This is the last component, return directly without `if` + //time: HH[mm] + java.text.DateFormat f = new java.text.SimpleDateFormat("HH:mm", notNull(locale)); + java.util.Calendar cal = getComponent3AsCalendar(); + if (cal != null) { + return f.format(cal.getTime()); } return null; } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -537,6 +533,7 @@ public Field29N setTime(java.util.Calendar component3) { * * @return the list of converted components (a Calendar object or null) */ + @Override public List dates() { return DateResolver.dates(this); } @@ -614,7 +611,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field29N(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field29O.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field29O.java index 3d11e7908..e953ac0e9 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field29O.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field29O.java @@ -30,12 +30,9 @@ import java.util.Calendar; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -226,20 +223,19 @@ public String getValueDisplay(int component, Locale locale) { return f.format(cal.getTime()); } } - if (component == 3) { - //time: HH[mm] - java.text.DateFormat f = new java.text.SimpleDateFormat("HH:mm", notNull(locale)); - java.util.Calendar cal = getComponent3AsCalendar(); - if (cal != null) { - return f.format(cal.getTime()); - } + // This is the last component, return directly without `if` + //time: HH[mm] + java.text.DateFormat f = new java.text.SimpleDateFormat("HH:mm", notNull(locale)); + java.util.Calendar cal = getComponent3AsCalendar(); + if (cal != null) { + return f.format(cal.getTime()); } return null; } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -602,7 +598,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field29O(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field30.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field30.java index c13be3c74..4e3dd5247 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field30.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field30.java @@ -32,12 +32,9 @@ import com.prowidesoftware.swift.model.field.DateContainer; import com.prowidesoftware.swift.model.field.DateResolver; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -186,23 +183,21 @@ public String getValue() { */ @Override public String getValueDisplay(int component, Locale locale) { - if (component < 1 || component > 1) { + if (component != 1) { throw new IllegalArgumentException("invalid component number " + component + " for field 30"); } - if (component == 1) { - //date: [YY]YYMMDD - java.text.DateFormat f = java.text.DateFormat.getDateInstance(java.text.DateFormat.DEFAULT, notNull(locale)); - java.util.Calendar cal = getComponent1AsCalendar(); - if (cal != null) { - return f.format(cal.getTime()); - } + //date: [YY]YYMMDD + java.text.DateFormat f = java.text.DateFormat.getDateInstance(java.text.DateFormat.DEFAULT, notNull(locale)); + java.util.Calendar cal = getComponent1AsCalendar(); + if (cal != null) { + return f.format(cal.getTime()); } return null; } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -386,6 +381,7 @@ public Field30 setDate(java.util.Calendar component1) { * * @return the list of converted components (a Calendar object or null) */ + @Override public List dates() { return DateResolver.dates(this); } @@ -463,7 +459,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field30(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field301.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field301.java index f230a2436..566821b2d 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field301.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field301.java @@ -29,12 +29,9 @@ -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -183,19 +180,16 @@ public String getValue() { */ @Override public String getValueDisplay(int component, Locale locale) { - if (component < 1 || component > 1) { + if (component != 1) { throw new IllegalArgumentException("invalid component number " + component + " for field 301"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -398,7 +392,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field301(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field302.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field302.java index 82dc050b3..bc1b243e2 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field302.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field302.java @@ -29,12 +29,9 @@ -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -183,19 +180,16 @@ public String getValue() { */ @Override public String getValueDisplay(int component, Locale locale) { - if (component < 1 || component > 1) { + if (component != 1) { throw new IllegalArgumentException("invalid component number " + component + " for field 302"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -438,7 +432,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field302(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field303.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field303.java index 6dcda489c..c5c6c1c94 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field303.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field303.java @@ -29,12 +29,9 @@ -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -183,19 +180,16 @@ public String getValue() { */ @Override public String getValueDisplay(int component, Locale locale) { - if (component < 1 || component > 1) { + if (component != 1) { throw new IllegalArgumentException("invalid component number " + component + " for field 303"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -398,7 +392,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field303(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field304.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field304.java index 53c91fd40..da5815c48 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field304.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field304.java @@ -29,12 +29,9 @@ -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -201,16 +198,14 @@ public String getValueDisplay(int component, Locale locale) { //default format (as is) return getComponent(1); } - if (component == 2) { - //default format (as is) - return getComponent(2); - } - return null; + // This is the last component, return directly without `if` + //default format (as is) + return getComponent(2); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -453,7 +448,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field304(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field305.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field305.java index e05c2fb20..a72304d27 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field305.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field305.java @@ -29,12 +29,9 @@ -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -183,19 +180,16 @@ public String getValue() { */ @Override public String getValueDisplay(int component, Locale locale) { - if (component < 1 || component > 1) { + if (component != 1) { throw new IllegalArgumentException("invalid component number " + component + " for field 305"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -398,7 +392,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field305(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field307.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field307.java index d12ca905e..d6cc3a5a0 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field307.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field307.java @@ -29,12 +29,9 @@ -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -183,19 +180,16 @@ public String getValue() { */ @Override public String getValueDisplay(int component, Locale locale) { - if (component < 1 || component > 1) { + if (component != 1) { throw new IllegalArgumentException("invalid component number " + component + " for field 307"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -398,7 +392,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field307(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field30F.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field30F.java index c5218ce00..a89148004 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field30F.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field30F.java @@ -32,12 +32,9 @@ import com.prowidesoftware.swift.model.field.DateContainer; import com.prowidesoftware.swift.model.field.DateResolver; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -186,23 +183,21 @@ public String getValue() { */ @Override public String getValueDisplay(int component, Locale locale) { - if (component < 1 || component > 1) { + if (component != 1) { throw new IllegalArgumentException("invalid component number " + component + " for field 30F"); } - if (component == 1) { - //date: [YY]YYMMDD - java.text.DateFormat f = java.text.DateFormat.getDateInstance(java.text.DateFormat.DEFAULT, notNull(locale)); - java.util.Calendar cal = getComponent1AsCalendar(); - if (cal != null) { - return f.format(cal.getTime()); - } + //date: [YY]YYMMDD + java.text.DateFormat f = java.text.DateFormat.getDateInstance(java.text.DateFormat.DEFAULT, notNull(locale)); + java.util.Calendar cal = getComponent1AsCalendar(); + if (cal != null) { + return f.format(cal.getTime()); } return null; } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -386,6 +381,7 @@ public Field30F setDate(java.util.Calendar component1) { * * @return the list of converted components (a Calendar object or null) */ + @Override public List dates() { return DateResolver.dates(this); } @@ -463,7 +459,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field30F(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field30G.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field30G.java index f66949517..631e3ab7c 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field30G.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field30G.java @@ -32,12 +32,9 @@ import com.prowidesoftware.swift.model.field.DateContainer; import com.prowidesoftware.swift.model.field.DateResolver; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -218,20 +215,19 @@ public String getValueDisplay(int component, Locale locale) { return f.format(cal.getTime()); } } - if (component == 2) { - //date: [YY]YYMMDD - java.text.DateFormat f = java.text.DateFormat.getDateInstance(java.text.DateFormat.DEFAULT, notNull(locale)); - java.util.Calendar cal = getComponent2AsCalendar(); - if (cal != null) { - return f.format(cal.getTime()); - } + // This is the last component, return directly without `if` + //date: [YY]YYMMDD + java.text.DateFormat f = java.text.DateFormat.getDateInstance(java.text.DateFormat.DEFAULT, notNull(locale)); + java.util.Calendar cal = getComponent2AsCalendar(); + if (cal != null) { + return f.format(cal.getTime()); } return null; } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -545,6 +541,7 @@ public Field30G setPeriodEndDate(java.util.Calendar component2) { * * @return the list of converted components (a Calendar object or null) */ + @Override public List dates() { return DateResolver.dates(this); } @@ -622,7 +619,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field30G(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field30H.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field30H.java index fa3c4b6f0..f6eeb8129 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field30H.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field30H.java @@ -32,12 +32,9 @@ import com.prowidesoftware.swift.model.field.DateContainer; import com.prowidesoftware.swift.model.field.DateResolver; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -186,23 +183,21 @@ public String getValue() { */ @Override public String getValueDisplay(int component, Locale locale) { - if (component < 1 || component > 1) { + if (component != 1) { throw new IllegalArgumentException("invalid component number " + component + " for field 30H"); } - if (component == 1) { - //date: [YY]YYMMDD - java.text.DateFormat f = java.text.DateFormat.getDateInstance(java.text.DateFormat.DEFAULT, notNull(locale)); - java.util.Calendar cal = getComponent1AsCalendar(); - if (cal != null) { - return f.format(cal.getTime()); - } + //date: [YY]YYMMDD + java.text.DateFormat f = java.text.DateFormat.getDateInstance(java.text.DateFormat.DEFAULT, notNull(locale)); + java.util.Calendar cal = getComponent1AsCalendar(); + if (cal != null) { + return f.format(cal.getTime()); } return null; } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -386,6 +381,7 @@ public Field30H setDate(java.util.Calendar component1) { * * @return the list of converted components (a Calendar object or null) */ + @Override public List dates() { return DateResolver.dates(this); } @@ -463,7 +459,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field30H(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field30I.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field30I.java index 549c54a18..f5892883a 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field30I.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field30I.java @@ -32,12 +32,9 @@ import com.prowidesoftware.swift.model.field.DateContainer; import com.prowidesoftware.swift.model.field.DateResolver; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -208,20 +205,19 @@ public String getValueDisplay(int component, Locale locale) { return f.format(cal.getTime()); } } - if (component == 2) { - //date: [YY]YYMMDD - java.text.DateFormat f = java.text.DateFormat.getDateInstance(java.text.DateFormat.DEFAULT, notNull(locale)); - java.util.Calendar cal = getComponent2AsCalendar(); - if (cal != null) { - return f.format(cal.getTime()); - } + // This is the last component, return directly without `if` + //date: [YY]YYMMDD + java.text.DateFormat f = java.text.DateFormat.getDateInstance(java.text.DateFormat.DEFAULT, notNull(locale)); + java.util.Calendar cal = getComponent2AsCalendar(); + if (cal != null) { + return f.format(cal.getTime()); } return null; } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -488,6 +484,7 @@ public Field30I setEndDate(java.util.Calendar component2) { * * @return the list of converted components (a Calendar object or null) */ + @Override public List dates() { return DateResolver.dates(this); } @@ -565,7 +562,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field30I(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field30J.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field30J.java index 183295295..f84da2975 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field30J.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field30J.java @@ -31,12 +31,9 @@ import java.math.BigInteger; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -199,16 +196,14 @@ public String getValueDisplay(int component, Locale locale) { //default format (as is) return getComponent(1); } - if (component == 2) { - //default format (as is) - return getComponent(2); - } - return null; + // This is the last component, return directly without `if` + //default format (as is) + return getComponent(2); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -395,32 +390,14 @@ public Field30J setComponent2(String component2) { return this; } - /** - * Set the component2 from a Long object. - *
- * If the component being set is a fixed length number, the argument will not be - * padded. It is recommended for these cases to use the setComponent2(String) - * method. - * - * @see #setComponent2(String) - * @since 9.2.7 - * - * @param component2 the Long with the Number content to set - * @return the field object to enable build pattern - */ - public Field30J setComponent2(java.lang.Long component2) { - setComponent(2, SwiftFormatUtils.getLong(component2)); - return this; - } /** * Alternative method setter for field's Number (component 2) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10 becomes an Integer) * * @param component2 the Number with the Number content to set * @return the field object to enable build pattern - * @see #setNumber(java.lang.Long) */ public Field30J setComponent2(java.lang.Number component2) { @@ -450,27 +427,13 @@ public Field30J setNumber(String component2) { return setComponent2(component2); } - /** - * Set the Number (component 2) from a Long object. - * - * @see #setComponent2(java.lang.Long) - * - * @param component2 Long with the Number content to set - * @return the field object to enable build pattern - * @since 9.2.7 - */ - public Field30J setNumber(java.lang.Long component2) { - return setComponent2(component2); - } - /** * Alternative method setter for field's Number (component 2) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10 becomes an Integer) * * @param component2 the Number with the Number content to set * @return the field object to enable build pattern - * @see #setNumber(java.lang.Long) */ public Field30J setNumber(java.lang.Number component2) { return setComponent2(component2); @@ -541,7 +504,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field30J(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field30M.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field30M.java index a8230b5ae..63b63449c 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field30M.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field30M.java @@ -32,12 +32,9 @@ import com.prowidesoftware.swift.model.field.DateContainer; import com.prowidesoftware.swift.model.field.DateResolver; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -186,23 +183,21 @@ public String getValue() { */ @Override public String getValueDisplay(int component, Locale locale) { - if (component < 1 || component > 1) { + if (component != 1) { throw new IllegalArgumentException("invalid component number " + component + " for field 30M"); } - if (component == 1) { - //date: [YY]YYMMDD - java.text.DateFormat f = java.text.DateFormat.getDateInstance(java.text.DateFormat.DEFAULT, notNull(locale)); - java.util.Calendar cal = getComponent1AsCalendar(); - if (cal != null) { - return f.format(cal.getTime()); - } + //date: [YY]YYMMDD + java.text.DateFormat f = java.text.DateFormat.getDateInstance(java.text.DateFormat.DEFAULT, notNull(locale)); + java.util.Calendar cal = getComponent1AsCalendar(); + if (cal != null) { + return f.format(cal.getTime()); } return null; } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -386,6 +381,7 @@ public Field30M setDate(java.util.Calendar component1) { * * @return the list of converted components (a Calendar object or null) */ + @Override public List dates() { return DateResolver.dates(this); } @@ -463,7 +459,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field30M(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field30N.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field30N.java index 86d8efdbd..c60e8be88 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field30N.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field30N.java @@ -32,12 +32,9 @@ import com.prowidesoftware.swift.model.field.DateContainer; import com.prowidesoftware.swift.model.field.DateResolver; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -186,23 +183,21 @@ public String getValue() { */ @Override public String getValueDisplay(int component, Locale locale) { - if (component < 1 || component > 1) { + if (component != 1) { throw new IllegalArgumentException("invalid component number " + component + " for field 30N"); } - if (component == 1) { - //date: [YY]YYMMDD - java.text.DateFormat f = java.text.DateFormat.getDateInstance(java.text.DateFormat.DEFAULT, notNull(locale)); - java.util.Calendar cal = getComponent1AsCalendar(); - if (cal != null) { - return f.format(cal.getTime()); - } + //date: [YY]YYMMDD + java.text.DateFormat f = java.text.DateFormat.getDateInstance(java.text.DateFormat.DEFAULT, notNull(locale)); + java.util.Calendar cal = getComponent1AsCalendar(); + if (cal != null) { + return f.format(cal.getTime()); } return null; } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -386,6 +381,7 @@ public Field30N setDate(java.util.Calendar component1) { * * @return the list of converted components (a Calendar object or null) */ + @Override public List dates() { return DateResolver.dates(this); } @@ -463,7 +459,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field30N(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field30P.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field30P.java index 5b5013728..7e4a4734c 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field30P.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field30P.java @@ -32,12 +32,9 @@ import com.prowidesoftware.swift.model.field.DateContainer; import com.prowidesoftware.swift.model.field.DateResolver; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -186,23 +183,21 @@ public String getValue() { */ @Override public String getValueDisplay(int component, Locale locale) { - if (component < 1 || component > 1) { + if (component != 1) { throw new IllegalArgumentException("invalid component number " + component + " for field 30P"); } - if (component == 1) { - //date: [YY]YYMMDD - java.text.DateFormat f = java.text.DateFormat.getDateInstance(java.text.DateFormat.DEFAULT, notNull(locale)); - java.util.Calendar cal = getComponent1AsCalendar(); - if (cal != null) { - return f.format(cal.getTime()); - } + //date: [YY]YYMMDD + java.text.DateFormat f = java.text.DateFormat.getDateInstance(java.text.DateFormat.DEFAULT, notNull(locale)); + java.util.Calendar cal = getComponent1AsCalendar(); + if (cal != null) { + return f.format(cal.getTime()); } return null; } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -386,6 +381,7 @@ public Field30P setDate(java.util.Calendar component1) { * * @return the list of converted components (a Calendar object or null) */ + @Override public List dates() { return DateResolver.dates(this); } @@ -463,7 +459,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field30P(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field30Q.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field30Q.java index edab8d443..f5d3d02ba 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field30Q.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field30Q.java @@ -32,12 +32,9 @@ import com.prowidesoftware.swift.model.field.DateContainer; import com.prowidesoftware.swift.model.field.DateResolver; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -186,23 +183,21 @@ public String getValue() { */ @Override public String getValueDisplay(int component, Locale locale) { - if (component < 1 || component > 1) { + if (component != 1) { throw new IllegalArgumentException("invalid component number " + component + " for field 30Q"); } - if (component == 1) { - //date: [YY]YYMMDD - java.text.DateFormat f = java.text.DateFormat.getDateInstance(java.text.DateFormat.DEFAULT, notNull(locale)); - java.util.Calendar cal = getComponent1AsCalendar(); - if (cal != null) { - return f.format(cal.getTime()); - } + //date: [YY]YYMMDD + java.text.DateFormat f = java.text.DateFormat.getDateInstance(java.text.DateFormat.DEFAULT, notNull(locale)); + java.util.Calendar cal = getComponent1AsCalendar(); + if (cal != null) { + return f.format(cal.getTime()); } return null; } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -386,6 +381,7 @@ public Field30Q setDate(java.util.Calendar component1) { * * @return the list of converted components (a Calendar object or null) */ + @Override public List dates() { return DateResolver.dates(this); } @@ -463,7 +459,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field30Q(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field30S.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field30S.java index f7ff6631e..23ab3395f 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field30S.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field30S.java @@ -32,12 +32,9 @@ import com.prowidesoftware.swift.model.field.DateContainer; import com.prowidesoftware.swift.model.field.DateResolver; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -186,23 +183,21 @@ public String getValue() { */ @Override public String getValueDisplay(int component, Locale locale) { - if (component < 1 || component > 1) { + if (component != 1) { throw new IllegalArgumentException("invalid component number " + component + " for field 30S"); } - if (component == 1) { - //date: [YY]YYMMDD - java.text.DateFormat f = java.text.DateFormat.getDateInstance(java.text.DateFormat.DEFAULT, notNull(locale)); - java.util.Calendar cal = getComponent1AsCalendar(); - if (cal != null) { - return f.format(cal.getTime()); - } + //date: [YY]YYMMDD + java.text.DateFormat f = java.text.DateFormat.getDateInstance(java.text.DateFormat.DEFAULT, notNull(locale)); + java.util.Calendar cal = getComponent1AsCalendar(); + if (cal != null) { + return f.format(cal.getTime()); } return null; } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -386,6 +381,7 @@ public Field30S setDate(java.util.Calendar component1) { * * @return the list of converted components (a Calendar object or null) */ + @Override public List dates() { return DateResolver.dates(this); } @@ -463,7 +459,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field30S(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field30T.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field30T.java index 03623f395..fd4a12539 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field30T.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field30T.java @@ -32,12 +32,9 @@ import com.prowidesoftware.swift.model.field.DateContainer; import com.prowidesoftware.swift.model.field.DateResolver; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -186,23 +183,21 @@ public String getValue() { */ @Override public String getValueDisplay(int component, Locale locale) { - if (component < 1 || component > 1) { + if (component != 1) { throw new IllegalArgumentException("invalid component number " + component + " for field 30T"); } - if (component == 1) { - //date: [YY]YYMMDD - java.text.DateFormat f = java.text.DateFormat.getDateInstance(java.text.DateFormat.DEFAULT, notNull(locale)); - java.util.Calendar cal = getComponent1AsCalendar(); - if (cal != null) { - return f.format(cal.getTime()); - } + //date: [YY]YYMMDD + java.text.DateFormat f = java.text.DateFormat.getDateInstance(java.text.DateFormat.DEFAULT, notNull(locale)); + java.util.Calendar cal = getComponent1AsCalendar(); + if (cal != null) { + return f.format(cal.getTime()); } return null; } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -386,6 +381,7 @@ public Field30T setDate(java.util.Calendar component1) { * * @return the list of converted components (a Calendar object or null) */ + @Override public List dates() { return DateResolver.dates(this); } @@ -463,7 +459,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field30T(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field30U.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field30U.java index e0418ff03..5088f6a43 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field30U.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field30U.java @@ -32,12 +32,9 @@ import com.prowidesoftware.swift.model.field.DateContainer; import com.prowidesoftware.swift.model.field.DateResolver; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -186,23 +183,21 @@ public String getValue() { */ @Override public String getValueDisplay(int component, Locale locale) { - if (component < 1 || component > 1) { + if (component != 1) { throw new IllegalArgumentException("invalid component number " + component + " for field 30U"); } - if (component == 1) { - //date: [YY]YYMMDD - java.text.DateFormat f = java.text.DateFormat.getDateInstance(java.text.DateFormat.DEFAULT, notNull(locale)); - java.util.Calendar cal = getComponent1AsCalendar(); - if (cal != null) { - return f.format(cal.getTime()); - } + //date: [YY]YYMMDD + java.text.DateFormat f = java.text.DateFormat.getDateInstance(java.text.DateFormat.DEFAULT, notNull(locale)); + java.util.Calendar cal = getComponent1AsCalendar(); + if (cal != null) { + return f.format(cal.getTime()); } return null; } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -386,6 +381,7 @@ public Field30U setDate(java.util.Calendar component1) { * * @return the list of converted components (a Calendar object or null) */ + @Override public List dates() { return DateResolver.dates(this); } @@ -463,7 +459,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field30U(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field30V.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field30V.java index 31173dc95..e0cf7ccf7 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field30V.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field30V.java @@ -32,12 +32,9 @@ import com.prowidesoftware.swift.model.field.DateContainer; import com.prowidesoftware.swift.model.field.DateResolver; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -186,23 +183,21 @@ public String getValue() { */ @Override public String getValueDisplay(int component, Locale locale) { - if (component < 1 || component > 1) { + if (component != 1) { throw new IllegalArgumentException("invalid component number " + component + " for field 30V"); } - if (component == 1) { - //date: [YY]YYMMDD - java.text.DateFormat f = java.text.DateFormat.getDateInstance(java.text.DateFormat.DEFAULT, notNull(locale)); - java.util.Calendar cal = getComponent1AsCalendar(); - if (cal != null) { - return f.format(cal.getTime()); - } + //date: [YY]YYMMDD + java.text.DateFormat f = java.text.DateFormat.getDateInstance(java.text.DateFormat.DEFAULT, notNull(locale)); + java.util.Calendar cal = getComponent1AsCalendar(); + if (cal != null) { + return f.format(cal.getTime()); } return null; } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -386,6 +381,7 @@ public Field30V setDate(java.util.Calendar component1) { * * @return the list of converted components (a Calendar object or null) */ + @Override public List dates() { return DateResolver.dates(this); } @@ -463,7 +459,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field30V(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field30X.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field30X.java index be075b6fc..f5c43a5de 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field30X.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field30X.java @@ -32,12 +32,9 @@ import com.prowidesoftware.swift.model.field.DateContainer; import com.prowidesoftware.swift.model.field.DateResolver; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -186,23 +183,21 @@ public String getValue() { */ @Override public String getValueDisplay(int component, Locale locale) { - if (component < 1 || component > 1) { + if (component != 1) { throw new IllegalArgumentException("invalid component number " + component + " for field 30X"); } - if (component == 1) { - //date: [YY]YYMMDD - java.text.DateFormat f = java.text.DateFormat.getDateInstance(java.text.DateFormat.DEFAULT, notNull(locale)); - java.util.Calendar cal = getComponent1AsCalendar(); - if (cal != null) { - return f.format(cal.getTime()); - } + //date: [YY]YYMMDD + java.text.DateFormat f = java.text.DateFormat.getDateInstance(java.text.DateFormat.DEFAULT, notNull(locale)); + java.util.Calendar cal = getComponent1AsCalendar(); + if (cal != null) { + return f.format(cal.getTime()); } return null; } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -386,6 +381,7 @@ public Field30X setDate(java.util.Calendar component1) { * * @return the list of converted components (a Calendar object or null) */ + @Override public List dates() { return DateResolver.dates(this); } @@ -463,7 +459,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field30X(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field30Y.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field30Y.java index 9e5b7dd15..8d232df02 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field30Y.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field30Y.java @@ -32,12 +32,9 @@ import com.prowidesoftware.swift.model.field.DateContainer; import com.prowidesoftware.swift.model.field.DateResolver; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -186,23 +183,21 @@ public String getValue() { */ @Override public String getValueDisplay(int component, Locale locale) { - if (component < 1 || component > 1) { + if (component != 1) { throw new IllegalArgumentException("invalid component number " + component + " for field 30Y"); } - if (component == 1) { - //date: [YY]YYMMDD - java.text.DateFormat f = java.text.DateFormat.getDateInstance(java.text.DateFormat.DEFAULT, notNull(locale)); - java.util.Calendar cal = getComponent1AsCalendar(); - if (cal != null) { - return f.format(cal.getTime()); - } + //date: [YY]YYMMDD + java.text.DateFormat f = java.text.DateFormat.getDateInstance(java.text.DateFormat.DEFAULT, notNull(locale)); + java.util.Calendar cal = getComponent1AsCalendar(); + if (cal != null) { + return f.format(cal.getTime()); } return null; } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -386,6 +381,7 @@ public Field30Y setDate(java.util.Calendar component1) { * * @return the list of converted components (a Calendar object or null) */ + @Override public List dates() { return DateResolver.dates(this); } @@ -463,7 +459,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field30Y(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field30Z.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field30Z.java index 58f3ad6bc..d4a139560 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field30Z.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field30Z.java @@ -32,12 +32,9 @@ import com.prowidesoftware.swift.model.field.DateContainer; import com.prowidesoftware.swift.model.field.DateResolver; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -186,23 +183,21 @@ public String getValue() { */ @Override public String getValueDisplay(int component, Locale locale) { - if (component < 1 || component > 1) { + if (component != 1) { throw new IllegalArgumentException("invalid component number " + component + " for field 30Z"); } - if (component == 1) { - //date: [YY]YYMMDD - java.text.DateFormat f = java.text.DateFormat.getDateInstance(java.text.DateFormat.DEFAULT, notNull(locale)); - java.util.Calendar cal = getComponent1AsCalendar(); - if (cal != null) { - return f.format(cal.getTime()); - } + //date: [YY]YYMMDD + java.text.DateFormat f = java.text.DateFormat.getDateInstance(java.text.DateFormat.DEFAULT, notNull(locale)); + java.util.Calendar cal = getComponent1AsCalendar(); + if (cal != null) { + return f.format(cal.getTime()); } return null; } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -386,6 +381,7 @@ public Field30Z setDate(java.util.Calendar component1) { * * @return the list of converted components (a Calendar object or null) */ + @Override public List dates() { return DateResolver.dates(this); } @@ -463,7 +459,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field30Z(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field311.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field311.java index caee66187..82ad44def 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field311.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field311.java @@ -29,12 +29,9 @@ -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -183,19 +180,16 @@ public String getValue() { */ @Override public String getValueDisplay(int component, Locale locale) { - if (component < 1 || component > 1) { + if (component != 1) { throw new IllegalArgumentException("invalid component number " + component + " for field 311"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -398,7 +392,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field311(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field312.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field312.java index ca3a39b48..c79d469de 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field312.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field312.java @@ -29,12 +29,9 @@ -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -183,19 +180,16 @@ public String getValue() { */ @Override public String getValueDisplay(int component, Locale locale) { - if (component < 1 || component > 1) { + if (component != 1) { throw new IllegalArgumentException("invalid component number " + component + " for field 312"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -398,7 +392,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field312(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field313.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field313.java index 7cd775cc5..5b2183294 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field313.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field313.java @@ -31,12 +31,9 @@ import java.math.BigInteger; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -185,19 +182,16 @@ public String getValue() { */ @Override public String getValueDisplay(int component, Locale locale) { - if (component < 1 || component > 1) { + if (component != 1) { throw new IllegalArgumentException("invalid component number " + component + " for field 313"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -344,32 +338,14 @@ public Field313 setComponent1(String component1) { return this; } - /** - * Set the component1 from a Long object. - *
- * If the component being set is a fixed length number, the argument will not be - * padded. It is recommended for these cases to use the setComponent1(String) - * method. - * - * @see #setComponent1(String) - * @since 9.2.7 - * - * @param component1 the Long with the Count content to set - * @return the field object to enable build pattern - */ - public Field313 setComponent1(java.lang.Long component1) { - setComponent(1, SwiftFormatUtils.getLong(component1)); - return this; - } /** * Alternative method setter for field's Count (component 1) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10 becomes an Integer) * * @param component1 the Number with the Count content to set * @return the field object to enable build pattern - * @see #setCount(java.lang.Long) */ public Field313 setComponent1(java.lang.Number component1) { @@ -399,27 +375,13 @@ public Field313 setCount(String component1) { return setComponent1(component1); } - /** - * Set the Count (component 1) from a Long object. - * - * @see #setComponent1(java.lang.Long) - * - * @param component1 Long with the Count content to set - * @return the field object to enable build pattern - * @since 9.2.7 - */ - public Field313 setCount(java.lang.Long component1) { - return setComponent1(component1); - } - /** * Alternative method setter for field's Count (component 1) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10 becomes an Integer) * * @param component1 the Number with the Count content to set * @return the field object to enable build pattern - * @see #setCount(java.lang.Long) */ public Field313 setCount(java.lang.Number component1) { return setComponent1(component1); @@ -490,7 +452,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field313(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field31C.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field31C.java index d315b3c73..2360921a2 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field31C.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field31C.java @@ -32,12 +32,9 @@ import com.prowidesoftware.swift.model.field.DateContainer; import com.prowidesoftware.swift.model.field.DateResolver; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -186,23 +183,21 @@ public String getValue() { */ @Override public String getValueDisplay(int component, Locale locale) { - if (component < 1 || component > 1) { + if (component != 1) { throw new IllegalArgumentException("invalid component number " + component + " for field 31C"); } - if (component == 1) { - //date: [YY]YYMMDD - java.text.DateFormat f = java.text.DateFormat.getDateInstance(java.text.DateFormat.DEFAULT, notNull(locale)); - java.util.Calendar cal = getComponent1AsCalendar(); - if (cal != null) { - return f.format(cal.getTime()); - } + //date: [YY]YYMMDD + java.text.DateFormat f = java.text.DateFormat.getDateInstance(java.text.DateFormat.DEFAULT, notNull(locale)); + java.util.Calendar cal = getComponent1AsCalendar(); + if (cal != null) { + return f.format(cal.getTime()); } return null; } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -386,6 +381,7 @@ public Field31C setDate(java.util.Calendar component1) { * * @return the list of converted components (a Calendar object or null) */ + @Override public List dates() { return DateResolver.dates(this); } @@ -463,7 +459,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field31C(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field31D.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field31D.java index 8b708a000..f9adf0021 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field31D.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field31D.java @@ -32,12 +32,9 @@ import com.prowidesoftware.swift.model.field.DateContainer; import com.prowidesoftware.swift.model.field.DateResolver; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -210,16 +207,14 @@ public String getValueDisplay(int component, Locale locale) { return f.format(cal.getTime()); } } - if (component == 2) { - //default format (as is) - return getComponent(2); - } - return null; + // This is the last component, return directly without `if` + //default format (as is) + return getComponent(2); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -443,6 +438,7 @@ public Field31D setPlace(String component2) { * * @return the list of converted components (a Calendar object or null) */ + @Override public List dates() { return DateResolver.dates(this); } @@ -520,7 +516,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field31D(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field31E.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field31E.java index 9baf70449..ff5698f0d 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field31E.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field31E.java @@ -32,12 +32,9 @@ import com.prowidesoftware.swift.model.field.DateContainer; import com.prowidesoftware.swift.model.field.DateResolver; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -186,23 +183,21 @@ public String getValue() { */ @Override public String getValueDisplay(int component, Locale locale) { - if (component < 1 || component > 1) { + if (component != 1) { throw new IllegalArgumentException("invalid component number " + component + " for field 31E"); } - if (component == 1) { - //date: [YY]YYMMDD - java.text.DateFormat f = java.text.DateFormat.getDateInstance(java.text.DateFormat.DEFAULT, notNull(locale)); - java.util.Calendar cal = getComponent1AsCalendar(); - if (cal != null) { - return f.format(cal.getTime()); - } + //date: [YY]YYMMDD + java.text.DateFormat f = java.text.DateFormat.getDateInstance(java.text.DateFormat.DEFAULT, notNull(locale)); + java.util.Calendar cal = getComponent1AsCalendar(); + if (cal != null) { + return f.format(cal.getTime()); } return null; } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -386,6 +381,7 @@ public Field31E setDate(java.util.Calendar component1) { * * @return the list of converted components (a Calendar object or null) */ + @Override public List dates() { return DateResolver.dates(this); } @@ -463,7 +459,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field31E(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field31F.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field31F.java index 6fea2e0ba..16cd68167 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field31F.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field31F.java @@ -32,12 +32,9 @@ import com.prowidesoftware.swift.model.field.DateContainer; import com.prowidesoftware.swift.model.field.DateResolver; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -226,16 +223,14 @@ public String getValueDisplay(int component, Locale locale) { return f.format(cal.getTime()); } } - if (component == 3) { - //default format (as is) - return getComponent(3); - } - return null; + // This is the last component, return directly without `if` + //default format (as is) + return getComponent(3); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -545,6 +540,7 @@ public Field31F setPeriodDetails(String component3) { * * @return the list of converted components (a Calendar object or null) */ + @Override public List dates() { return DateResolver.dates(this); } @@ -622,7 +618,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field31F(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field31G.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field31G.java index 8ab43a772..823c3f94e 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field31G.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field31G.java @@ -32,12 +32,9 @@ import com.prowidesoftware.swift.model.field.DateContainer; import com.prowidesoftware.swift.model.field.DateResolver; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -223,16 +220,14 @@ public String getValueDisplay(int component, Locale locale) { return f.format(cal.getTime()); } } - if (component == 3) { - //default format (as is) - return getComponent(3); - } - return null; + // This is the last component, return directly without `if` + //default format (as is) + return getComponent(3); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -536,6 +531,7 @@ public Field31G setLocation(String component3) { * * @return the list of converted components (a Calendar object or null) */ + @Override public List dates() { return DateResolver.dates(this); } @@ -613,7 +609,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field31G(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field31L.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field31L.java index 92b57b9b5..7c9885886 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field31L.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field31L.java @@ -32,12 +32,9 @@ import com.prowidesoftware.swift.model.field.DateContainer; import com.prowidesoftware.swift.model.field.DateResolver; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -186,23 +183,21 @@ public String getValue() { */ @Override public String getValueDisplay(int component, Locale locale) { - if (component < 1 || component > 1) { + if (component != 1) { throw new IllegalArgumentException("invalid component number " + component + " for field 31L"); } - if (component == 1) { - //date: [YY]YYMMDD - java.text.DateFormat f = java.text.DateFormat.getDateInstance(java.text.DateFormat.DEFAULT, notNull(locale)); - java.util.Calendar cal = getComponent1AsCalendar(); - if (cal != null) { - return f.format(cal.getTime()); - } + //date: [YY]YYMMDD + java.text.DateFormat f = java.text.DateFormat.getDateInstance(java.text.DateFormat.DEFAULT, notNull(locale)); + java.util.Calendar cal = getComponent1AsCalendar(); + if (cal != null) { + return f.format(cal.getTime()); } return null; } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -386,6 +381,7 @@ public Field31L setDate(java.util.Calendar component1) { * * @return the list of converted components (a Calendar object or null) */ + @Override public List dates() { return DateResolver.dates(this); } @@ -463,7 +459,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field31L(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field31P.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field31P.java index 3bcc30c45..2a350b4e7 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field31P.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field31P.java @@ -32,12 +32,9 @@ import com.prowidesoftware.swift.model.field.DateContainer; import com.prowidesoftware.swift.model.field.DateResolver; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -210,16 +207,14 @@ public String getValueDisplay(int component, Locale locale) { return f.format(cal.getTime()); } } - if (component == 2) { - //default format (as is) - return getComponent(2); - } - return null; + // This is the last component, return directly without `if` + //default format (as is) + return getComponent(2); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -446,6 +441,7 @@ public Field31P setPlace(String component2) { * * @return the list of converted components (a Calendar object or null) */ + @Override public List dates() { return DateResolver.dates(this); } @@ -523,7 +519,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field31P(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field31R.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field31R.java index e485bd142..43b8b5033 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field31R.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field31R.java @@ -32,12 +32,9 @@ import com.prowidesoftware.swift.model.field.DateContainer; import com.prowidesoftware.swift.model.field.DateResolver; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -207,20 +204,19 @@ public String getValueDisplay(int component, Locale locale) { return f.format(cal.getTime()); } } - if (component == 2) { - //date: [YY]YYMMDD - java.text.DateFormat f = java.text.DateFormat.getDateInstance(java.text.DateFormat.DEFAULT, notNull(locale)); - java.util.Calendar cal = getComponent2AsCalendar(); - if (cal != null) { - return f.format(cal.getTime()); - } + // This is the last component, return directly without `if` + //date: [YY]YYMMDD + java.text.DateFormat f = java.text.DateFormat.getDateInstance(java.text.DateFormat.DEFAULT, notNull(locale)); + java.util.Calendar cal = getComponent2AsCalendar(); + if (cal != null) { + return f.format(cal.getTime()); } return null; } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -487,6 +483,7 @@ public Field31R setDate2(java.util.Calendar component2) { * * @return the list of converted components (a Calendar object or null) */ + @Override public List dates() { return DateResolver.dates(this); } @@ -564,7 +561,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field31R(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field31S.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field31S.java index 4a0acca5e..27174399a 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field31S.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field31S.java @@ -32,12 +32,9 @@ import com.prowidesoftware.swift.model.field.DateContainer; import com.prowidesoftware.swift.model.field.DateResolver; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -186,23 +183,21 @@ public String getValue() { */ @Override public String getValueDisplay(int component, Locale locale) { - if (component < 1 || component > 1) { + if (component != 1) { throw new IllegalArgumentException("invalid component number " + component + " for field 31S"); } - if (component == 1) { - //date: [YY]YYMMDD - java.text.DateFormat f = java.text.DateFormat.getDateInstance(java.text.DateFormat.DEFAULT, notNull(locale)); - java.util.Calendar cal = getComponent1AsCalendar(); - if (cal != null) { - return f.format(cal.getTime()); - } + //date: [YY]YYMMDD + java.text.DateFormat f = java.text.DateFormat.getDateInstance(java.text.DateFormat.DEFAULT, notNull(locale)); + java.util.Calendar cal = getComponent1AsCalendar(); + if (cal != null) { + return f.format(cal.getTime()); } return null; } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -386,6 +381,7 @@ public Field31S setDate(java.util.Calendar component1) { * * @return the list of converted components (a Calendar object or null) */ + @Override public List dates() { return DateResolver.dates(this); } @@ -463,7 +459,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field31S(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field31X.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field31X.java index fcfcc5937..8bfdc315a 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field31X.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field31X.java @@ -32,12 +32,9 @@ import com.prowidesoftware.swift.model.field.DateContainer; import com.prowidesoftware.swift.model.field.DateResolver; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -233,16 +230,14 @@ public String getValueDisplay(int component, Locale locale) { return f.format(cal.getTime()); } } - if (component == 3) { - //default format (as is) - return getComponent(3); - } - return null; + // This is the last component, return directly without `if` + //default format (as is) + return getComponent(3); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -555,6 +550,7 @@ public Field31X setCode(String component3) { * * @return the list of converted components (a Calendar object or null) */ + @Override public List dates() { return DateResolver.dates(this); } @@ -632,7 +628,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field31X(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field329.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field329.java index 10633a8c0..9e3cb7020 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field329.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field329.java @@ -29,12 +29,9 @@ -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -183,19 +180,16 @@ public String getValue() { */ @Override public String getValueDisplay(int component, Locale locale) { - if (component < 1 || component > 1) { + if (component != 1) { throw new IllegalArgumentException("invalid component number " + component + " for field 329"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -438,7 +432,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field329(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field32C.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field32C.java index d226ad78d..2f3ac0159 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field32C.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field32C.java @@ -37,12 +37,9 @@ import com.prowidesoftware.swift.model.field.DateContainer; import com.prowidesoftware.swift.model.field.DateResolver; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -225,21 +222,20 @@ public String getValueDisplay(int component, Locale locale) { //default format (as is) return getComponent(2); } - if (component == 3) { - //amount, rate - java.text.NumberFormat f = java.text.NumberFormat.getNumberInstance(notNull(locale)); - f.setMaximumFractionDigits(13); - BigDecimal n = getComponent3AsBigDecimal(); - if (n != null) { - return f.format(n); - } + // This is the last component, return directly without `if` + //amount, rate + java.text.NumberFormat f = java.text.NumberFormat.getNumberInstance(notNull(locale)); + f.setMaximumFractionDigits(13); + BigDecimal n = getComponent3AsBigDecimal(); + if (n != null) { + return f.format(n); } return null; } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -546,32 +542,13 @@ public Field32C setComponent3(String component3) { return this; } - /** - * Set the component3 from a BigDecimal object. - *
- * Parses the BigDecimal into a SWIFT amount with truncated zero decimals and mandatory decimal separator. - *

- * @since 9.2.7 - * - * @param component3 the BigDecimal with the Amount content to set - * @return the field object to enable build pattern - */ - public Field32C setComponent3(java.math.BigDecimal component3) { - setComponent(3, SwiftFormatUtils.getBigDecimal(component3)); - return this; - } /** * Alternative method setter for field's Amount (component 3) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10.0 becomes an Float) * * @param component3 the Number with the Amount content to set * @return the field object to enable build pattern - * @see #setAmount(java.math.BigDecimal) */ public Field32C setComponent3(java.lang.Number component3) { @@ -603,53 +580,45 @@ public Field32C setAmount(String component3) { return setComponent3(component3); } - /** - * Set the Amount (component 3) from a BigDecimal object. - * - * @see #setComponent3(java.math.BigDecimal) - * - * @param component3 BigDecimal with the Amount content to set - * @return the field object to enable build pattern - * @since 9.2.7 - */ - public Field32C setAmount(java.math.BigDecimal component3) { - return setComponent3(component3); - } - /** * Alternative method setter for field's Amount (component 3) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10 becomes an Integer) * * @param component3 the Number with the Amount content to set * @return the field object to enable build pattern - * @see #setAmount(java.math.BigDecimal) */ public Field32C setAmount(java.lang.Number component3) { return setComponent3(component3); } + @Override public List currencyStrings() { return MonetaryAmountResolver.currencyStrings(this); } + @Override public List currencies() { return MonetaryAmountResolver.currencies(this); } + @Override public Currency currency() { return MonetaryAmountResolver.resolveCurrency(this); } + @Override public String currencyString() { return MonetaryAmountResolver.resolveCurrencyString(this); } + @Override public void initializeCurrencies(String cur) { MonetaryAmountResolver.resolveSetCurrency(this, cur); } + @Override public void initializeCurrencies(Currency cur) { MonetaryAmountResolver.resolveSetCurrency(this, cur); } @@ -670,6 +639,7 @@ public List amounts() { * @return the first amount as BigDecimal value. Can be null * @see MonetaryAmountResolver#amount(Field) */ + @Override public BigDecimal amount() { return MonetaryAmountResolver.amount(this); } @@ -679,6 +649,7 @@ public BigDecimal amount() { * * @return the list of converted components (a Calendar object or null) */ + @Override public List dates() { return DateResolver.dates(this); } @@ -756,7 +727,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field32C(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field32D.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field32D.java index fa4168a12..bfac7ad1d 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field32D.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field32D.java @@ -37,12 +37,9 @@ import com.prowidesoftware.swift.model.field.DateContainer; import com.prowidesoftware.swift.model.field.DateResolver; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -225,21 +222,20 @@ public String getValueDisplay(int component, Locale locale) { //default format (as is) return getComponent(2); } - if (component == 3) { - //amount, rate - java.text.NumberFormat f = java.text.NumberFormat.getNumberInstance(notNull(locale)); - f.setMaximumFractionDigits(13); - BigDecimal n = getComponent3AsBigDecimal(); - if (n != null) { - return f.format(n); - } + // This is the last component, return directly without `if` + //amount, rate + java.text.NumberFormat f = java.text.NumberFormat.getNumberInstance(notNull(locale)); + f.setMaximumFractionDigits(13); + BigDecimal n = getComponent3AsBigDecimal(); + if (n != null) { + return f.format(n); } return null; } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -546,32 +542,13 @@ public Field32D setComponent3(String component3) { return this; } - /** - * Set the component3 from a BigDecimal object. - *
- * Parses the BigDecimal into a SWIFT amount with truncated zero decimals and mandatory decimal separator. - *

- * @since 9.2.7 - * - * @param component3 the BigDecimal with the Amount content to set - * @return the field object to enable build pattern - */ - public Field32D setComponent3(java.math.BigDecimal component3) { - setComponent(3, SwiftFormatUtils.getBigDecimal(component3)); - return this; - } /** * Alternative method setter for field's Amount (component 3) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10.0 becomes an Float) * * @param component3 the Number with the Amount content to set * @return the field object to enable build pattern - * @see #setAmount(java.math.BigDecimal) */ public Field32D setComponent3(java.lang.Number component3) { @@ -603,53 +580,45 @@ public Field32D setAmount(String component3) { return setComponent3(component3); } - /** - * Set the Amount (component 3) from a BigDecimal object. - * - * @see #setComponent3(java.math.BigDecimal) - * - * @param component3 BigDecimal with the Amount content to set - * @return the field object to enable build pattern - * @since 9.2.7 - */ - public Field32D setAmount(java.math.BigDecimal component3) { - return setComponent3(component3); - } - /** * Alternative method setter for field's Amount (component 3) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10 becomes an Integer) * * @param component3 the Number with the Amount content to set * @return the field object to enable build pattern - * @see #setAmount(java.math.BigDecimal) */ public Field32D setAmount(java.lang.Number component3) { return setComponent3(component3); } + @Override public List currencyStrings() { return MonetaryAmountResolver.currencyStrings(this); } + @Override public List currencies() { return MonetaryAmountResolver.currencies(this); } + @Override public Currency currency() { return MonetaryAmountResolver.resolveCurrency(this); } + @Override public String currencyString() { return MonetaryAmountResolver.resolveCurrencyString(this); } + @Override public void initializeCurrencies(String cur) { MonetaryAmountResolver.resolveSetCurrency(this, cur); } + @Override public void initializeCurrencies(Currency cur) { MonetaryAmountResolver.resolveSetCurrency(this, cur); } @@ -670,6 +639,7 @@ public List amounts() { * @return the first amount as BigDecimal value. Can be null * @see MonetaryAmountResolver#amount(Field) */ + @Override public BigDecimal amount() { return MonetaryAmountResolver.amount(this); } @@ -679,6 +649,7 @@ public BigDecimal amount() { * * @return the list of converted components (a Calendar object or null) */ + @Override public List dates() { return DateResolver.dates(this); } @@ -756,7 +727,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field32D(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field32E.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field32E.java index f1004a259..0bf363577 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field32E.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field32E.java @@ -32,12 +32,9 @@ import com.prowidesoftware.swift.model.field.CurrencyContainer; import com.prowidesoftware.swift.model.field.CurrencyResolver; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -186,19 +183,16 @@ public String getValue() { */ @Override public String getValueDisplay(int component, Locale locale) { - if (component < 1 || component > 1) { + if (component != 1) { throw new IllegalArgumentException("invalid component number " + component + " for field 32E"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -377,26 +371,32 @@ public Field32E setCurrency(java.util.Currency component1) { } + @Override public List currencyStrings() { return CurrencyResolver.currencyStrings(this); } + @Override public List currencies() { return CurrencyResolver.currencies(this); } + @Override public Currency currency() { return CurrencyResolver.resolveCurrency(this); } + @Override public String currencyString() { return CurrencyResolver.resolveCurrencyString(this); } + @Override public void initializeCurrencies(String cur) { CurrencyResolver.resolveSetCurrency(this, cur); } + @Override public void initializeCurrencies(Currency cur) { CurrencyResolver.resolveSetCurrency(this, cur); } @@ -465,7 +465,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field32E(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field32F.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field32F.java index 55b5c2153..9b6e717de 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field32F.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field32F.java @@ -33,12 +33,9 @@ import com.prowidesoftware.swift.model.field.AmountContainer; import com.prowidesoftware.swift.model.field.AmountResolver; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -201,21 +198,20 @@ public String getValueDisplay(int component, Locale locale) { //default format (as is) return getComponent(1); } - if (component == 2) { - //amount, rate - java.text.NumberFormat f = java.text.NumberFormat.getNumberInstance(notNull(locale)); - f.setMaximumFractionDigits(13); - BigDecimal n = getComponent2AsBigDecimal(); - if (n != null) { - return f.format(n); - } + // This is the last component, return directly without `if` + //amount, rate + java.text.NumberFormat f = java.text.NumberFormat.getNumberInstance(notNull(locale)); + f.setMaximumFractionDigits(13); + BigDecimal n = getComponent2AsBigDecimal(); + if (n != null) { + return f.format(n); } return null; } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -402,32 +398,13 @@ public Field32F setComponent2(String component2) { return this; } - /** - * Set the component2 from a BigDecimal object. - *
- * Parses the BigDecimal into a SWIFT amount with truncated zero decimals and mandatory decimal separator. - *

- * @since 9.2.7 - * - * @param component2 the BigDecimal with the Amount content to set - * @return the field object to enable build pattern - */ - public Field32F setComponent2(java.math.BigDecimal component2) { - setComponent(2, SwiftFormatUtils.getBigDecimal(component2)); - return this; - } /** * Alternative method setter for field's Amount (component 2) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10.0 becomes an Float) * * @param component2 the Number with the Amount content to set * @return the field object to enable build pattern - * @see #setAmount(java.math.BigDecimal) */ public Field32F setComponent2(java.lang.Number component2) { @@ -459,27 +436,13 @@ public Field32F setAmount(String component2) { return setComponent2(component2); } - /** - * Set the Amount (component 2) from a BigDecimal object. - * - * @see #setComponent2(java.math.BigDecimal) - * - * @param component2 BigDecimal with the Amount content to set - * @return the field object to enable build pattern - * @since 9.2.7 - */ - public Field32F setAmount(java.math.BigDecimal component2) { - return setComponent2(component2); - } - /** * Alternative method setter for field's Amount (component 2) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10 becomes an Integer) * * @param component2 the Number with the Amount content to set * @return the field object to enable build pattern - * @see #setAmount(java.math.BigDecimal) */ public Field32F setAmount(java.lang.Number component2) { return setComponent2(component2); @@ -502,6 +465,7 @@ public List amounts() { * @return the first amount as BigDecimal value. Can be null * @see AmountResolver#amount(Field) */ + @Override public BigDecimal amount() { return AmountResolver.amount(this); } @@ -570,7 +534,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field32F(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field32G.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field32G.java index 9dc4a7ce0..1208d3ee4 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field32G.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field32G.java @@ -34,12 +34,9 @@ import com.prowidesoftware.swift.model.field.MonetaryAmountContainer; import com.prowidesoftware.swift.model.field.MonetaryAmountResolver; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -202,21 +199,20 @@ public String getValueDisplay(int component, Locale locale) { //default format (as is) return getComponent(1); } - if (component == 2) { - //amount, rate - java.text.NumberFormat f = java.text.NumberFormat.getNumberInstance(notNull(locale)); - f.setMaximumFractionDigits(13); - BigDecimal n = getComponent2AsBigDecimal(); - if (n != null) { - return f.format(n); - } + // This is the last component, return directly without `if` + //amount, rate + java.text.NumberFormat f = java.text.NumberFormat.getNumberInstance(notNull(locale)); + f.setMaximumFractionDigits(13); + BigDecimal n = getComponent2AsBigDecimal(); + if (n != null) { + return f.format(n); } return null; } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -443,32 +439,13 @@ public Field32G setComponent2(String component2) { return this; } - /** - * Set the component2 from a BigDecimal object. - *
- * Parses the BigDecimal into a SWIFT amount with truncated zero decimals and mandatory decimal separator. - *

- * @since 9.2.7 - * - * @param component2 the BigDecimal with the Amount content to set - * @return the field object to enable build pattern - */ - public Field32G setComponent2(java.math.BigDecimal component2) { - setComponent(2, SwiftFormatUtils.getBigDecimal(component2)); - return this; - } /** * Alternative method setter for field's Amount (component 2) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10.0 becomes an Float) * * @param component2 the Number with the Amount content to set * @return the field object to enable build pattern - * @see #setAmount(java.math.BigDecimal) */ public Field32G setComponent2(java.lang.Number component2) { @@ -500,53 +477,45 @@ public Field32G setAmount(String component2) { return setComponent2(component2); } - /** - * Set the Amount (component 2) from a BigDecimal object. - * - * @see #setComponent2(java.math.BigDecimal) - * - * @param component2 BigDecimal with the Amount content to set - * @return the field object to enable build pattern - * @since 9.2.7 - */ - public Field32G setAmount(java.math.BigDecimal component2) { - return setComponent2(component2); - } - /** * Alternative method setter for field's Amount (component 2) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10 becomes an Integer) * * @param component2 the Number with the Amount content to set * @return the field object to enable build pattern - * @see #setAmount(java.math.BigDecimal) */ public Field32G setAmount(java.lang.Number component2) { return setComponent2(component2); } + @Override public List currencyStrings() { return MonetaryAmountResolver.currencyStrings(this); } + @Override public List currencies() { return MonetaryAmountResolver.currencies(this); } + @Override public Currency currency() { return MonetaryAmountResolver.resolveCurrency(this); } + @Override public String currencyString() { return MonetaryAmountResolver.resolveCurrencyString(this); } + @Override public void initializeCurrencies(String cur) { MonetaryAmountResolver.resolveSetCurrency(this, cur); } + @Override public void initializeCurrencies(Currency cur) { MonetaryAmountResolver.resolveSetCurrency(this, cur); } @@ -567,6 +536,7 @@ public List amounts() { * @return the first amount as BigDecimal value. Can be null * @see MonetaryAmountResolver#amount(Field) */ + @Override public BigDecimal amount() { return MonetaryAmountResolver.amount(this); } @@ -635,7 +605,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field32G(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field32H.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field32H.java index 48dcfffcd..b2fe9877c 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field32H.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field32H.java @@ -34,12 +34,9 @@ import com.prowidesoftware.swift.model.field.MonetaryAmountContainer; import com.prowidesoftware.swift.model.field.MonetaryAmountResolver; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -220,21 +217,20 @@ public String getValueDisplay(int component, Locale locale) { //default format (as is) return getComponent(2); } - if (component == 3) { - //amount, rate - java.text.NumberFormat f = java.text.NumberFormat.getNumberInstance(notNull(locale)); - f.setMaximumFractionDigits(13); - BigDecimal n = getComponent3AsBigDecimal(); - if (n != null) { - return f.format(n); - } + // This is the last component, return directly without `if` + //amount, rate + java.text.NumberFormat f = java.text.NumberFormat.getNumberInstance(notNull(locale)); + f.setMaximumFractionDigits(13); + BigDecimal n = getComponent3AsBigDecimal(); + if (n != null) { + return f.format(n); } return null; } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -504,32 +500,13 @@ public Field32H setComponent3(String component3) { return this; } - /** - * Set the component3 from a BigDecimal object. - *
- * Parses the BigDecimal into a SWIFT amount with truncated zero decimals and mandatory decimal separator. - *

- * @since 9.2.7 - * - * @param component3 the BigDecimal with the Amount content to set - * @return the field object to enable build pattern - */ - public Field32H setComponent3(java.math.BigDecimal component3) { - setComponent(3, SwiftFormatUtils.getBigDecimal(component3)); - return this; - } /** * Alternative method setter for field's Amount (component 3) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10.0 becomes an Float) * * @param component3 the Number with the Amount content to set * @return the field object to enable build pattern - * @see #setAmount(java.math.BigDecimal) */ public Field32H setComponent3(java.lang.Number component3) { @@ -561,53 +538,45 @@ public Field32H setAmount(String component3) { return setComponent3(component3); } - /** - * Set the Amount (component 3) from a BigDecimal object. - * - * @see #setComponent3(java.math.BigDecimal) - * - * @param component3 BigDecimal with the Amount content to set - * @return the field object to enable build pattern - * @since 9.2.7 - */ - public Field32H setAmount(java.math.BigDecimal component3) { - return setComponent3(component3); - } - /** * Alternative method setter for field's Amount (component 3) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10 becomes an Integer) * * @param component3 the Number with the Amount content to set * @return the field object to enable build pattern - * @see #setAmount(java.math.BigDecimal) */ public Field32H setAmount(java.lang.Number component3) { return setComponent3(component3); } + @Override public List currencyStrings() { return MonetaryAmountResolver.currencyStrings(this); } + @Override public List currencies() { return MonetaryAmountResolver.currencies(this); } + @Override public Currency currency() { return MonetaryAmountResolver.resolveCurrency(this); } + @Override public String currencyString() { return MonetaryAmountResolver.resolveCurrencyString(this); } + @Override public void initializeCurrencies(String cur) { MonetaryAmountResolver.resolveSetCurrency(this, cur); } + @Override public void initializeCurrencies(Currency cur) { MonetaryAmountResolver.resolveSetCurrency(this, cur); } @@ -628,6 +597,7 @@ public List amounts() { * @return the first amount as BigDecimal value. Can be null * @see MonetaryAmountResolver#amount(Field) */ + @Override public BigDecimal amount() { return MonetaryAmountResolver.amount(this); } @@ -696,7 +666,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field32H(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field32M.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field32M.java index 45c58d8df..3106afe42 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field32M.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field32M.java @@ -34,12 +34,9 @@ import com.prowidesoftware.swift.model.field.MonetaryAmountContainer; import com.prowidesoftware.swift.model.field.MonetaryAmountResolver; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -202,21 +199,20 @@ public String getValueDisplay(int component, Locale locale) { //default format (as is) return getComponent(1); } - if (component == 2) { - //amount, rate - java.text.NumberFormat f = java.text.NumberFormat.getNumberInstance(notNull(locale)); - f.setMaximumFractionDigits(13); - BigDecimal n = getComponent2AsBigDecimal(); - if (n != null) { - return f.format(n); - } + // This is the last component, return directly without `if` + //amount, rate + java.text.NumberFormat f = java.text.NumberFormat.getNumberInstance(notNull(locale)); + f.setMaximumFractionDigits(13); + BigDecimal n = getComponent2AsBigDecimal(); + if (n != null) { + return f.format(n); } return null; } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -443,32 +439,13 @@ public Field32M setComponent2(String component2) { return this; } - /** - * Set the component2 from a BigDecimal object. - *
- * Parses the BigDecimal into a SWIFT amount with truncated zero decimals and mandatory decimal separator. - *

- * @since 9.2.7 - * - * @param component2 the BigDecimal with the Amount content to set - * @return the field object to enable build pattern - */ - public Field32M setComponent2(java.math.BigDecimal component2) { - setComponent(2, SwiftFormatUtils.getBigDecimal(component2)); - return this; - } /** * Alternative method setter for field's Amount (component 2) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10.0 becomes an Float) * * @param component2 the Number with the Amount content to set * @return the field object to enable build pattern - * @see #setAmount(java.math.BigDecimal) */ public Field32M setComponent2(java.lang.Number component2) { @@ -500,53 +477,45 @@ public Field32M setAmount(String component2) { return setComponent2(component2); } - /** - * Set the Amount (component 2) from a BigDecimal object. - * - * @see #setComponent2(java.math.BigDecimal) - * - * @param component2 BigDecimal with the Amount content to set - * @return the field object to enable build pattern - * @since 9.2.7 - */ - public Field32M setAmount(java.math.BigDecimal component2) { - return setComponent2(component2); - } - /** * Alternative method setter for field's Amount (component 2) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10 becomes an Integer) * * @param component2 the Number with the Amount content to set * @return the field object to enable build pattern - * @see #setAmount(java.math.BigDecimal) */ public Field32M setAmount(java.lang.Number component2) { return setComponent2(component2); } + @Override public List currencyStrings() { return MonetaryAmountResolver.currencyStrings(this); } + @Override public List currencies() { return MonetaryAmountResolver.currencies(this); } + @Override public Currency currency() { return MonetaryAmountResolver.resolveCurrency(this); } + @Override public String currencyString() { return MonetaryAmountResolver.resolveCurrencyString(this); } + @Override public void initializeCurrencies(String cur) { MonetaryAmountResolver.resolveSetCurrency(this, cur); } + @Override public void initializeCurrencies(Currency cur) { MonetaryAmountResolver.resolveSetCurrency(this, cur); } @@ -567,6 +536,7 @@ public List amounts() { * @return the first amount as BigDecimal value. Can be null * @see MonetaryAmountResolver#amount(Field) */ + @Override public BigDecimal amount() { return MonetaryAmountResolver.amount(this); } @@ -635,7 +605,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field32M(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field32Q.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field32Q.java index 705a3f7e1..667c4727d 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field32Q.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field32Q.java @@ -32,12 +32,9 @@ import com.prowidesoftware.swift.model.field.CurrencyContainer; import com.prowidesoftware.swift.model.field.CurrencyResolver; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -202,16 +199,14 @@ public String getValueDisplay(int component, Locale locale) { //default format (as is) return getComponent(1); } - if (component == 2) { - //default format (as is) - return getComponent(2); - } - return null; + // This is the last component, return directly without `if` + //default format (as is) + return getComponent(2); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -470,26 +465,32 @@ public Field32Q setCurrency2(java.util.Currency component2) { } + @Override public List currencyStrings() { return CurrencyResolver.currencyStrings(this); } + @Override public List currencies() { return CurrencyResolver.currencies(this); } + @Override public Currency currency() { return CurrencyResolver.resolveCurrency(this); } + @Override public String currencyString() { return CurrencyResolver.resolveCurrencyString(this); } + @Override public void initializeCurrencies(String cur) { CurrencyResolver.resolveSetCurrency(this, cur); } + @Override public void initializeCurrencies(Currency cur) { CurrencyResolver.resolveSetCurrency(this, cur); } @@ -558,7 +559,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field32Q(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field32R.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field32R.java index 77ff101ac..96b1effca 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field32R.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field32R.java @@ -33,12 +33,9 @@ import com.prowidesoftware.swift.model.field.AmountContainer; import com.prowidesoftware.swift.model.field.AmountResolver; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -223,21 +220,20 @@ public String getValueDisplay(int component, Locale locale) { //default format (as is) return getComponent(2); } - if (component == 3) { - //amount, rate - java.text.NumberFormat f = java.text.NumberFormat.getNumberInstance(notNull(locale)); - f.setMaximumFractionDigits(13); - BigDecimal n = getComponent3AsBigDecimal(); - if (n != null) { - return f.format(n); - } + // This is the last component, return directly without `if` + //amount, rate + java.text.NumberFormat f = java.text.NumberFormat.getNumberInstance(notNull(locale)); + f.setMaximumFractionDigits(13); + BigDecimal n = getComponent3AsBigDecimal(); + if (n != null) { + return f.format(n); } return null; } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -467,32 +463,13 @@ public Field32R setComponent3(String component3) { return this; } - /** - * Set the component3 from a BigDecimal object. - *
- * Parses the BigDecimal into a SWIFT amount with truncated zero decimals and mandatory decimal separator. - *

- * @since 9.2.7 - * - * @param component3 the BigDecimal with the Amount content to set - * @return the field object to enable build pattern - */ - public Field32R setComponent3(java.math.BigDecimal component3) { - setComponent(3, SwiftFormatUtils.getBigDecimal(component3)); - return this; - } /** * Alternative method setter for field's Amount (component 3) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10.0 becomes an Float) * * @param component3 the Number with the Amount content to set * @return the field object to enable build pattern - * @see #setAmount(java.math.BigDecimal) */ public Field32R setComponent3(java.lang.Number component3) { @@ -524,27 +501,13 @@ public Field32R setAmount(String component3) { return setComponent3(component3); } - /** - * Set the Amount (component 3) from a BigDecimal object. - * - * @see #setComponent3(java.math.BigDecimal) - * - * @param component3 BigDecimal with the Amount content to set - * @return the field object to enable build pattern - * @since 9.2.7 - */ - public Field32R setAmount(java.math.BigDecimal component3) { - return setComponent3(component3); - } - /** * Alternative method setter for field's Amount (component 3) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10 becomes an Integer) * * @param component3 the Number with the Amount content to set * @return the field object to enable build pattern - * @see #setAmount(java.math.BigDecimal) */ public Field32R setAmount(java.lang.Number component3) { return setComponent3(component3); @@ -567,6 +530,7 @@ public List amounts() { * @return the first amount as BigDecimal value. Can be null * @see AmountResolver#amount(Field) */ + @Override public BigDecimal amount() { return AmountResolver.amount(this); } @@ -635,7 +599,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field32R(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field32U.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field32U.java index 7152dd0a4..28001ff64 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field32U.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field32U.java @@ -34,12 +34,9 @@ import com.prowidesoftware.swift.model.field.MonetaryAmountContainer; import com.prowidesoftware.swift.model.field.MonetaryAmountResolver; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -202,21 +199,20 @@ public String getValueDisplay(int component, Locale locale) { //default format (as is) return getComponent(1); } - if (component == 2) { - //amount, rate - java.text.NumberFormat f = java.text.NumberFormat.getNumberInstance(notNull(locale)); - f.setMaximumFractionDigits(13); - BigDecimal n = getComponent2AsBigDecimal(); - if (n != null) { - return f.format(n); - } + // This is the last component, return directly without `if` + //amount, rate + java.text.NumberFormat f = java.text.NumberFormat.getNumberInstance(notNull(locale)); + f.setMaximumFractionDigits(13); + BigDecimal n = getComponent2AsBigDecimal(); + if (n != null) { + return f.format(n); } return null; } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -443,32 +439,13 @@ public Field32U setComponent2(String component2) { return this; } - /** - * Set the component2 from a BigDecimal object. - *
- * Parses the BigDecimal into a SWIFT amount with truncated zero decimals and mandatory decimal separator. - *

- * @since 9.2.7 - * - * @param component2 the BigDecimal with the Amount content to set - * @return the field object to enable build pattern - */ - public Field32U setComponent2(java.math.BigDecimal component2) { - setComponent(2, SwiftFormatUtils.getBigDecimal(component2)); - return this; - } /** * Alternative method setter for field's Amount (component 2) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10.0 becomes an Float) * * @param component2 the Number with the Amount content to set * @return the field object to enable build pattern - * @see #setAmount(java.math.BigDecimal) */ public Field32U setComponent2(java.lang.Number component2) { @@ -500,53 +477,45 @@ public Field32U setAmount(String component2) { return setComponent2(component2); } - /** - * Set the Amount (component 2) from a BigDecimal object. - * - * @see #setComponent2(java.math.BigDecimal) - * - * @param component2 BigDecimal with the Amount content to set - * @return the field object to enable build pattern - * @since 9.2.7 - */ - public Field32U setAmount(java.math.BigDecimal component2) { - return setComponent2(component2); - } - /** * Alternative method setter for field's Amount (component 2) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10 becomes an Integer) * * @param component2 the Number with the Amount content to set * @return the field object to enable build pattern - * @see #setAmount(java.math.BigDecimal) */ public Field32U setAmount(java.lang.Number component2) { return setComponent2(component2); } + @Override public List currencyStrings() { return MonetaryAmountResolver.currencyStrings(this); } + @Override public List currencies() { return MonetaryAmountResolver.currencies(this); } + @Override public Currency currency() { return MonetaryAmountResolver.resolveCurrency(this); } + @Override public String currencyString() { return MonetaryAmountResolver.resolveCurrencyString(this); } + @Override public void initializeCurrencies(String cur) { MonetaryAmountResolver.resolveSetCurrency(this, cur); } + @Override public void initializeCurrencies(Currency cur) { MonetaryAmountResolver.resolveSetCurrency(this, cur); } @@ -567,6 +536,7 @@ public List amounts() { * @return the first amount as BigDecimal value. Can be null * @see MonetaryAmountResolver#amount(Field) */ + @Override public BigDecimal amount() { return MonetaryAmountResolver.amount(this); } @@ -635,7 +605,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field32U(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field330.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field330.java index a5ef229c2..8fe086d53 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field330.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field330.java @@ -31,12 +31,9 @@ import java.math.BigInteger; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -257,16 +254,14 @@ public String getValueDisplay(int component, Locale locale) { //default format (as is) return getComponent(5); } - if (component == 6) { - //default format (as is) - return getComponent(6); - } - return null; + // This is the last component, return directly without `if` + //default format (as is) + return getComponent(6); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -603,32 +598,14 @@ public Field330 setComponent1(String component1) { return this; } - /** - * Set the component1 from a Long object. - *
- * If the component being set is a fixed length number, the argument will not be - * padded. It is recommended for these cases to use the setComponent1(String) - * method. - * - * @see #setComponent1(String) - * @since 9.2.7 - * - * @param component1 the Long with the Session Number content to set - * @return the field object to enable build pattern - */ - public Field330 setComponent1(java.lang.Long component1) { - setComponent(1, SwiftFormatUtils.getLong(component1)); - return this; - } /** * Alternative method setter for field's Session Number (component 1) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10 becomes an Integer) * * @param component1 the Number with the Session Number content to set * @return the field object to enable build pattern - * @see #setSessionNumber(java.lang.Long) */ public Field330 setComponent1(java.lang.Number component1) { @@ -658,27 +635,13 @@ public Field330 setSessionNumber(String component1) { return setComponent1(component1); } - /** - * Set the Session Number (component 1) from a Long object. - * - * @see #setComponent1(java.lang.Long) - * - * @param component1 Long with the Session Number content to set - * @return the field object to enable build pattern - * @since 9.2.7 - */ - public Field330 setSessionNumber(java.lang.Long component1) { - return setComponent1(component1); - } - /** * Alternative method setter for field's Session Number (component 1) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10 becomes an Integer) * * @param component1 the Number with the Session Number content to set * @return the field object to enable build pattern - * @see #setSessionNumber(java.lang.Long) */ public Field330 setSessionNumber(java.lang.Number component1) { return setComponent1(component1); @@ -695,32 +658,14 @@ public Field330 setComponent2(String component2) { return this; } - /** - * Set the component2 from a Long object. - *
- * If the component being set is a fixed length number, the argument will not be - * padded. It is recommended for these cases to use the setComponent2(String) - * method. - * - * @see #setComponent2(String) - * @since 9.2.7 - * - * @param component2 the Long with the ISN content to set - * @return the field object to enable build pattern - */ - public Field330 setComponent2(java.lang.Long component2) { - setComponent(2, SwiftFormatUtils.getLong(component2)); - return this; - } /** * Alternative method setter for field's ISN (component 2) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10 becomes an Integer) * * @param component2 the Number with the ISN content to set * @return the field object to enable build pattern - * @see #setISN(java.lang.Long) */ public Field330 setComponent2(java.lang.Number component2) { @@ -750,27 +695,13 @@ public Field330 setISN(String component2) { return setComponent2(component2); } - /** - * Set the ISN (component 2) from a Long object. - * - * @see #setComponent2(java.lang.Long) - * - * @param component2 Long with the ISN content to set - * @return the field object to enable build pattern - * @since 9.2.7 - */ - public Field330 setISN(java.lang.Long component2) { - return setComponent2(component2); - } - /** * Alternative method setter for field's ISN (component 2) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10 becomes an Integer) * * @param component2 the Number with the ISN content to set * @return the field object to enable build pattern - * @see #setISN(java.lang.Long) */ public Field330 setISN(java.lang.Number component2) { return setComponent2(component2); @@ -787,32 +718,14 @@ public Field330 setComponent3(String component3) { return this; } - /** - * Set the component3 from a Long object. - *
- * If the component being set is a fixed length number, the argument will not be - * padded. It is recommended for these cases to use the setComponent3(String) - * method. - * - * @see #setComponent3(String) - * @since 9.2.7 - * - * @param component3 the Long with the ISN NAK content to set - * @return the field object to enable build pattern - */ - public Field330 setComponent3(java.lang.Long component3) { - setComponent(3, SwiftFormatUtils.getLong(component3)); - return this; - } /** * Alternative method setter for field's ISN NAK (component 3) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10 becomes an Integer) * * @param component3 the Number with the ISN NAK content to set * @return the field object to enable build pattern - * @see #setISNNAK(java.lang.Long) */ public Field330 setComponent3(java.lang.Number component3) { @@ -842,27 +755,13 @@ public Field330 setISNNAK(String component3) { return setComponent3(component3); } - /** - * Set the ISN NAK (component 3) from a Long object. - * - * @see #setComponent3(java.lang.Long) - * - * @param component3 Long with the ISN NAK content to set - * @return the field object to enable build pattern - * @since 9.2.7 - */ - public Field330 setISNNAK(java.lang.Long component3) { - return setComponent3(component3); - } - /** * Alternative method setter for field's ISN NAK (component 3) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10 becomes an Integer) * * @param component3 the Number with the ISN NAK content to set * @return the field object to enable build pattern - * @see #setISNNAK(java.lang.Long) */ public Field330 setISNNAK(java.lang.Number component3) { return setComponent3(component3); @@ -879,32 +778,14 @@ public Field330 setComponent4(String component4) { return this; } - /** - * Set the component4 from a Long object. - *
- * If the component being set is a fixed length number, the argument will not be - * padded. It is recommended for these cases to use the setComponent4(String) - * method. - * - * @see #setComponent4(String) - * @since 9.2.7 - * - * @param component4 the Long with the OSN content to set - * @return the field object to enable build pattern - */ - public Field330 setComponent4(java.lang.Long component4) { - setComponent(4, SwiftFormatUtils.getLong(component4)); - return this; - } /** * Alternative method setter for field's OSN (component 4) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10 becomes an Integer) * * @param component4 the Number with the OSN content to set * @return the field object to enable build pattern - * @see #setOSN(java.lang.Long) */ public Field330 setComponent4(java.lang.Number component4) { @@ -934,27 +815,13 @@ public Field330 setOSN(String component4) { return setComponent4(component4); } - /** - * Set the OSN (component 4) from a Long object. - * - * @see #setComponent4(java.lang.Long) - * - * @param component4 Long with the OSN content to set - * @return the field object to enable build pattern - * @since 9.2.7 - */ - public Field330 setOSN(java.lang.Long component4) { - return setComponent4(component4); - } - /** * Alternative method setter for field's OSN (component 4) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10 becomes an Integer) * * @param component4 the Number with the OSN content to set * @return the field object to enable build pattern - * @see #setOSN(java.lang.Long) */ public Field330 setOSN(java.lang.Number component4) { return setComponent4(component4); @@ -971,32 +838,14 @@ public Field330 setComponent5(String component5) { return this; } - /** - * Set the component5 from a Long object. - *
- * If the component being set is a fixed length number, the argument will not be - * padded. It is recommended for these cases to use the setComponent5(String) - * method. - * - * @see #setComponent5(String) - * @since 9.2.7 - * - * @param component5 the Long with the OSN NAK content to set - * @return the field object to enable build pattern - */ - public Field330 setComponent5(java.lang.Long component5) { - setComponent(5, SwiftFormatUtils.getLong(component5)); - return this; - } /** * Alternative method setter for field's OSN NAK (component 5) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10 becomes an Integer) * * @param component5 the Number with the OSN NAK content to set * @return the field object to enable build pattern - * @see #setOSNNAK(java.lang.Long) */ public Field330 setComponent5(java.lang.Number component5) { @@ -1026,27 +875,13 @@ public Field330 setOSNNAK(String component5) { return setComponent5(component5); } - /** - * Set the OSN NAK (component 5) from a Long object. - * - * @see #setComponent5(java.lang.Long) - * - * @param component5 Long with the OSN NAK content to set - * @return the field object to enable build pattern - * @since 9.2.7 - */ - public Field330 setOSNNAK(java.lang.Long component5) { - return setComponent5(component5); - } - /** * Alternative method setter for field's OSN NAK (component 5) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10 becomes an Integer) * * @param component5 the Number with the OSN NAK content to set * @return the field object to enable build pattern - * @see #setOSNNAK(java.lang.Long) */ public Field330 setOSNNAK(java.lang.Number component5) { return setComponent5(component5); @@ -1063,32 +898,14 @@ public Field330 setComponent6(String component6) { return this; } - /** - * Set the component6 from a Long object. - *
- * If the component being set is a fixed length number, the argument will not be - * padded. It is recommended for these cases to use the setComponent6(String) - * method. - * - * @see #setComponent6(String) - * @since 9.2.7 - * - * @param component6 the Long with the ACK Replay Indicator content to set - * @return the field object to enable build pattern - */ - public Field330 setComponent6(java.lang.Long component6) { - setComponent(6, SwiftFormatUtils.getLong(component6)); - return this; - } /** * Alternative method setter for field's ACK Replay Indicator (component 6) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10 becomes an Integer) * * @param component6 the Number with the ACK Replay Indicator content to set * @return the field object to enable build pattern - * @see #setACKReplayIndicator(java.lang.Long) */ public Field330 setComponent6(java.lang.Number component6) { @@ -1118,27 +935,13 @@ public Field330 setACKReplayIndicator(String component6) { return setComponent6(component6); } - /** - * Set the ACK Replay Indicator (component 6) from a Long object. - * - * @see #setComponent6(java.lang.Long) - * - * @param component6 Long with the ACK Replay Indicator content to set - * @return the field object to enable build pattern - * @since 9.2.7 - */ - public Field330 setACKReplayIndicator(java.lang.Long component6) { - return setComponent6(component6); - } - /** * Alternative method setter for field's ACK Replay Indicator (component 6) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10 becomes an Integer) * * @param component6 the Number with the ACK Replay Indicator content to set * @return the field object to enable build pattern - * @see #setACKReplayIndicator(java.lang.Long) */ public Field330 setACKReplayIndicator(java.lang.Number component6) { return setComponent6(component6); @@ -1209,7 +1012,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field330(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field331.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field331.java index fb4522e13..df3e7597b 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field331.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field331.java @@ -34,12 +34,9 @@ import com.prowidesoftware.swift.model.field.DateContainer; import com.prowidesoftware.swift.model.field.DateResolver; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -338,16 +335,14 @@ public String getValueDisplay(int component, Locale locale) { //default format (as is) return getComponent(11); } - if (component == 12) { - //default format (as is) - return getComponent(12); - } - return null; + // This is the last component, return directly without `if` + //default format (as is) + return getComponent(12); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -904,32 +899,14 @@ public Field331 setComponent1(String component1) { return this; } - /** - * Set the component1 from a Long object. - *
- * If the component being set is a fixed length number, the argument will not be - * padded. It is recommended for these cases to use the setComponent1(String) - * method. - * - * @see #setComponent1(String) - * @since 9.2.7 - * - * @param component1 the Long with the Session Number content to set - * @return the field object to enable build pattern - */ - public Field331 setComponent1(java.lang.Long component1) { - setComponent(1, SwiftFormatUtils.getLong(component1)); - return this; - } /** * Alternative method setter for field's Session Number (component 1) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10 becomes an Integer) * * @param component1 the Number with the Session Number content to set * @return the field object to enable build pattern - * @see #setSessionNumber(java.lang.Long) */ public Field331 setComponent1(java.lang.Number component1) { @@ -959,27 +936,13 @@ public Field331 setSessionNumber(String component1) { return setComponent1(component1); } - /** - * Set the Session Number (component 1) from a Long object. - * - * @see #setComponent1(java.lang.Long) - * - * @param component1 Long with the Session Number content to set - * @return the field object to enable build pattern - * @since 9.2.7 - */ - public Field331 setSessionNumber(java.lang.Long component1) { - return setComponent1(component1); - } - /** * Alternative method setter for field's Session Number (component 1) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10 becomes an Integer) * * @param component1 the Number with the Session Number content to set * @return the field object to enable build pattern - * @see #setSessionNumber(java.lang.Long) */ public Field331 setSessionNumber(java.lang.Number component1) { return setComponent1(component1); @@ -1172,32 +1135,14 @@ public Field331 setComponent6(String component6) { return this; } - /** - * Set the component6 from a Long object. - *
- * If the component being set is a fixed length number, the argument will not be - * padded. It is recommended for these cases to use the setComponent6(String) - * method. - * - * @see #setComponent6(String) - * @since 9.2.7 - * - * @param component6 the Long with the Reason For Closure content to set - * @return the field object to enable build pattern - */ - public Field331 setComponent6(java.lang.Long component6) { - setComponent(6, SwiftFormatUtils.getLong(component6)); - return this; - } /** * Alternative method setter for field's Reason For Closure (component 6) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10 becomes an Integer) * * @param component6 the Number with the Reason For Closure content to set * @return the field object to enable build pattern - * @see #setReasonForClosure(java.lang.Long) */ public Field331 setComponent6(java.lang.Number component6) { @@ -1227,27 +1172,13 @@ public Field331 setReasonForClosure(String component6) { return setComponent6(component6); } - /** - * Set the Reason For Closure (component 6) from a Long object. - * - * @see #setComponent6(java.lang.Long) - * - * @param component6 Long with the Reason For Closure content to set - * @return the field object to enable build pattern - * @since 9.2.7 - */ - public Field331 setReasonForClosure(java.lang.Long component6) { - return setComponent6(component6); - } - /** * Alternative method setter for field's Reason For Closure (component 6) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10 becomes an Integer) * * @param component6 the Number with the Reason For Closure content to set * @return the field object to enable build pattern - * @see #setReasonForClosure(java.lang.Long) */ public Field331 setReasonForClosure(java.lang.Number component6) { return setComponent6(component6); @@ -1264,32 +1195,14 @@ public Field331 setComponent7(String component7) { return this; } - /** - * Set the component7 from a Long object. - *
- * If the component being set is a fixed length number, the argument will not be - * padded. It is recommended for these cases to use the setComponent7(String) - * method. - * - * @see #setComponent7(String) - * @since 9.2.7 - * - * @param component7 the Long with the Quantity Of Messages Sent content to set - * @return the field object to enable build pattern - */ - public Field331 setComponent7(java.lang.Long component7) { - setComponent(7, SwiftFormatUtils.getLong(component7)); - return this; - } /** * Alternative method setter for field's Quantity Of Messages Sent (component 7) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10 becomes an Integer) * * @param component7 the Number with the Quantity Of Messages Sent content to set * @return the field object to enable build pattern - * @see #setQuantityOfMessagesSent(java.lang.Long) */ public Field331 setComponent7(java.lang.Number component7) { @@ -1319,27 +1232,13 @@ public Field331 setQuantityOfMessagesSent(String component7) { return setComponent7(component7); } - /** - * Set the Quantity Of Messages Sent (component 7) from a Long object. - * - * @see #setComponent7(java.lang.Long) - * - * @param component7 Long with the Quantity Of Messages Sent content to set - * @return the field object to enable build pattern - * @since 9.2.7 - */ - public Field331 setQuantityOfMessagesSent(java.lang.Long component7) { - return setComponent7(component7); - } - /** * Alternative method setter for field's Quantity Of Messages Sent (component 7) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10 becomes an Integer) * * @param component7 the Number with the Quantity Of Messages Sent content to set * @return the field object to enable build pattern - * @see #setQuantityOfMessagesSent(java.lang.Long) */ public Field331 setQuantityOfMessagesSent(java.lang.Number component7) { return setComponent7(component7); @@ -1356,32 +1255,14 @@ public Field331 setComponent8(String component8) { return this; } - /** - * Set the component8 from a Long object. - *
- * If the component being set is a fixed length number, the argument will not be - * padded. It is recommended for these cases to use the setComponent8(String) - * method. - * - * @see #setComponent8(String) - * @since 9.2.7 - * - * @param component8 the Long with the Quantity Of Messages Received content to set - * @return the field object to enable build pattern - */ - public Field331 setComponent8(java.lang.Long component8) { - setComponent(8, SwiftFormatUtils.getLong(component8)); - return this; - } /** * Alternative method setter for field's Quantity Of Messages Received (component 8) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10 becomes an Integer) * * @param component8 the Number with the Quantity Of Messages Received content to set * @return the field object to enable build pattern - * @see #setQuantityOfMessagesReceived(java.lang.Long) */ public Field331 setComponent8(java.lang.Number component8) { @@ -1411,27 +1292,13 @@ public Field331 setQuantityOfMessagesReceived(String component8) { return setComponent8(component8); } - /** - * Set the Quantity Of Messages Received (component 8) from a Long object. - * - * @see #setComponent8(java.lang.Long) - * - * @param component8 Long with the Quantity Of Messages Received content to set - * @return the field object to enable build pattern - * @since 9.2.7 - */ - public Field331 setQuantityOfMessagesReceived(java.lang.Long component8) { - return setComponent8(component8); - } - /** * Alternative method setter for field's Quantity Of Messages Received (component 8) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10 becomes an Integer) * * @param component8 the Number with the Quantity Of Messages Received content to set * @return the field object to enable build pattern - * @see #setQuantityOfMessagesReceived(java.lang.Long) */ public Field331 setQuantityOfMessagesReceived(java.lang.Number component8) { return setComponent8(component8); @@ -1448,32 +1315,14 @@ public Field331 setComponent9(String component9) { return this; } - /** - * Set the component9 from a Long object. - *
- * If the component being set is a fixed length number, the argument will not be - * padded. It is recommended for these cases to use the setComponent9(String) - * method. - * - * @see #setComponent9(String) - * @since 9.2.7 - * - * @param component9 the Long with the First Input Sequence Number content to set - * @return the field object to enable build pattern - */ - public Field331 setComponent9(java.lang.Long component9) { - setComponent(9, SwiftFormatUtils.getLong(component9)); - return this; - } /** * Alternative method setter for field's First Input Sequence Number (component 9) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10 becomes an Integer) * * @param component9 the Number with the First Input Sequence Number content to set * @return the field object to enable build pattern - * @see #setFirstInputSequenceNumber(java.lang.Long) */ public Field331 setComponent9(java.lang.Number component9) { @@ -1503,27 +1352,13 @@ public Field331 setFirstInputSequenceNumber(String component9) { return setComponent9(component9); } - /** - * Set the First Input Sequence Number (component 9) from a Long object. - * - * @see #setComponent9(java.lang.Long) - * - * @param component9 Long with the First Input Sequence Number content to set - * @return the field object to enable build pattern - * @since 9.2.7 - */ - public Field331 setFirstInputSequenceNumber(java.lang.Long component9) { - return setComponent9(component9); - } - /** * Alternative method setter for field's First Input Sequence Number (component 9) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10 becomes an Integer) * * @param component9 the Number with the First Input Sequence Number content to set * @return the field object to enable build pattern - * @see #setFirstInputSequenceNumber(java.lang.Long) */ public Field331 setFirstInputSequenceNumber(java.lang.Number component9) { return setComponent9(component9); @@ -1540,32 +1375,14 @@ public Field331 setComponent10(String component10) { return this; } - /** - * Set the component10 from a Long object. - *
- * If the component being set is a fixed length number, the argument will not be - * padded. It is recommended for these cases to use the setComponent10(String) - * method. - * - * @see #setComponent10(String) - * @since 9.2.7 - * - * @param component10 the Long with the Last Input Sequence Number content to set - * @return the field object to enable build pattern - */ - public Field331 setComponent10(java.lang.Long component10) { - setComponent(10, SwiftFormatUtils.getLong(component10)); - return this; - } /** * Alternative method setter for field's Last Input Sequence Number (component 10) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10 becomes an Integer) * * @param component10 the Number with the Last Input Sequence Number content to set * @return the field object to enable build pattern - * @see #setLastInputSequenceNumber(java.lang.Long) */ public Field331 setComponent10(java.lang.Number component10) { @@ -1595,27 +1412,13 @@ public Field331 setLastInputSequenceNumber(String component10) { return setComponent10(component10); } - /** - * Set the Last Input Sequence Number (component 10) from a Long object. - * - * @see #setComponent10(java.lang.Long) - * - * @param component10 Long with the Last Input Sequence Number content to set - * @return the field object to enable build pattern - * @since 9.2.7 - */ - public Field331 setLastInputSequenceNumber(java.lang.Long component10) { - return setComponent10(component10); - } - /** * Alternative method setter for field's Last Input Sequence Number (component 10) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10 becomes an Integer) * * @param component10 the Number with the Last Input Sequence Number content to set * @return the field object to enable build pattern - * @see #setLastInputSequenceNumber(java.lang.Long) */ public Field331 setLastInputSequenceNumber(java.lang.Number component10) { return setComponent10(component10); @@ -1632,32 +1435,14 @@ public Field331 setComponent11(String component11) { return this; } - /** - * Set the component11 from a Long object. - *
- * If the component being set is a fixed length number, the argument will not be - * padded. It is recommended for these cases to use the setComponent11(String) - * method. - * - * @see #setComponent11(String) - * @since 9.2.7 - * - * @param component11 the Long with the First Output Sequence Number content to set - * @return the field object to enable build pattern - */ - public Field331 setComponent11(java.lang.Long component11) { - setComponent(11, SwiftFormatUtils.getLong(component11)); - return this; - } /** * Alternative method setter for field's First Output Sequence Number (component 11) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10 becomes an Integer) * * @param component11 the Number with the First Output Sequence Number content to set * @return the field object to enable build pattern - * @see #setFirstOutputSequenceNumber(java.lang.Long) */ public Field331 setComponent11(java.lang.Number component11) { @@ -1687,27 +1472,13 @@ public Field331 setFirstOutputSequenceNumber(String component11) { return setComponent11(component11); } - /** - * Set the First Output Sequence Number (component 11) from a Long object. - * - * @see #setComponent11(java.lang.Long) - * - * @param component11 Long with the First Output Sequence Number content to set - * @return the field object to enable build pattern - * @since 9.2.7 - */ - public Field331 setFirstOutputSequenceNumber(java.lang.Long component11) { - return setComponent11(component11); - } - /** * Alternative method setter for field's First Output Sequence Number (component 11) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10 becomes an Integer) * * @param component11 the Number with the First Output Sequence Number content to set * @return the field object to enable build pattern - * @see #setFirstOutputSequenceNumber(java.lang.Long) */ public Field331 setFirstOutputSequenceNumber(java.lang.Number component11) { return setComponent11(component11); @@ -1724,32 +1495,14 @@ public Field331 setComponent12(String component12) { return this; } - /** - * Set the component12 from a Long object. - *
- * If the component being set is a fixed length number, the argument will not be - * padded. It is recommended for these cases to use the setComponent12(String) - * method. - * - * @see #setComponent12(String) - * @since 9.2.7 - * - * @param component12 the Long with the Last Output Sequence Number content to set - * @return the field object to enable build pattern - */ - public Field331 setComponent12(java.lang.Long component12) { - setComponent(12, SwiftFormatUtils.getLong(component12)); - return this; - } /** * Alternative method setter for field's Last Output Sequence Number (component 12) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10 becomes an Integer) * * @param component12 the Number with the Last Output Sequence Number content to set * @return the field object to enable build pattern - * @see #setLastOutputSequenceNumber(java.lang.Long) */ public Field331 setComponent12(java.lang.Number component12) { @@ -1779,27 +1532,13 @@ public Field331 setLastOutputSequenceNumber(String component12) { return setComponent12(component12); } - /** - * Set the Last Output Sequence Number (component 12) from a Long object. - * - * @see #setComponent12(java.lang.Long) - * - * @param component12 Long with the Last Output Sequence Number content to set - * @return the field object to enable build pattern - * @since 9.2.7 - */ - public Field331 setLastOutputSequenceNumber(java.lang.Long component12) { - return setComponent12(component12); - } - /** * Alternative method setter for field's Last Output Sequence Number (component 12) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10 becomes an Integer) * * @param component12 the Number with the Last Output Sequence Number content to set * @return the field object to enable build pattern - * @see #setLastOutputSequenceNumber(java.lang.Long) */ public Field331 setLastOutputSequenceNumber(java.lang.Number component12) { return setComponent12(component12); @@ -1811,6 +1550,7 @@ public Field331 setLastOutputSequenceNumber(java.lang.Number component12) { * * @return the list of converted components (a Calendar object or null) */ + @Override public List dates() { return DateResolver.dates(this); } @@ -1888,7 +1628,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field331(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field332.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field332.java index e017571a6..f3ed40a71 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field332.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field332.java @@ -31,12 +31,9 @@ import java.math.BigInteger; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -205,16 +202,14 @@ public String getValueDisplay(int component, Locale locale) { //default format (as is) return getComponent(1); } - if (component == 2) { - //default format (as is) - return getComponent(2); - } - return null; + // This is the last component, return directly without `if` + //default format (as is) + return getComponent(2); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -399,32 +394,14 @@ public Field332 setComponent1(String component1) { return this; } - /** - * Set the component1 from a Long object. - *
- * If the component being set is a fixed length number, the argument will not be - * padded. It is recommended for these cases to use the setComponent1(String) - * method. - * - * @see #setComponent1(String) - * @since 9.2.7 - * - * @param component1 the Long with the Total Messages Sent content to set - * @return the field object to enable build pattern - */ - public Field332 setComponent1(java.lang.Long component1) { - setComponent(1, SwiftFormatUtils.getLong(component1)); - return this; - } /** * Alternative method setter for field's Total Messages Sent (component 1) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10 becomes an Integer) * * @param component1 the Number with the Total Messages Sent content to set * @return the field object to enable build pattern - * @see #setTotalMessagesSent(java.lang.Long) */ public Field332 setComponent1(java.lang.Number component1) { @@ -454,27 +431,13 @@ public Field332 setTotalMessagesSent(String component1) { return setComponent1(component1); } - /** - * Set the Total Messages Sent (component 1) from a Long object. - * - * @see #setComponent1(java.lang.Long) - * - * @param component1 Long with the Total Messages Sent content to set - * @return the field object to enable build pattern - * @since 9.2.7 - */ - public Field332 setTotalMessagesSent(java.lang.Long component1) { - return setComponent1(component1); - } - /** * Alternative method setter for field's Total Messages Sent (component 1) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10 becomes an Integer) * * @param component1 the Number with the Total Messages Sent content to set * @return the field object to enable build pattern - * @see #setTotalMessagesSent(java.lang.Long) */ public Field332 setTotalMessagesSent(java.lang.Number component1) { return setComponent1(component1); @@ -491,32 +454,14 @@ public Field332 setComponent2(String component2) { return this; } - /** - * Set the component2 from a Long object. - *
- * If the component being set is a fixed length number, the argument will not be - * padded. It is recommended for these cases to use the setComponent2(String) - * method. - * - * @see #setComponent2(String) - * @since 9.2.7 - * - * @param component2 the Long with the Total Messages Received content to set - * @return the field object to enable build pattern - */ - public Field332 setComponent2(java.lang.Long component2) { - setComponent(2, SwiftFormatUtils.getLong(component2)); - return this; - } /** * Alternative method setter for field's Total Messages Received (component 2) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10 becomes an Integer) * * @param component2 the Number with the Total Messages Received content to set * @return the field object to enable build pattern - * @see #setTotalMessagesReceived(java.lang.Long) */ public Field332 setComponent2(java.lang.Number component2) { @@ -546,27 +491,13 @@ public Field332 setTotalMessagesReceived(String component2) { return setComponent2(component2); } - /** - * Set the Total Messages Received (component 2) from a Long object. - * - * @see #setComponent2(java.lang.Long) - * - * @param component2 Long with the Total Messages Received content to set - * @return the field object to enable build pattern - * @since 9.2.7 - */ - public Field332 setTotalMessagesReceived(java.lang.Long component2) { - return setComponent2(component2); - } - /** * Alternative method setter for field's Total Messages Received (component 2) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10 becomes an Integer) * * @param component2 the Number with the Total Messages Received content to set * @return the field object to enable build pattern - * @see #setTotalMessagesReceived(java.lang.Long) */ public Field332 setTotalMessagesReceived(java.lang.Number component2) { return setComponent2(component2); @@ -637,7 +568,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field332(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field333.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field333.java index 131a97ef6..558d2440d 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field333.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field333.java @@ -34,12 +34,9 @@ import com.prowidesoftware.swift.model.field.DateContainer; import com.prowidesoftware.swift.model.field.DateResolver; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -302,16 +299,14 @@ public String getValueDisplay(int component, Locale locale) { //default format (as is) return getComponent(7); } - if (component == 8) { - //default format (as is) - return getComponent(8); - } - return null; + // This is the last component, return directly without `if` + //default format (as is) + return getComponent(8); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -804,32 +799,14 @@ public Field333 setComponent3(String component3) { return this; } - /** - * Set the component3 from a Long object. - *
- * If the component being set is a fixed length number, the argument will not be - * padded. It is recommended for these cases to use the setComponent3(String) - * method. - * - * @see #setComponent3(String) - * @since 9.2.7 - * - * @param component3 the Long with the Session Number content to set - * @return the field object to enable build pattern - */ - public Field333 setComponent3(java.lang.Long component3) { - setComponent(3, SwiftFormatUtils.getLong(component3)); - return this; - } /** * Alternative method setter for field's Session Number (component 3) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10 becomes an Integer) * * @param component3 the Number with the Session Number content to set * @return the field object to enable build pattern - * @see #setSessionNumber(java.lang.Long) */ public Field333 setComponent3(java.lang.Number component3) { @@ -859,27 +836,13 @@ public Field333 setSessionNumber(String component3) { return setComponent3(component3); } - /** - * Set the Session Number (component 3) from a Long object. - * - * @see #setComponent3(java.lang.Long) - * - * @param component3 Long with the Session Number content to set - * @return the field object to enable build pattern - * @since 9.2.7 - */ - public Field333 setSessionNumber(java.lang.Long component3) { - return setComponent3(component3); - } - /** * Alternative method setter for field's Session Number (component 3) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10 becomes an Integer) * * @param component3 the Number with the Session Number content to set * @return the field object to enable build pattern - * @see #setSessionNumber(java.lang.Long) */ public Field333 setSessionNumber(java.lang.Number component3) { return setComponent3(component3); @@ -984,32 +947,14 @@ public Field333 setComponent6(String component6) { return this; } - /** - * Set the component6 from a Long object. - *
- * If the component being set is a fixed length number, the argument will not be - * padded. It is recommended for these cases to use the setComponent6(String) - * method. - * - * @see #setComponent6(String) - * @since 9.2.7 - * - * @param component6 the Long with the Reason For Closure content to set - * @return the field object to enable build pattern - */ - public Field333 setComponent6(java.lang.Long component6) { - setComponent(6, SwiftFormatUtils.getLong(component6)); - return this; - } /** * Alternative method setter for field's Reason For Closure (component 6) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10 becomes an Integer) * * @param component6 the Number with the Reason For Closure content to set * @return the field object to enable build pattern - * @see #setReasonForClosure(java.lang.Long) */ public Field333 setComponent6(java.lang.Number component6) { @@ -1039,27 +984,13 @@ public Field333 setReasonForClosure(String component6) { return setComponent6(component6); } - /** - * Set the Reason For Closure (component 6) from a Long object. - * - * @see #setComponent6(java.lang.Long) - * - * @param component6 Long with the Reason For Closure content to set - * @return the field object to enable build pattern - * @since 9.2.7 - */ - public Field333 setReasonForClosure(java.lang.Long component6) { - return setComponent6(component6); - } - /** * Alternative method setter for field's Reason For Closure (component 6) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10 becomes an Integer) * * @param component6 the Number with the Reason For Closure content to set * @return the field object to enable build pattern - * @see #setReasonForClosure(java.lang.Long) */ public Field333 setReasonForClosure(java.lang.Number component6) { return setComponent6(component6); @@ -1076,32 +1007,14 @@ public Field333 setComponent7(String component7) { return this; } - /** - * Set the component7 from a Long object. - *
- * If the component being set is a fixed length number, the argument will not be - * padded. It is recommended for these cases to use the setComponent7(String) - * method. - * - * @see #setComponent7(String) - * @since 9.2.7 - * - * @param component7 the Long with the Last Input Sequence Number Received content to set - * @return the field object to enable build pattern - */ - public Field333 setComponent7(java.lang.Long component7) { - setComponent(7, SwiftFormatUtils.getLong(component7)); - return this; - } /** * Alternative method setter for field's Last Input Sequence Number Received (component 7) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10 becomes an Integer) * * @param component7 the Number with the Last Input Sequence Number Received content to set * @return the field object to enable build pattern - * @see #setLastInputSequenceNumberReceived(java.lang.Long) */ public Field333 setComponent7(java.lang.Number component7) { @@ -1131,27 +1044,13 @@ public Field333 setLastInputSequenceNumberReceived(String component7) { return setComponent7(component7); } - /** - * Set the Last Input Sequence Number Received (component 7) from a Long object. - * - * @see #setComponent7(java.lang.Long) - * - * @param component7 Long with the Last Input Sequence Number Received content to set - * @return the field object to enable build pattern - * @since 9.2.7 - */ - public Field333 setLastInputSequenceNumberReceived(java.lang.Long component7) { - return setComponent7(component7); - } - /** * Alternative method setter for field's Last Input Sequence Number Received (component 7) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10 becomes an Integer) * * @param component7 the Number with the Last Input Sequence Number Received content to set * @return the field object to enable build pattern - * @see #setLastInputSequenceNumberReceived(java.lang.Long) */ public Field333 setLastInputSequenceNumberReceived(java.lang.Number component7) { return setComponent7(component7); @@ -1168,32 +1067,14 @@ public Field333 setComponent8(String component8) { return this; } - /** - * Set the component8 from a Long object. - *
- * If the component being set is a fixed length number, the argument will not be - * padded. It is recommended for these cases to use the setComponent8(String) - * method. - * - * @see #setComponent8(String) - * @since 9.2.7 - * - * @param component8 the Long with the Last Output Sequence Number Sent content to set - * @return the field object to enable build pattern - */ - public Field333 setComponent8(java.lang.Long component8) { - setComponent(8, SwiftFormatUtils.getLong(component8)); - return this; - } /** * Alternative method setter for field's Last Output Sequence Number Sent (component 8) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10 becomes an Integer) * * @param component8 the Number with the Last Output Sequence Number Sent content to set * @return the field object to enable build pattern - * @see #setLastOutputSequenceNumberSent(java.lang.Long) */ public Field333 setComponent8(java.lang.Number component8) { @@ -1223,27 +1104,13 @@ public Field333 setLastOutputSequenceNumberSent(String component8) { return setComponent8(component8); } - /** - * Set the Last Output Sequence Number Sent (component 8) from a Long object. - * - * @see #setComponent8(java.lang.Long) - * - * @param component8 Long with the Last Output Sequence Number Sent content to set - * @return the field object to enable build pattern - * @since 9.2.7 - */ - public Field333 setLastOutputSequenceNumberSent(java.lang.Long component8) { - return setComponent8(component8); - } - /** * Alternative method setter for field's Last Output Sequence Number Sent (component 8) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10 becomes an Integer) * * @param component8 the Number with the Last Output Sequence Number Sent content to set * @return the field object to enable build pattern - * @see #setLastOutputSequenceNumberSent(java.lang.Long) */ public Field333 setLastOutputSequenceNumberSent(java.lang.Number component8) { return setComponent8(component8); @@ -1255,6 +1122,7 @@ public Field333 setLastOutputSequenceNumberSent(java.lang.Number component8) { * * @return the list of converted components (a Calendar object or null) */ + @Override public List dates() { return DateResolver.dates(this); } @@ -1332,7 +1200,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field333(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field334.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field334.java index 8694ac914..72462e2c8 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field334.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field334.java @@ -30,12 +30,9 @@ import java.util.Calendar; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -200,20 +197,19 @@ public String getValueDisplay(int component, Locale locale) { //default format (as is) return getComponent(1); } - if (component == 2) { - //time: HH[mm] - java.text.DateFormat f = new java.text.SimpleDateFormat("HH:mm", notNull(locale)); - java.util.Calendar cal = getComponent2AsCalendar(); - if (cal != null) { - return f.format(cal.getTime()); - } + // This is the last component, return directly without `if` + //time: HH[mm] + java.text.DateFormat f = new java.text.SimpleDateFormat("HH:mm", notNull(locale)); + java.util.Calendar cal = getComponent2AsCalendar(); + if (cal != null) { + return f.format(cal.getTime()); } return null; } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -496,7 +492,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field334(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field335.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field335.java index 0df0db1fb..cd7498aef 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field335.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field335.java @@ -34,12 +34,9 @@ import java.util.Calendar; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -253,20 +250,19 @@ public String getValueDisplay(int component, Locale locale) { //default format (as is) return getComponent(4); } - if (component == 5) { - //time: HH[mm] - java.text.DateFormat f = new java.text.SimpleDateFormat("HH:mm", notNull(locale)); - java.util.Calendar cal = getComponent5AsCalendar(); - if (cal != null) { - return f.format(cal.getTime()); - } + // This is the last component, return directly without `if` + //time: HH[mm] + java.text.DateFormat f = new java.text.SimpleDateFormat("HH:mm", notNull(locale)); + java.util.Calendar cal = getComponent5AsCalendar(); + if (cal != null) { + return f.format(cal.getTime()); } return null; } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -789,7 +785,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field335(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field336.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field336.java index 9f93ee296..c16ba6560 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field336.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field336.java @@ -31,12 +31,9 @@ import java.math.BigInteger; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -218,16 +215,14 @@ public String getValueDisplay(int component, Locale locale) { //default format (as is) return getComponent(2); } - if (component == 3) { - //default format (as is) - return getComponent(3); - } - return null; + // This is the last component, return directly without `if` + //default format (as is) + return getComponent(3); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -433,32 +428,14 @@ public Field336 setComponent2(String component2) { return this; } - /** - * Set the component2 from a Long object. - *
- * If the component being set is a fixed length number, the argument will not be - * padded. It is recommended for these cases to use the setComponent2(String) - * method. - * - * @see #setComponent2(String) - * @since 9.2.7 - * - * @param component2 the Long with the Number Of Messages content to set - * @return the field object to enable build pattern - */ - public Field336 setComponent2(java.lang.Long component2) { - setComponent(2, SwiftFormatUtils.getLong(component2)); - return this; - } /** * Alternative method setter for field's Number Of Messages (component 2) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10 becomes an Integer) * * @param component2 the Number with the Number Of Messages content to set * @return the field object to enable build pattern - * @see #setNumberOfMessages(java.lang.Long) */ public Field336 setComponent2(java.lang.Number component2) { @@ -488,27 +465,13 @@ public Field336 setNumberOfMessages(String component2) { return setComponent2(component2); } - /** - * Set the Number Of Messages (component 2) from a Long object. - * - * @see #setComponent2(java.lang.Long) - * - * @param component2 Long with the Number Of Messages content to set - * @return the field object to enable build pattern - * @since 9.2.7 - */ - public Field336 setNumberOfMessages(java.lang.Long component2) { - return setComponent2(component2); - } - /** * Alternative method setter for field's Number Of Messages (component 2) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10 becomes an Integer) * * @param component2 the Number with the Number Of Messages content to set * @return the field object to enable build pattern - * @see #setNumberOfMessages(java.lang.Long) */ public Field336 setNumberOfMessages(java.lang.Number component2) { return setComponent2(component2); @@ -600,7 +563,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field336(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field337.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field337.java index e4c2b2398..c3bf12b87 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field337.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field337.java @@ -29,12 +29,9 @@ -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -183,19 +180,16 @@ public String getValue() { */ @Override public String getValueDisplay(int component, Locale locale) { - if (component < 1 || component > 1) { + if (component != 1) { throw new IllegalArgumentException("invalid component number " + component + " for field 337"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -398,7 +392,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field337(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field338.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field338.java index 244c31aac..b42c358cc 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field338.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field338.java @@ -29,12 +29,9 @@ -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -183,19 +180,16 @@ public String getValue() { */ @Override public String getValueDisplay(int component, Locale locale) { - if (component < 1 || component > 1) { + if (component != 1) { throw new IllegalArgumentException("invalid component number " + component + " for field 338"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -398,7 +392,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field338(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field339.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field339.java index 696ced908..50b8bb959 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field339.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field339.java @@ -29,12 +29,9 @@ -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -183,19 +180,16 @@ public String getValue() { */ @Override public String getValueDisplay(int component, Locale locale) { - if (component < 1 || component > 1) { + if (component != 1) { throw new IllegalArgumentException("invalid component number " + component + " for field 339"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -398,7 +392,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field339(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field33A.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field33A.java index e4e9277ef..10fb0e779 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field33A.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field33A.java @@ -37,12 +37,9 @@ import com.prowidesoftware.swift.model.field.DateContainer; import com.prowidesoftware.swift.model.field.DateResolver; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -225,21 +222,20 @@ public String getValueDisplay(int component, Locale locale) { //default format (as is) return getComponent(2); } - if (component == 3) { - //amount, rate - java.text.NumberFormat f = java.text.NumberFormat.getNumberInstance(notNull(locale)); - f.setMaximumFractionDigits(13); - BigDecimal n = getComponent3AsBigDecimal(); - if (n != null) { - return f.format(n); - } + // This is the last component, return directly without `if` + //amount, rate + java.text.NumberFormat f = java.text.NumberFormat.getNumberInstance(notNull(locale)); + f.setMaximumFractionDigits(13); + BigDecimal n = getComponent3AsBigDecimal(); + if (n != null) { + return f.format(n); } return null; } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -546,32 +542,13 @@ public Field33A setComponent3(String component3) { return this; } - /** - * Set the component3 from a BigDecimal object. - *
- * Parses the BigDecimal into a SWIFT amount with truncated zero decimals and mandatory decimal separator. - *

- * @since 9.2.7 - * - * @param component3 the BigDecimal with the Amount content to set - * @return the field object to enable build pattern - */ - public Field33A setComponent3(java.math.BigDecimal component3) { - setComponent(3, SwiftFormatUtils.getBigDecimal(component3)); - return this; - } /** * Alternative method setter for field's Amount (component 3) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10.0 becomes an Float) * * @param component3 the Number with the Amount content to set * @return the field object to enable build pattern - * @see #setAmount(java.math.BigDecimal) */ public Field33A setComponent3(java.lang.Number component3) { @@ -603,53 +580,45 @@ public Field33A setAmount(String component3) { return setComponent3(component3); } - /** - * Set the Amount (component 3) from a BigDecimal object. - * - * @see #setComponent3(java.math.BigDecimal) - * - * @param component3 BigDecimal with the Amount content to set - * @return the field object to enable build pattern - * @since 9.2.7 - */ - public Field33A setAmount(java.math.BigDecimal component3) { - return setComponent3(component3); - } - /** * Alternative method setter for field's Amount (component 3) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10 becomes an Integer) * * @param component3 the Number with the Amount content to set * @return the field object to enable build pattern - * @see #setAmount(java.math.BigDecimal) */ public Field33A setAmount(java.lang.Number component3) { return setComponent3(component3); } + @Override public List currencyStrings() { return MonetaryAmountResolver.currencyStrings(this); } + @Override public List currencies() { return MonetaryAmountResolver.currencies(this); } + @Override public Currency currency() { return MonetaryAmountResolver.resolveCurrency(this); } + @Override public String currencyString() { return MonetaryAmountResolver.resolveCurrencyString(this); } + @Override public void initializeCurrencies(String cur) { MonetaryAmountResolver.resolveSetCurrency(this, cur); } + @Override public void initializeCurrencies(Currency cur) { MonetaryAmountResolver.resolveSetCurrency(this, cur); } @@ -670,6 +639,7 @@ public List amounts() { * @return the first amount as BigDecimal value. Can be null * @see MonetaryAmountResolver#amount(Field) */ + @Override public BigDecimal amount() { return MonetaryAmountResolver.amount(this); } @@ -679,6 +649,7 @@ public BigDecimal amount() { * * @return the list of converted components (a Calendar object or null) */ + @Override public List dates() { return DateResolver.dates(this); } @@ -756,7 +727,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field33A(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field33C.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field33C.java index a52ceb85c..3be85ff95 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field33C.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field33C.java @@ -37,12 +37,9 @@ import com.prowidesoftware.swift.model.field.DateContainer; import com.prowidesoftware.swift.model.field.DateResolver; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -225,21 +222,20 @@ public String getValueDisplay(int component, Locale locale) { //default format (as is) return getComponent(2); } - if (component == 3) { - //amount, rate - java.text.NumberFormat f = java.text.NumberFormat.getNumberInstance(notNull(locale)); - f.setMaximumFractionDigits(13); - BigDecimal n = getComponent3AsBigDecimal(); - if (n != null) { - return f.format(n); - } + // This is the last component, return directly without `if` + //amount, rate + java.text.NumberFormat f = java.text.NumberFormat.getNumberInstance(notNull(locale)); + f.setMaximumFractionDigits(13); + BigDecimal n = getComponent3AsBigDecimal(); + if (n != null) { + return f.format(n); } return null; } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -546,32 +542,13 @@ public Field33C setComponent3(String component3) { return this; } - /** - * Set the component3 from a BigDecimal object. - *
- * Parses the BigDecimal into a SWIFT amount with truncated zero decimals and mandatory decimal separator. - *

- * @since 9.2.7 - * - * @param component3 the BigDecimal with the Amount content to set - * @return the field object to enable build pattern - */ - public Field33C setComponent3(java.math.BigDecimal component3) { - setComponent(3, SwiftFormatUtils.getBigDecimal(component3)); - return this; - } /** * Alternative method setter for field's Amount (component 3) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10.0 becomes an Float) * * @param component3 the Number with the Amount content to set * @return the field object to enable build pattern - * @see #setAmount(java.math.BigDecimal) */ public Field33C setComponent3(java.lang.Number component3) { @@ -603,53 +580,45 @@ public Field33C setAmount(String component3) { return setComponent3(component3); } - /** - * Set the Amount (component 3) from a BigDecimal object. - * - * @see #setComponent3(java.math.BigDecimal) - * - * @param component3 BigDecimal with the Amount content to set - * @return the field object to enable build pattern - * @since 9.2.7 - */ - public Field33C setAmount(java.math.BigDecimal component3) { - return setComponent3(component3); - } - /** * Alternative method setter for field's Amount (component 3) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10 becomes an Integer) * * @param component3 the Number with the Amount content to set * @return the field object to enable build pattern - * @see #setAmount(java.math.BigDecimal) */ public Field33C setAmount(java.lang.Number component3) { return setComponent3(component3); } + @Override public List currencyStrings() { return MonetaryAmountResolver.currencyStrings(this); } + @Override public List currencies() { return MonetaryAmountResolver.currencies(this); } + @Override public Currency currency() { return MonetaryAmountResolver.resolveCurrency(this); } + @Override public String currencyString() { return MonetaryAmountResolver.resolveCurrencyString(this); } + @Override public void initializeCurrencies(String cur) { MonetaryAmountResolver.resolveSetCurrency(this, cur); } + @Override public void initializeCurrencies(Currency cur) { MonetaryAmountResolver.resolveSetCurrency(this, cur); } @@ -670,6 +639,7 @@ public List amounts() { * @return the first amount as BigDecimal value. Can be null * @see MonetaryAmountResolver#amount(Field) */ + @Override public BigDecimal amount() { return MonetaryAmountResolver.amount(this); } @@ -679,6 +649,7 @@ public BigDecimal amount() { * * @return the list of converted components (a Calendar object or null) */ + @Override public List dates() { return DateResolver.dates(this); } @@ -756,7 +727,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field33C(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field33D.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field33D.java index 6edf915a2..a7943fe1f 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field33D.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field33D.java @@ -37,12 +37,9 @@ import com.prowidesoftware.swift.model.field.DateContainer; import com.prowidesoftware.swift.model.field.DateResolver; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -225,21 +222,20 @@ public String getValueDisplay(int component, Locale locale) { //default format (as is) return getComponent(2); } - if (component == 3) { - //amount, rate - java.text.NumberFormat f = java.text.NumberFormat.getNumberInstance(notNull(locale)); - f.setMaximumFractionDigits(13); - BigDecimal n = getComponent3AsBigDecimal(); - if (n != null) { - return f.format(n); - } + // This is the last component, return directly without `if` + //amount, rate + java.text.NumberFormat f = java.text.NumberFormat.getNumberInstance(notNull(locale)); + f.setMaximumFractionDigits(13); + BigDecimal n = getComponent3AsBigDecimal(); + if (n != null) { + return f.format(n); } return null; } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -546,32 +542,13 @@ public Field33D setComponent3(String component3) { return this; } - /** - * Set the component3 from a BigDecimal object. - *
- * Parses the BigDecimal into a SWIFT amount with truncated zero decimals and mandatory decimal separator. - *

- * @since 9.2.7 - * - * @param component3 the BigDecimal with the Amount content to set - * @return the field object to enable build pattern - */ - public Field33D setComponent3(java.math.BigDecimal component3) { - setComponent(3, SwiftFormatUtils.getBigDecimal(component3)); - return this; - } /** * Alternative method setter for field's Amount (component 3) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10.0 becomes an Float) * * @param component3 the Number with the Amount content to set * @return the field object to enable build pattern - * @see #setAmount(java.math.BigDecimal) */ public Field33D setComponent3(java.lang.Number component3) { @@ -603,53 +580,45 @@ public Field33D setAmount(String component3) { return setComponent3(component3); } - /** - * Set the Amount (component 3) from a BigDecimal object. - * - * @see #setComponent3(java.math.BigDecimal) - * - * @param component3 BigDecimal with the Amount content to set - * @return the field object to enable build pattern - * @since 9.2.7 - */ - public Field33D setAmount(java.math.BigDecimal component3) { - return setComponent3(component3); - } - /** * Alternative method setter for field's Amount (component 3) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10 becomes an Integer) * * @param component3 the Number with the Amount content to set * @return the field object to enable build pattern - * @see #setAmount(java.math.BigDecimal) */ public Field33D setAmount(java.lang.Number component3) { return setComponent3(component3); } + @Override public List currencyStrings() { return MonetaryAmountResolver.currencyStrings(this); } + @Override public List currencies() { return MonetaryAmountResolver.currencies(this); } + @Override public Currency currency() { return MonetaryAmountResolver.resolveCurrency(this); } + @Override public String currencyString() { return MonetaryAmountResolver.resolveCurrencyString(this); } + @Override public void initializeCurrencies(String cur) { MonetaryAmountResolver.resolveSetCurrency(this, cur); } + @Override public void initializeCurrencies(Currency cur) { MonetaryAmountResolver.resolveSetCurrency(this, cur); } @@ -670,6 +639,7 @@ public List amounts() { * @return the first amount as BigDecimal value. Can be null * @see MonetaryAmountResolver#amount(Field) */ + @Override public BigDecimal amount() { return MonetaryAmountResolver.amount(this); } @@ -679,6 +649,7 @@ public BigDecimal amount() { * * @return the list of converted components (a Calendar object or null) */ + @Override public List dates() { return DateResolver.dates(this); } @@ -756,7 +727,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field33D(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field33E.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field33E.java index a445cca50..70bf8eabf 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field33E.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field33E.java @@ -34,12 +34,9 @@ import com.prowidesoftware.swift.model.field.MonetaryAmountContainer; import com.prowidesoftware.swift.model.field.MonetaryAmountResolver; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -202,21 +199,20 @@ public String getValueDisplay(int component, Locale locale) { //default format (as is) return getComponent(1); } - if (component == 2) { - //amount, rate - java.text.NumberFormat f = java.text.NumberFormat.getNumberInstance(notNull(locale)); - f.setMaximumFractionDigits(13); - BigDecimal n = getComponent2AsBigDecimal(); - if (n != null) { - return f.format(n); - } + // This is the last component, return directly without `if` + //amount, rate + java.text.NumberFormat f = java.text.NumberFormat.getNumberInstance(notNull(locale)); + f.setMaximumFractionDigits(13); + BigDecimal n = getComponent2AsBigDecimal(); + if (n != null) { + return f.format(n); } return null; } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -443,32 +439,13 @@ public Field33E setComponent2(String component2) { return this; } - /** - * Set the component2 from a BigDecimal object. - *
- * Parses the BigDecimal into a SWIFT amount with truncated zero decimals and mandatory decimal separator. - *

- * @since 9.2.7 - * - * @param component2 the BigDecimal with the Amount content to set - * @return the field object to enable build pattern - */ - public Field33E setComponent2(java.math.BigDecimal component2) { - setComponent(2, SwiftFormatUtils.getBigDecimal(component2)); - return this; - } /** * Alternative method setter for field's Amount (component 2) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10.0 becomes an Float) * * @param component2 the Number with the Amount content to set * @return the field object to enable build pattern - * @see #setAmount(java.math.BigDecimal) */ public Field33E setComponent2(java.lang.Number component2) { @@ -500,53 +477,45 @@ public Field33E setAmount(String component2) { return setComponent2(component2); } - /** - * Set the Amount (component 2) from a BigDecimal object. - * - * @see #setComponent2(java.math.BigDecimal) - * - * @param component2 BigDecimal with the Amount content to set - * @return the field object to enable build pattern - * @since 9.2.7 - */ - public Field33E setAmount(java.math.BigDecimal component2) { - return setComponent2(component2); - } - /** * Alternative method setter for field's Amount (component 2) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10 becomes an Integer) * * @param component2 the Number with the Amount content to set * @return the field object to enable build pattern - * @see #setAmount(java.math.BigDecimal) */ public Field33E setAmount(java.lang.Number component2) { return setComponent2(component2); } + @Override public List currencyStrings() { return MonetaryAmountResolver.currencyStrings(this); } + @Override public List currencies() { return MonetaryAmountResolver.currencies(this); } + @Override public Currency currency() { return MonetaryAmountResolver.resolveCurrency(this); } + @Override public String currencyString() { return MonetaryAmountResolver.resolveCurrencyString(this); } + @Override public void initializeCurrencies(String cur) { MonetaryAmountResolver.resolveSetCurrency(this, cur); } + @Override public void initializeCurrencies(Currency cur) { MonetaryAmountResolver.resolveSetCurrency(this, cur); } @@ -567,6 +536,7 @@ public List amounts() { * @return the first amount as BigDecimal value. Can be null * @see MonetaryAmountResolver#amount(Field) */ + @Override public BigDecimal amount() { return MonetaryAmountResolver.amount(this); } @@ -635,7 +605,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field33E(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field33F.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field33F.java index 1b673c745..c77091b43 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field33F.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field33F.java @@ -34,12 +34,9 @@ import com.prowidesoftware.swift.model.field.MonetaryAmountContainer; import com.prowidesoftware.swift.model.field.MonetaryAmountResolver; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -202,21 +199,20 @@ public String getValueDisplay(int component, Locale locale) { //default format (as is) return getComponent(1); } - if (component == 2) { - //amount, rate - java.text.NumberFormat f = java.text.NumberFormat.getNumberInstance(notNull(locale)); - f.setMaximumFractionDigits(13); - BigDecimal n = getComponent2AsBigDecimal(); - if (n != null) { - return f.format(n); - } + // This is the last component, return directly without `if` + //amount, rate + java.text.NumberFormat f = java.text.NumberFormat.getNumberInstance(notNull(locale)); + f.setMaximumFractionDigits(13); + BigDecimal n = getComponent2AsBigDecimal(); + if (n != null) { + return f.format(n); } return null; } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -443,32 +439,13 @@ public Field33F setComponent2(String component2) { return this; } - /** - * Set the component2 from a BigDecimal object. - *
- * Parses the BigDecimal into a SWIFT amount with truncated zero decimals and mandatory decimal separator. - *

- * @since 9.2.7 - * - * @param component2 the BigDecimal with the Amount content to set - * @return the field object to enable build pattern - */ - public Field33F setComponent2(java.math.BigDecimal component2) { - setComponent(2, SwiftFormatUtils.getBigDecimal(component2)); - return this; - } /** * Alternative method setter for field's Amount (component 2) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10.0 becomes an Float) * * @param component2 the Number with the Amount content to set * @return the field object to enable build pattern - * @see #setAmount(java.math.BigDecimal) */ public Field33F setComponent2(java.lang.Number component2) { @@ -500,53 +477,45 @@ public Field33F setAmount(String component2) { return setComponent2(component2); } - /** - * Set the Amount (component 2) from a BigDecimal object. - * - * @see #setComponent2(java.math.BigDecimal) - * - * @param component2 BigDecimal with the Amount content to set - * @return the field object to enable build pattern - * @since 9.2.7 - */ - public Field33F setAmount(java.math.BigDecimal component2) { - return setComponent2(component2); - } - /** * Alternative method setter for field's Amount (component 2) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10 becomes an Integer) * * @param component2 the Number with the Amount content to set * @return the field object to enable build pattern - * @see #setAmount(java.math.BigDecimal) */ public Field33F setAmount(java.lang.Number component2) { return setComponent2(component2); } + @Override public List currencyStrings() { return MonetaryAmountResolver.currencyStrings(this); } + @Override public List currencies() { return MonetaryAmountResolver.currencies(this); } + @Override public Currency currency() { return MonetaryAmountResolver.resolveCurrency(this); } + @Override public String currencyString() { return MonetaryAmountResolver.resolveCurrencyString(this); } + @Override public void initializeCurrencies(String cur) { MonetaryAmountResolver.resolveSetCurrency(this, cur); } + @Override public void initializeCurrencies(Currency cur) { MonetaryAmountResolver.resolveSetCurrency(this, cur); } @@ -567,6 +536,7 @@ public List amounts() { * @return the first amount as BigDecimal value. Can be null * @see MonetaryAmountResolver#amount(Field) */ + @Override public BigDecimal amount() { return MonetaryAmountResolver.amount(this); } @@ -635,7 +605,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field33F(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field33H.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field33H.java index ab04d3c42..c94f3d25c 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field33H.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field33H.java @@ -34,12 +34,9 @@ import com.prowidesoftware.swift.model.field.MonetaryAmountContainer; import com.prowidesoftware.swift.model.field.MonetaryAmountResolver; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -202,21 +199,20 @@ public String getValueDisplay(int component, Locale locale) { //default format (as is) return getComponent(1); } - if (component == 2) { - //amount, rate - java.text.NumberFormat f = java.text.NumberFormat.getNumberInstance(notNull(locale)); - f.setMaximumFractionDigits(13); - BigDecimal n = getComponent2AsBigDecimal(); - if (n != null) { - return f.format(n); - } + // This is the last component, return directly without `if` + //amount, rate + java.text.NumberFormat f = java.text.NumberFormat.getNumberInstance(notNull(locale)); + f.setMaximumFractionDigits(13); + BigDecimal n = getComponent2AsBigDecimal(); + if (n != null) { + return f.format(n); } return null; } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -443,32 +439,13 @@ public Field33H setComponent2(String component2) { return this; } - /** - * Set the component2 from a BigDecimal object. - *
- * Parses the BigDecimal into a SWIFT amount with truncated zero decimals and mandatory decimal separator. - *

- * @since 9.2.7 - * - * @param component2 the BigDecimal with the Amount content to set - * @return the field object to enable build pattern - */ - public Field33H setComponent2(java.math.BigDecimal component2) { - setComponent(2, SwiftFormatUtils.getBigDecimal(component2)); - return this; - } /** * Alternative method setter for field's Amount (component 2) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10.0 becomes an Float) * * @param component2 the Number with the Amount content to set * @return the field object to enable build pattern - * @see #setAmount(java.math.BigDecimal) */ public Field33H setComponent2(java.lang.Number component2) { @@ -500,53 +477,45 @@ public Field33H setAmount(String component2) { return setComponent2(component2); } - /** - * Set the Amount (component 2) from a BigDecimal object. - * - * @see #setComponent2(java.math.BigDecimal) - * - * @param component2 BigDecimal with the Amount content to set - * @return the field object to enable build pattern - * @since 9.2.7 - */ - public Field33H setAmount(java.math.BigDecimal component2) { - return setComponent2(component2); - } - /** * Alternative method setter for field's Amount (component 2) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10 becomes an Integer) * * @param component2 the Number with the Amount content to set * @return the field object to enable build pattern - * @see #setAmount(java.math.BigDecimal) */ public Field33H setAmount(java.lang.Number component2) { return setComponent2(component2); } + @Override public List currencyStrings() { return MonetaryAmountResolver.currencyStrings(this); } + @Override public List currencies() { return MonetaryAmountResolver.currencies(this); } + @Override public Currency currency() { return MonetaryAmountResolver.resolveCurrency(this); } + @Override public String currencyString() { return MonetaryAmountResolver.resolveCurrencyString(this); } + @Override public void initializeCurrencies(String cur) { MonetaryAmountResolver.resolveSetCurrency(this, cur); } + @Override public void initializeCurrencies(Currency cur) { MonetaryAmountResolver.resolveSetCurrency(this, cur); } @@ -567,6 +536,7 @@ public List amounts() { * @return the first amount as BigDecimal value. Can be null * @see MonetaryAmountResolver#amount(Field) */ + @Override public BigDecimal amount() { return MonetaryAmountResolver.amount(this); } @@ -635,7 +605,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field33H(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field33J.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field33J.java index bc7cf4789..a5b616c6d 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field33J.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field33J.java @@ -33,12 +33,9 @@ import com.prowidesoftware.swift.model.field.AmountContainer; import com.prowidesoftware.swift.model.field.AmountResolver; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -202,21 +199,20 @@ public String getValueDisplay(int component, Locale locale) { //default format (as is) return getComponent(1); } - if (component == 2) { - //amount, rate - java.text.NumberFormat f = java.text.NumberFormat.getNumberInstance(notNull(locale)); - f.setMaximumFractionDigits(13); - BigDecimal n = getComponent2AsBigDecimal(); - if (n != null) { - return f.format(n); - } + // This is the last component, return directly without `if` + //amount, rate + java.text.NumberFormat f = java.text.NumberFormat.getNumberInstance(notNull(locale)); + f.setMaximumFractionDigits(13); + BigDecimal n = getComponent2AsBigDecimal(); + if (n != null) { + return f.format(n); } return null; } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -406,32 +402,13 @@ public Field33J setComponent2(String component2) { return this; } - /** - * Set the component2 from a BigDecimal object. - *
- * Parses the BigDecimal into a SWIFT amount with truncated zero decimals and mandatory decimal separator. - *

- * @since 9.2.7 - * - * @param component2 the BigDecimal with the Amount content to set - * @return the field object to enable build pattern - */ - public Field33J setComponent2(java.math.BigDecimal component2) { - setComponent(2, SwiftFormatUtils.getBigDecimal(component2)); - return this; - } /** * Alternative method setter for field's Amount (component 2) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10.0 becomes an Float) * * @param component2 the Number with the Amount content to set * @return the field object to enable build pattern - * @see #setAmount(java.math.BigDecimal) */ public Field33J setComponent2(java.lang.Number component2) { @@ -463,27 +440,13 @@ public Field33J setAmount(String component2) { return setComponent2(component2); } - /** - * Set the Amount (component 2) from a BigDecimal object. - * - * @see #setComponent2(java.math.BigDecimal) - * - * @param component2 BigDecimal with the Amount content to set - * @return the field object to enable build pattern - * @since 9.2.7 - */ - public Field33J setAmount(java.math.BigDecimal component2) { - return setComponent2(component2); - } - /** * Alternative method setter for field's Amount (component 2) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10 becomes an Integer) * * @param component2 the Number with the Amount content to set * @return the field object to enable build pattern - * @see #setAmount(java.math.BigDecimal) */ public Field33J setAmount(java.lang.Number component2) { return setComponent2(component2); @@ -506,6 +469,7 @@ public List amounts() { * @return the first amount as BigDecimal value. Can be null * @see AmountResolver#amount(Field) */ + @Override public BigDecimal amount() { return AmountResolver.amount(this); } @@ -574,7 +538,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field33J(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field33S.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field33S.java index 7073dfe72..07ab8477b 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field33S.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field33S.java @@ -33,12 +33,9 @@ import com.prowidesoftware.swift.model.field.AmountContainer; import com.prowidesoftware.swift.model.field.AmountResolver; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -202,21 +199,20 @@ public String getValueDisplay(int component, Locale locale) { //default format (as is) return getComponent(1); } - if (component == 2) { - //amount, rate - java.text.NumberFormat f = java.text.NumberFormat.getNumberInstance(notNull(locale)); - f.setMaximumFractionDigits(13); - BigDecimal n = getComponent2AsBigDecimal(); - if (n != null) { - return f.format(n); - } + // This is the last component, return directly without `if` + //amount, rate + java.text.NumberFormat f = java.text.NumberFormat.getNumberInstance(notNull(locale)); + f.setMaximumFractionDigits(13); + BigDecimal n = getComponent2AsBigDecimal(); + if (n != null) { + return f.format(n); } return null; } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -406,32 +402,13 @@ public Field33S setComponent2(String component2) { return this; } - /** - * Set the component2 from a BigDecimal object. - *
- * Parses the BigDecimal into a SWIFT amount with truncated zero decimals and mandatory decimal separator. - *

- * @since 9.2.7 - * - * @param component2 the BigDecimal with the Amount content to set - * @return the field object to enable build pattern - */ - public Field33S setComponent2(java.math.BigDecimal component2) { - setComponent(2, SwiftFormatUtils.getBigDecimal(component2)); - return this; - } /** * Alternative method setter for field's Amount (component 2) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10.0 becomes an Float) * * @param component2 the Number with the Amount content to set * @return the field object to enable build pattern - * @see #setAmount(java.math.BigDecimal) */ public Field33S setComponent2(java.lang.Number component2) { @@ -463,27 +440,13 @@ public Field33S setAmount(String component2) { return setComponent2(component2); } - /** - * Set the Amount (component 2) from a BigDecimal object. - * - * @see #setComponent2(java.math.BigDecimal) - * - * @param component2 BigDecimal with the Amount content to set - * @return the field object to enable build pattern - * @since 9.2.7 - */ - public Field33S setAmount(java.math.BigDecimal component2) { - return setComponent2(component2); - } - /** * Alternative method setter for field's Amount (component 2) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10 becomes an Integer) * * @param component2 the Number with the Amount content to set * @return the field object to enable build pattern - * @see #setAmount(java.math.BigDecimal) */ public Field33S setAmount(java.lang.Number component2) { return setComponent2(component2); @@ -506,6 +469,7 @@ public List amounts() { * @return the first amount as BigDecimal value. Can be null * @see AmountResolver#amount(Field) */ + @Override public BigDecimal amount() { return AmountResolver.amount(this); } @@ -574,7 +538,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field33S(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field33Z.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field33Z.java index 5fee20ae6..4b83d6bb1 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field33Z.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field33Z.java @@ -33,12 +33,9 @@ import com.prowidesoftware.swift.model.field.AmountContainer; import com.prowidesoftware.swift.model.field.AmountResolver; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -187,24 +184,22 @@ public String getValue() { */ @Override public String getValueDisplay(int component, Locale locale) { - if (component < 1 || component > 1) { + if (component != 1) { throw new IllegalArgumentException("invalid component number " + component + " for field 33Z"); } - if (component == 1) { - //amount, rate - java.text.NumberFormat f = java.text.NumberFormat.getNumberInstance(notNull(locale)); - f.setMaximumFractionDigits(13); - BigDecimal n = getComponent1AsBigDecimal(); - if (n != null) { - return f.format(n); - } + //amount, rate + java.text.NumberFormat f = java.text.NumberFormat.getNumberInstance(notNull(locale)); + f.setMaximumFractionDigits(13); + BigDecimal n = getComponent1AsBigDecimal(); + if (n != null) { + return f.format(n); } return null; } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -351,32 +346,13 @@ public Field33Z setComponent1(String component1) { return this; } - /** - * Set the component1 from a BigDecimal object. - *
- * Parses the BigDecimal into a SWIFT amount with truncated zero decimals and mandatory decimal separator. - *

- * @since 9.2.7 - * - * @param component1 the BigDecimal with the Amount content to set - * @return the field object to enable build pattern - */ - public Field33Z setComponent1(java.math.BigDecimal component1) { - setComponent(1, SwiftFormatUtils.getBigDecimal(component1)); - return this; - } /** * Alternative method setter for field's Amount (component 1) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10.0 becomes an Float) * * @param component1 the Number with the Amount content to set * @return the field object to enable build pattern - * @see #setAmount(java.math.BigDecimal) */ public Field33Z setComponent1(java.lang.Number component1) { @@ -408,27 +384,13 @@ public Field33Z setAmount(String component1) { return setComponent1(component1); } - /** - * Set the Amount (component 1) from a BigDecimal object. - * - * @see #setComponent1(java.math.BigDecimal) - * - * @param component1 BigDecimal with the Amount content to set - * @return the field object to enable build pattern - * @since 9.2.7 - */ - public Field33Z setAmount(java.math.BigDecimal component1) { - return setComponent1(component1); - } - /** * Alternative method setter for field's Amount (component 1) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10 becomes an Integer) * * @param component1 the Number with the Amount content to set * @return the field object to enable build pattern - * @see #setAmount(java.math.BigDecimal) */ public Field33Z setAmount(java.lang.Number component1) { return setComponent1(component1); @@ -451,6 +413,7 @@ public List amounts() { * @return the first amount as BigDecimal value. Can be null * @see AmountResolver#amount(Field) */ + @Override public BigDecimal amount() { return AmountResolver.amount(this); } @@ -519,7 +482,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field33Z(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field340.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field340.java index a245834a8..9d16386ad 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field340.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field340.java @@ -29,12 +29,9 @@ -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -201,16 +198,14 @@ public String getValueDisplay(int component, Locale locale) { //default format (as is) return getComponent(1); } - if (component == 2) { - //default format (as is) - return getComponent(2); - } - return null; + // This is the last component, return directly without `if` + //default format (as is) + return getComponent(2); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -453,7 +448,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field340(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field341.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field341.java index 97b71b386..739e98e74 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field341.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field341.java @@ -29,12 +29,9 @@ -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -183,19 +180,16 @@ public String getValue() { */ @Override public String getValueDisplay(int component, Locale locale) { - if (component < 1 || component > 1) { + if (component != 1) { throw new IllegalArgumentException("invalid component number " + component + " for field 341"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -398,7 +392,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field341(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field342.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field342.java index 48f3118d1..134410958 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field342.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field342.java @@ -30,12 +30,9 @@ import java.util.Calendar; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -204,20 +201,19 @@ public String getValueDisplay(int component, Locale locale) { //default format (as is) return getComponent(1); } - if (component == 2) { - //time: HH[mm] - java.text.DateFormat f = new java.text.SimpleDateFormat("HH:mm", notNull(locale)); - java.util.Calendar cal = getComponent2AsCalendar(); - if (cal != null) { - return f.format(cal.getTime()); - } + // This is the last component, return directly without `if` + //time: HH[mm] + java.text.DateFormat f = new java.text.SimpleDateFormat("HH:mm", notNull(locale)); + java.util.Calendar cal = getComponent2AsCalendar(); + if (cal != null) { + return f.format(cal.getTime()); } return null; } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -500,7 +496,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field342(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field343.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field343.java index d6aa7bab3..e5b07e162 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field343.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field343.java @@ -31,12 +31,9 @@ import java.math.BigInteger; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -231,16 +228,14 @@ public String getValueDisplay(int component, Locale locale) { //default format (as is) return getComponent(3); } - if (component == 4) { - //default format (as is) - return getComponent(4); - } - return null; + // This is the last component, return directly without `if` + //default format (as is) + return getComponent(4); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -501,32 +496,14 @@ public Field343 setComponent1(String component1) { return this; } - /** - * Set the component1 from a Long object. - *
- * If the component being set is a fixed length number, the argument will not be - * padded. It is recommended for these cases to use the setComponent1(String) - * method. - * - * @see #setComponent1(String) - * @since 9.2.7 - * - * @param component1 the Long with the Region Time Count 1 content to set - * @return the field object to enable build pattern - */ - public Field343 setComponent1(java.lang.Long component1) { - setComponent(1, SwiftFormatUtils.getLong(component1)); - return this; - } /** * Alternative method setter for field's Region Time Count 1 (component 1) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10 becomes an Integer) * * @param component1 the Number with the Region Time Count 1 content to set * @return the field object to enable build pattern - * @see #setRegionTimeCount1(java.lang.Long) */ public Field343 setComponent1(java.lang.Number component1) { @@ -556,27 +533,13 @@ public Field343 setRegionTimeCount1(String component1) { return setComponent1(component1); } - /** - * Set the Region Time Count 1 (component 1) from a Long object. - * - * @see #setComponent1(java.lang.Long) - * - * @param component1 Long with the Region Time Count 1 content to set - * @return the field object to enable build pattern - * @since 9.2.7 - */ - public Field343 setRegionTimeCount1(java.lang.Long component1) { - return setComponent1(component1); - } - /** * Alternative method setter for field's Region Time Count 1 (component 1) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10 becomes an Integer) * * @param component1 the Number with the Region Time Count 1 content to set * @return the field object to enable build pattern - * @see #setRegionTimeCount1(java.lang.Long) */ public Field343 setRegionTimeCount1(java.lang.Number component1) { return setComponent1(component1); @@ -593,32 +556,14 @@ public Field343 setComponent2(String component2) { return this; } - /** - * Set the component2 from a Long object. - *
- * If the component being set is a fixed length number, the argument will not be - * padded. It is recommended for these cases to use the setComponent2(String) - * method. - * - * @see #setComponent2(String) - * @since 9.2.7 - * - * @param component2 the Long with the Region Time Count 2 content to set - * @return the field object to enable build pattern - */ - public Field343 setComponent2(java.lang.Long component2) { - setComponent(2, SwiftFormatUtils.getLong(component2)); - return this; - } /** * Alternative method setter for field's Region Time Count 2 (component 2) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10 becomes an Integer) * * @param component2 the Number with the Region Time Count 2 content to set * @return the field object to enable build pattern - * @see #setRegionTimeCount2(java.lang.Long) */ public Field343 setComponent2(java.lang.Number component2) { @@ -648,27 +593,13 @@ public Field343 setRegionTimeCount2(String component2) { return setComponent2(component2); } - /** - * Set the Region Time Count 2 (component 2) from a Long object. - * - * @see #setComponent2(java.lang.Long) - * - * @param component2 Long with the Region Time Count 2 content to set - * @return the field object to enable build pattern - * @since 9.2.7 - */ - public Field343 setRegionTimeCount2(java.lang.Long component2) { - return setComponent2(component2); - } - /** * Alternative method setter for field's Region Time Count 2 (component 2) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10 becomes an Integer) * * @param component2 the Number with the Region Time Count 2 content to set * @return the field object to enable build pattern - * @see #setRegionTimeCount2(java.lang.Long) */ public Field343 setRegionTimeCount2(java.lang.Number component2) { return setComponent2(component2); @@ -685,32 +616,14 @@ public Field343 setComponent3(String component3) { return this; } - /** - * Set the component3 from a Long object. - *
- * If the component being set is a fixed length number, the argument will not be - * padded. It is recommended for these cases to use the setComponent3(String) - * method. - * - * @see #setComponent3(String) - * @since 9.2.7 - * - * @param component3 the Long with the Region Time Count 3 content to set - * @return the field object to enable build pattern - */ - public Field343 setComponent3(java.lang.Long component3) { - setComponent(3, SwiftFormatUtils.getLong(component3)); - return this; - } /** * Alternative method setter for field's Region Time Count 3 (component 3) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10 becomes an Integer) * * @param component3 the Number with the Region Time Count 3 content to set * @return the field object to enable build pattern - * @see #setRegionTimeCount3(java.lang.Long) */ public Field343 setComponent3(java.lang.Number component3) { @@ -740,27 +653,13 @@ public Field343 setRegionTimeCount3(String component3) { return setComponent3(component3); } - /** - * Set the Region Time Count 3 (component 3) from a Long object. - * - * @see #setComponent3(java.lang.Long) - * - * @param component3 Long with the Region Time Count 3 content to set - * @return the field object to enable build pattern - * @since 9.2.7 - */ - public Field343 setRegionTimeCount3(java.lang.Long component3) { - return setComponent3(component3); - } - /** * Alternative method setter for field's Region Time Count 3 (component 3) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10 becomes an Integer) * * @param component3 the Number with the Region Time Count 3 content to set * @return the field object to enable build pattern - * @see #setRegionTimeCount3(java.lang.Long) */ public Field343 setRegionTimeCount3(java.lang.Number component3) { return setComponent3(component3); @@ -777,32 +676,14 @@ public Field343 setComponent4(String component4) { return this; } - /** - * Set the component4 from a Long object. - *
- * If the component being set is a fixed length number, the argument will not be - * padded. It is recommended for these cases to use the setComponent4(String) - * method. - * - * @see #setComponent4(String) - * @since 9.2.7 - * - * @param component4 the Long with the Region Time Count 4 content to set - * @return the field object to enable build pattern - */ - public Field343 setComponent4(java.lang.Long component4) { - setComponent(4, SwiftFormatUtils.getLong(component4)); - return this; - } /** * Alternative method setter for field's Region Time Count 4 (component 4) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10 becomes an Integer) * * @param component4 the Number with the Region Time Count 4 content to set * @return the field object to enable build pattern - * @see #setRegionTimeCount4(java.lang.Long) */ public Field343 setComponent4(java.lang.Number component4) { @@ -832,27 +713,13 @@ public Field343 setRegionTimeCount4(String component4) { return setComponent4(component4); } - /** - * Set the Region Time Count 4 (component 4) from a Long object. - * - * @see #setComponent4(java.lang.Long) - * - * @param component4 Long with the Region Time Count 4 content to set - * @return the field object to enable build pattern - * @since 9.2.7 - */ - public Field343 setRegionTimeCount4(java.lang.Long component4) { - return setComponent4(component4); - } - /** * Alternative method setter for field's Region Time Count 4 (component 4) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10 becomes an Integer) * * @param component4 the Number with the Region Time Count 4 content to set * @return the field object to enable build pattern - * @see #setRegionTimeCount4(java.lang.Long) */ public Field343 setRegionTimeCount4(java.lang.Number component4) { return setComponent4(component4); @@ -923,7 +790,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field343(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field344.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field344.java index c1b3eb96f..7f79dc851 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field344.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field344.java @@ -31,12 +31,9 @@ import java.math.BigInteger; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -206,16 +203,14 @@ public String getValueDisplay(int component, Locale locale) { //default format (as is) return getComponent(1); } - if (component == 2) { - //default format (as is) - return getComponent(2); - } - return null; + // This is the last component, return directly without `if` + //default format (as is) + return getComponent(2); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -402,32 +397,14 @@ public Field344 setComponent2(String component2) { return this; } - /** - * Set the component2 from a Long object. - *
- * If the component being set is a fixed length number, the argument will not be - * padded. It is recommended for these cases to use the setComponent2(String) - * method. - * - * @see #setComponent2(String) - * @since 9.2.7 - * - * @param component2 the Long with the Message Categories content to set - * @return the field object to enable build pattern - */ - public Field344 setComponent2(java.lang.Long component2) { - setComponent(2, SwiftFormatUtils.getLong(component2)); - return this; - } /** * Alternative method setter for field's Message Categories (component 2) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10 becomes an Integer) * * @param component2 the Number with the Message Categories content to set * @return the field object to enable build pattern - * @see #setMessageCategories(java.lang.Long) */ public Field344 setComponent2(java.lang.Number component2) { @@ -457,27 +434,13 @@ public Field344 setMessageCategories(String component2) { return setComponent2(component2); } - /** - * Set the Message Categories (component 2) from a Long object. - * - * @see #setComponent2(java.lang.Long) - * - * @param component2 Long with the Message Categories content to set - * @return the field object to enable build pattern - * @since 9.2.7 - */ - public Field344 setMessageCategories(java.lang.Long component2) { - return setComponent2(component2); - } - /** * Alternative method setter for field's Message Categories (component 2) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10 becomes an Integer) * * @param component2 the Number with the Message Categories content to set * @return the field object to enable build pattern - * @see #setMessageCategories(java.lang.Long) */ public Field344 setMessageCategories(java.lang.Number component2) { return setComponent2(component2); @@ -548,7 +511,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field344(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field345.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field345.java index a5f99d4ab..317087c81 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field345.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field345.java @@ -31,12 +31,9 @@ import java.math.BigInteger; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -280,16 +277,14 @@ public String getValueDisplay(int component, Locale locale) { //default format (as is) return getComponent(9); } - if (component == 10) { - //default format (as is) - return getComponent(10); - } - return null; + // This is the last component, return directly without `if` + //default format (as is) + return getComponent(10); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -852,7 +847,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field345(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field346.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field346.java index 2be22c803..fc0d1412d 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field346.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field346.java @@ -29,12 +29,9 @@ -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -278,16 +275,14 @@ public String getValueDisplay(int component, Locale locale) { //default format (as is) return getComponent(9); } - if (component == 10) { - //default format (as is) - return getComponent(10); - } - return null; + // This is the last component, return directly without `if` + //default format (as is) + return getComponent(10); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -850,7 +845,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field346(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field347.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field347.java index 2897af10a..4ff61ee01 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field347.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field347.java @@ -29,12 +29,9 @@ -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -278,16 +275,14 @@ public String getValueDisplay(int component, Locale locale) { //default format (as is) return getComponent(9); } - if (component == 10) { - //default format (as is) - return getComponent(10); - } - return null; + // This is the last component, return directly without `if` + //default format (as is) + return getComponent(10); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -850,7 +845,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field347(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field348.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field348.java index deb29e91b..8046c6023 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field348.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field348.java @@ -29,12 +29,9 @@ -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -183,19 +180,16 @@ public String getValue() { */ @Override public String getValueDisplay(int component, Locale locale) { - if (component < 1 || component > 1) { + if (component != 1) { throw new IllegalArgumentException("invalid component number " + component + " for field 348"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -398,7 +392,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field348(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field349.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field349.java index f03b6ad34..80a033f8b 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field349.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field349.java @@ -31,12 +31,9 @@ import java.math.BigInteger; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -185,19 +182,16 @@ public String getValue() { */ @Override public String getValueDisplay(int component, Locale locale) { - if (component < 1 || component > 1) { + if (component != 1) { throw new IllegalArgumentException("invalid component number " + component + " for field 349"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -344,32 +338,14 @@ public Field349 setComponent1(String component1) { return this; } - /** - * Set the component1 from a Long object. - *
- * If the component being set is a fixed length number, the argument will not be - * padded. It is recommended for these cases to use the setComponent1(String) - * method. - * - * @see #setComponent1(String) - * @since 9.2.7 - * - * @param component1 the Long with the Combined Criteria content to set - * @return the field object to enable build pattern - */ - public Field349 setComponent1(java.lang.Long component1) { - setComponent(1, SwiftFormatUtils.getLong(component1)); - return this; - } /** * Alternative method setter for field's Combined Criteria (component 1) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10 becomes an Integer) * * @param component1 the Number with the Combined Criteria content to set * @return the field object to enable build pattern - * @see #setCombinedCriteria(java.lang.Long) */ public Field349 setComponent1(java.lang.Number component1) { @@ -399,27 +375,13 @@ public Field349 setCombinedCriteria(String component1) { return setComponent1(component1); } - /** - * Set the Combined Criteria (component 1) from a Long object. - * - * @see #setComponent1(java.lang.Long) - * - * @param component1 Long with the Combined Criteria content to set - * @return the field object to enable build pattern - * @since 9.2.7 - */ - public Field349 setCombinedCriteria(java.lang.Long component1) { - return setComponent1(component1); - } - /** * Alternative method setter for field's Combined Criteria (component 1) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10 becomes an Integer) * * @param component1 the Number with the Combined Criteria content to set * @return the field object to enable build pattern - * @see #setCombinedCriteria(java.lang.Long) */ public Field349 setCombinedCriteria(java.lang.Number component1) { return setComponent1(component1); @@ -490,7 +452,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field349(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field34A.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field34A.java index 23f4716d7..58395547a 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field34A.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field34A.java @@ -37,12 +37,9 @@ import com.prowidesoftware.swift.model.field.DateContainer; import com.prowidesoftware.swift.model.field.DateResolver; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -225,21 +222,20 @@ public String getValueDisplay(int component, Locale locale) { //default format (as is) return getComponent(2); } - if (component == 3) { - //amount, rate - java.text.NumberFormat f = java.text.NumberFormat.getNumberInstance(notNull(locale)); - f.setMaximumFractionDigits(13); - BigDecimal n = getComponent3AsBigDecimal(); - if (n != null) { - return f.format(n); - } + // This is the last component, return directly without `if` + //amount, rate + java.text.NumberFormat f = java.text.NumberFormat.getNumberInstance(notNull(locale)); + f.setMaximumFractionDigits(13); + BigDecimal n = getComponent3AsBigDecimal(); + if (n != null) { + return f.format(n); } return null; } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -546,32 +542,13 @@ public Field34A setComponent3(String component3) { return this; } - /** - * Set the component3 from a BigDecimal object. - *
- * Parses the BigDecimal into a SWIFT amount with truncated zero decimals and mandatory decimal separator. - *

- * @since 9.2.7 - * - * @param component3 the BigDecimal with the Amount content to set - * @return the field object to enable build pattern - */ - public Field34A setComponent3(java.math.BigDecimal component3) { - setComponent(3, SwiftFormatUtils.getBigDecimal(component3)); - return this; - } /** * Alternative method setter for field's Amount (component 3) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10.0 becomes an Float) * * @param component3 the Number with the Amount content to set * @return the field object to enable build pattern - * @see #setAmount(java.math.BigDecimal) */ public Field34A setComponent3(java.lang.Number component3) { @@ -603,53 +580,45 @@ public Field34A setAmount(String component3) { return setComponent3(component3); } - /** - * Set the Amount (component 3) from a BigDecimal object. - * - * @see #setComponent3(java.math.BigDecimal) - * - * @param component3 BigDecimal with the Amount content to set - * @return the field object to enable build pattern - * @since 9.2.7 - */ - public Field34A setAmount(java.math.BigDecimal component3) { - return setComponent3(component3); - } - /** * Alternative method setter for field's Amount (component 3) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10 becomes an Integer) * * @param component3 the Number with the Amount content to set * @return the field object to enable build pattern - * @see #setAmount(java.math.BigDecimal) */ public Field34A setAmount(java.lang.Number component3) { return setComponent3(component3); } + @Override public List currencyStrings() { return MonetaryAmountResolver.currencyStrings(this); } + @Override public List currencies() { return MonetaryAmountResolver.currencies(this); } + @Override public Currency currency() { return MonetaryAmountResolver.resolveCurrency(this); } + @Override public String currencyString() { return MonetaryAmountResolver.resolveCurrencyString(this); } + @Override public void initializeCurrencies(String cur) { MonetaryAmountResolver.resolveSetCurrency(this, cur); } + @Override public void initializeCurrencies(Currency cur) { MonetaryAmountResolver.resolveSetCurrency(this, cur); } @@ -670,6 +639,7 @@ public List amounts() { * @return the first amount as BigDecimal value. Can be null * @see MonetaryAmountResolver#amount(Field) */ + @Override public BigDecimal amount() { return MonetaryAmountResolver.amount(this); } @@ -679,6 +649,7 @@ public BigDecimal amount() { * * @return the list of converted components (a Calendar object or null) */ + @Override public List dates() { return DateResolver.dates(this); } @@ -756,7 +727,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field34A(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field34B.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field34B.java index c83a6a476..5d5c79a22 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field34B.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field34B.java @@ -34,12 +34,9 @@ import com.prowidesoftware.swift.model.field.MonetaryAmountContainer; import com.prowidesoftware.swift.model.field.MonetaryAmountResolver; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -202,21 +199,20 @@ public String getValueDisplay(int component, Locale locale) { //default format (as is) return getComponent(1); } - if (component == 2) { - //amount, rate - java.text.NumberFormat f = java.text.NumberFormat.getNumberInstance(notNull(locale)); - f.setMaximumFractionDigits(13); - BigDecimal n = getComponent2AsBigDecimal(); - if (n != null) { - return f.format(n); - } + // This is the last component, return directly without `if` + //amount, rate + java.text.NumberFormat f = java.text.NumberFormat.getNumberInstance(notNull(locale)); + f.setMaximumFractionDigits(13); + BigDecimal n = getComponent2AsBigDecimal(); + if (n != null) { + return f.format(n); } return null; } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -443,32 +439,13 @@ public Field34B setComponent2(String component2) { return this; } - /** - * Set the component2 from a BigDecimal object. - *
- * Parses the BigDecimal into a SWIFT amount with truncated zero decimals and mandatory decimal separator. - *

- * @since 9.2.7 - * - * @param component2 the BigDecimal with the Amount content to set - * @return the field object to enable build pattern - */ - public Field34B setComponent2(java.math.BigDecimal component2) { - setComponent(2, SwiftFormatUtils.getBigDecimal(component2)); - return this; - } /** * Alternative method setter for field's Amount (component 2) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10.0 becomes an Float) * * @param component2 the Number with the Amount content to set * @return the field object to enable build pattern - * @see #setAmount(java.math.BigDecimal) */ public Field34B setComponent2(java.lang.Number component2) { @@ -500,53 +477,45 @@ public Field34B setAmount(String component2) { return setComponent2(component2); } - /** - * Set the Amount (component 2) from a BigDecimal object. - * - * @see #setComponent2(java.math.BigDecimal) - * - * @param component2 BigDecimal with the Amount content to set - * @return the field object to enable build pattern - * @since 9.2.7 - */ - public Field34B setAmount(java.math.BigDecimal component2) { - return setComponent2(component2); - } - /** * Alternative method setter for field's Amount (component 2) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10 becomes an Integer) * * @param component2 the Number with the Amount content to set * @return the field object to enable build pattern - * @see #setAmount(java.math.BigDecimal) */ public Field34B setAmount(java.lang.Number component2) { return setComponent2(component2); } + @Override public List currencyStrings() { return MonetaryAmountResolver.currencyStrings(this); } + @Override public List currencies() { return MonetaryAmountResolver.currencies(this); } + @Override public Currency currency() { return MonetaryAmountResolver.resolveCurrency(this); } + @Override public String currencyString() { return MonetaryAmountResolver.resolveCurrencyString(this); } + @Override public void initializeCurrencies(String cur) { MonetaryAmountResolver.resolveSetCurrency(this, cur); } + @Override public void initializeCurrencies(Currency cur) { MonetaryAmountResolver.resolveSetCurrency(this, cur); } @@ -567,6 +536,7 @@ public List amounts() { * @return the first amount as BigDecimal value. Can be null * @see MonetaryAmountResolver#amount(Field) */ + @Override public BigDecimal amount() { return MonetaryAmountResolver.amount(this); } @@ -635,7 +605,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field34B(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field34E.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field34E.java index df2f53a70..9819b24ee 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field34E.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field34E.java @@ -34,12 +34,9 @@ import com.prowidesoftware.swift.model.field.MonetaryAmountContainer; import com.prowidesoftware.swift.model.field.MonetaryAmountResolver; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -220,21 +217,20 @@ public String getValueDisplay(int component, Locale locale) { //default format (as is) return getComponent(2); } - if (component == 3) { - //amount, rate - java.text.NumberFormat f = java.text.NumberFormat.getNumberInstance(notNull(locale)); - f.setMaximumFractionDigits(13); - BigDecimal n = getComponent3AsBigDecimal(); - if (n != null) { - return f.format(n); - } + // This is the last component, return directly without `if` + //amount, rate + java.text.NumberFormat f = java.text.NumberFormat.getNumberInstance(notNull(locale)); + f.setMaximumFractionDigits(13); + BigDecimal n = getComponent3AsBigDecimal(); + if (n != null) { + return f.format(n); } return null; } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -504,32 +500,13 @@ public Field34E setComponent3(String component3) { return this; } - /** - * Set the component3 from a BigDecimal object. - *
- * Parses the BigDecimal into a SWIFT amount with truncated zero decimals and mandatory decimal separator. - *

- * @since 9.2.7 - * - * @param component3 the BigDecimal with the Amount content to set - * @return the field object to enable build pattern - */ - public Field34E setComponent3(java.math.BigDecimal component3) { - setComponent(3, SwiftFormatUtils.getBigDecimal(component3)); - return this; - } /** * Alternative method setter for field's Amount (component 3) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10.0 becomes an Float) * * @param component3 the Number with the Amount content to set * @return the field object to enable build pattern - * @see #setAmount(java.math.BigDecimal) */ public Field34E setComponent3(java.lang.Number component3) { @@ -561,53 +538,45 @@ public Field34E setAmount(String component3) { return setComponent3(component3); } - /** - * Set the Amount (component 3) from a BigDecimal object. - * - * @see #setComponent3(java.math.BigDecimal) - * - * @param component3 BigDecimal with the Amount content to set - * @return the field object to enable build pattern - * @since 9.2.7 - */ - public Field34E setAmount(java.math.BigDecimal component3) { - return setComponent3(component3); - } - /** * Alternative method setter for field's Amount (component 3) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10 becomes an Integer) * * @param component3 the Number with the Amount content to set * @return the field object to enable build pattern - * @see #setAmount(java.math.BigDecimal) */ public Field34E setAmount(java.lang.Number component3) { return setComponent3(component3); } + @Override public List currencyStrings() { return MonetaryAmountResolver.currencyStrings(this); } + @Override public List currencies() { return MonetaryAmountResolver.currencies(this); } + @Override public Currency currency() { return MonetaryAmountResolver.resolveCurrency(this); } + @Override public String currencyString() { return MonetaryAmountResolver.resolveCurrencyString(this); } + @Override public void initializeCurrencies(String cur) { MonetaryAmountResolver.resolveSetCurrency(this, cur); } + @Override public void initializeCurrencies(Currency cur) { MonetaryAmountResolver.resolveSetCurrency(this, cur); } @@ -628,6 +597,7 @@ public List amounts() { * @return the first amount as BigDecimal value. Can be null * @see MonetaryAmountResolver#amount(Field) */ + @Override public BigDecimal amount() { return MonetaryAmountResolver.amount(this); } @@ -696,7 +666,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field34E(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field34F.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field34F.java index 2ced62f18..2cc5aee27 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field34F.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field34F.java @@ -34,12 +34,9 @@ import com.prowidesoftware.swift.model.field.MonetaryAmountContainer; import com.prowidesoftware.swift.model.field.MonetaryAmountResolver; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -220,21 +217,20 @@ public String getValueDisplay(int component, Locale locale) { //default format (as is) return getComponent(2); } - if (component == 3) { - //amount, rate - java.text.NumberFormat f = java.text.NumberFormat.getNumberInstance(notNull(locale)); - f.setMaximumFractionDigits(13); - BigDecimal n = getComponent3AsBigDecimal(); - if (n != null) { - return f.format(n); - } + // This is the last component, return directly without `if` + //amount, rate + java.text.NumberFormat f = java.text.NumberFormat.getNumberInstance(notNull(locale)); + f.setMaximumFractionDigits(13); + BigDecimal n = getComponent3AsBigDecimal(); + if (n != null) { + return f.format(n); } return null; } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -504,32 +500,13 @@ public Field34F setComponent3(String component3) { return this; } - /** - * Set the component3 from a BigDecimal object. - *
- * Parses the BigDecimal into a SWIFT amount with truncated zero decimals and mandatory decimal separator. - *

- * @since 9.2.7 - * - * @param component3 the BigDecimal with the Amount content to set - * @return the field object to enable build pattern - */ - public Field34F setComponent3(java.math.BigDecimal component3) { - setComponent(3, SwiftFormatUtils.getBigDecimal(component3)); - return this; - } /** * Alternative method setter for field's Amount (component 3) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10.0 becomes an Float) * * @param component3 the Number with the Amount content to set * @return the field object to enable build pattern - * @see #setAmount(java.math.BigDecimal) */ public Field34F setComponent3(java.lang.Number component3) { @@ -561,53 +538,45 @@ public Field34F setAmount(String component3) { return setComponent3(component3); } - /** - * Set the Amount (component 3) from a BigDecimal object. - * - * @see #setComponent3(java.math.BigDecimal) - * - * @param component3 BigDecimal with the Amount content to set - * @return the field object to enable build pattern - * @since 9.2.7 - */ - public Field34F setAmount(java.math.BigDecimal component3) { - return setComponent3(component3); - } - /** * Alternative method setter for field's Amount (component 3) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10 becomes an Integer) * * @param component3 the Number with the Amount content to set * @return the field object to enable build pattern - * @see #setAmount(java.math.BigDecimal) */ public Field34F setAmount(java.lang.Number component3) { return setComponent3(component3); } + @Override public List currencyStrings() { return MonetaryAmountResolver.currencyStrings(this); } + @Override public List currencies() { return MonetaryAmountResolver.currencies(this); } + @Override public Currency currency() { return MonetaryAmountResolver.resolveCurrency(this); } + @Override public String currencyString() { return MonetaryAmountResolver.resolveCurrencyString(this); } + @Override public void initializeCurrencies(String cur) { MonetaryAmountResolver.resolveSetCurrency(this, cur); } + @Override public void initializeCurrencies(Currency cur) { MonetaryAmountResolver.resolveSetCurrency(this, cur); } @@ -628,6 +597,7 @@ public List amounts() { * @return the first amount as BigDecimal value. Can be null * @see MonetaryAmountResolver#amount(Field) */ + @Override public BigDecimal amount() { return MonetaryAmountResolver.amount(this); } @@ -696,7 +666,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field34F(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field34J.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field34J.java index 76b082152..8dacc365b 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field34J.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field34J.java @@ -33,12 +33,9 @@ import com.prowidesoftware.swift.model.field.AmountContainer; import com.prowidesoftware.swift.model.field.AmountResolver; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -220,21 +217,20 @@ public String getValueDisplay(int component, Locale locale) { //default format (as is) return getComponent(2); } - if (component == 3) { - //amount, rate - java.text.NumberFormat f = java.text.NumberFormat.getNumberInstance(notNull(locale)); - f.setMaximumFractionDigits(13); - BigDecimal n = getComponent3AsBigDecimal(); - if (n != null) { - return f.format(n); - } + // This is the last component, return directly without `if` + //amount, rate + java.text.NumberFormat f = java.text.NumberFormat.getNumberInstance(notNull(locale)); + f.setMaximumFractionDigits(13); + BigDecimal n = getComponent3AsBigDecimal(); + if (n != null) { + return f.format(n); } return null; } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -467,32 +463,13 @@ public Field34J setComponent3(String component3) { return this; } - /** - * Set the component3 from a BigDecimal object. - *
- * Parses the BigDecimal into a SWIFT amount with truncated zero decimals and mandatory decimal separator. - *

- * @since 9.2.7 - * - * @param component3 the BigDecimal with the Amount content to set - * @return the field object to enable build pattern - */ - public Field34J setComponent3(java.math.BigDecimal component3) { - setComponent(3, SwiftFormatUtils.getBigDecimal(component3)); - return this; - } /** * Alternative method setter for field's Amount (component 3) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10.0 becomes an Float) * * @param component3 the Number with the Amount content to set * @return the field object to enable build pattern - * @see #setAmount(java.math.BigDecimal) */ public Field34J setComponent3(java.lang.Number component3) { @@ -524,27 +501,13 @@ public Field34J setAmount(String component3) { return setComponent3(component3); } - /** - * Set the Amount (component 3) from a BigDecimal object. - * - * @see #setComponent3(java.math.BigDecimal) - * - * @param component3 BigDecimal with the Amount content to set - * @return the field object to enable build pattern - * @since 9.2.7 - */ - public Field34J setAmount(java.math.BigDecimal component3) { - return setComponent3(component3); - } - /** * Alternative method setter for field's Amount (component 3) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10 becomes an Integer) * * @param component3 the Number with the Amount content to set * @return the field object to enable build pattern - * @see #setAmount(java.math.BigDecimal) */ public Field34J setAmount(java.lang.Number component3) { return setComponent3(component3); @@ -567,6 +530,7 @@ public List amounts() { * @return the first amount as BigDecimal value. Can be null * @see AmountResolver#amount(Field) */ + @Override public BigDecimal amount() { return AmountResolver.amount(this); } @@ -635,7 +599,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field34J(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field34P.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field34P.java index afbf213dd..b86de9bc6 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field34P.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field34P.java @@ -37,12 +37,9 @@ import com.prowidesoftware.swift.model.field.DateContainer; import com.prowidesoftware.swift.model.field.DateResolver; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -225,21 +222,20 @@ public String getValueDisplay(int component, Locale locale) { //default format (as is) return getComponent(2); } - if (component == 3) { - //amount, rate - java.text.NumberFormat f = java.text.NumberFormat.getNumberInstance(notNull(locale)); - f.setMaximumFractionDigits(13); - BigDecimal n = getComponent3AsBigDecimal(); - if (n != null) { - return f.format(n); - } + // This is the last component, return directly without `if` + //amount, rate + java.text.NumberFormat f = java.text.NumberFormat.getNumberInstance(notNull(locale)); + f.setMaximumFractionDigits(13); + BigDecimal n = getComponent3AsBigDecimal(); + if (n != null) { + return f.format(n); } return null; } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -546,32 +542,13 @@ public Field34P setComponent3(String component3) { return this; } - /** - * Set the component3 from a BigDecimal object. - *
- * Parses the BigDecimal into a SWIFT amount with truncated zero decimals and mandatory decimal separator. - *

- * @since 9.2.7 - * - * @param component3 the BigDecimal with the Amount content to set - * @return the field object to enable build pattern - */ - public Field34P setComponent3(java.math.BigDecimal component3) { - setComponent(3, SwiftFormatUtils.getBigDecimal(component3)); - return this; - } /** * Alternative method setter for field's Amount (component 3) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10.0 becomes an Float) * * @param component3 the Number with the Amount content to set * @return the field object to enable build pattern - * @see #setAmount(java.math.BigDecimal) */ public Field34P setComponent3(java.lang.Number component3) { @@ -603,53 +580,45 @@ public Field34P setAmount(String component3) { return setComponent3(component3); } - /** - * Set the Amount (component 3) from a BigDecimal object. - * - * @see #setComponent3(java.math.BigDecimal) - * - * @param component3 BigDecimal with the Amount content to set - * @return the field object to enable build pattern - * @since 9.2.7 - */ - public Field34P setAmount(java.math.BigDecimal component3) { - return setComponent3(component3); - } - /** * Alternative method setter for field's Amount (component 3) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10 becomes an Integer) * * @param component3 the Number with the Amount content to set * @return the field object to enable build pattern - * @see #setAmount(java.math.BigDecimal) */ public Field34P setAmount(java.lang.Number component3) { return setComponent3(component3); } + @Override public List currencyStrings() { return MonetaryAmountResolver.currencyStrings(this); } + @Override public List currencies() { return MonetaryAmountResolver.currencies(this); } + @Override public Currency currency() { return MonetaryAmountResolver.resolveCurrency(this); } + @Override public String currencyString() { return MonetaryAmountResolver.resolveCurrencyString(this); } + @Override public void initializeCurrencies(String cur) { MonetaryAmountResolver.resolveSetCurrency(this, cur); } + @Override public void initializeCurrencies(Currency cur) { MonetaryAmountResolver.resolveSetCurrency(this, cur); } @@ -670,6 +639,7 @@ public List amounts() { * @return the first amount as BigDecimal value. Can be null * @see MonetaryAmountResolver#amount(Field) */ + @Override public BigDecimal amount() { return MonetaryAmountResolver.amount(this); } @@ -679,6 +649,7 @@ public BigDecimal amount() { * * @return the list of converted components (a Calendar object or null) */ + @Override public List dates() { return DateResolver.dates(this); } @@ -756,7 +727,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field34P(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field34R.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field34R.java index 2c90901fe..96f72a088 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field34R.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field34R.java @@ -37,12 +37,9 @@ import com.prowidesoftware.swift.model.field.DateContainer; import com.prowidesoftware.swift.model.field.DateResolver; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -225,21 +222,20 @@ public String getValueDisplay(int component, Locale locale) { //default format (as is) return getComponent(2); } - if (component == 3) { - //amount, rate - java.text.NumberFormat f = java.text.NumberFormat.getNumberInstance(notNull(locale)); - f.setMaximumFractionDigits(13); - BigDecimal n = getComponent3AsBigDecimal(); - if (n != null) { - return f.format(n); - } + // This is the last component, return directly without `if` + //amount, rate + java.text.NumberFormat f = java.text.NumberFormat.getNumberInstance(notNull(locale)); + f.setMaximumFractionDigits(13); + BigDecimal n = getComponent3AsBigDecimal(); + if (n != null) { + return f.format(n); } return null; } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -546,32 +542,13 @@ public Field34R setComponent3(String component3) { return this; } - /** - * Set the component3 from a BigDecimal object. - *
- * Parses the BigDecimal into a SWIFT amount with truncated zero decimals and mandatory decimal separator. - *

- * @since 9.2.7 - * - * @param component3 the BigDecimal with the Amount content to set - * @return the field object to enable build pattern - */ - public Field34R setComponent3(java.math.BigDecimal component3) { - setComponent(3, SwiftFormatUtils.getBigDecimal(component3)); - return this; - } /** * Alternative method setter for field's Amount (component 3) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10.0 becomes an Float) * * @param component3 the Number with the Amount content to set * @return the field object to enable build pattern - * @see #setAmount(java.math.BigDecimal) */ public Field34R setComponent3(java.lang.Number component3) { @@ -603,53 +580,45 @@ public Field34R setAmount(String component3) { return setComponent3(component3); } - /** - * Set the Amount (component 3) from a BigDecimal object. - * - * @see #setComponent3(java.math.BigDecimal) - * - * @param component3 BigDecimal with the Amount content to set - * @return the field object to enable build pattern - * @since 9.2.7 - */ - public Field34R setAmount(java.math.BigDecimal component3) { - return setComponent3(component3); - } - /** * Alternative method setter for field's Amount (component 3) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10 becomes an Integer) * * @param component3 the Number with the Amount content to set * @return the field object to enable build pattern - * @see #setAmount(java.math.BigDecimal) */ public Field34R setAmount(java.lang.Number component3) { return setComponent3(component3); } + @Override public List currencyStrings() { return MonetaryAmountResolver.currencyStrings(this); } + @Override public List currencies() { return MonetaryAmountResolver.currencies(this); } + @Override public Currency currency() { return MonetaryAmountResolver.resolveCurrency(this); } + @Override public String currencyString() { return MonetaryAmountResolver.resolveCurrencyString(this); } + @Override public void initializeCurrencies(String cur) { MonetaryAmountResolver.resolveSetCurrency(this, cur); } + @Override public void initializeCurrencies(Currency cur) { MonetaryAmountResolver.resolveSetCurrency(this, cur); } @@ -670,6 +639,7 @@ public List amounts() { * @return the first amount as BigDecimal value. Can be null * @see MonetaryAmountResolver#amount(Field) */ + @Override public BigDecimal amount() { return MonetaryAmountResolver.amount(this); } @@ -679,6 +649,7 @@ public BigDecimal amount() { * * @return the list of converted components (a Calendar object or null) */ + @Override public List dates() { return DateResolver.dates(this); } @@ -756,7 +727,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field34R(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field35B.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field35B.java index 64673278b..ba52d3d4e 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field35B.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field35B.java @@ -30,12 +30,9 @@ import com.prowidesoftware.swift.model.field.MultiLineField; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -260,16 +257,14 @@ public String getValueDisplay(int component, Locale locale) { //default format (as is) return getComponent(5); } - if (component == 6) { - //default format (as is) - return getComponent(6); - } - return null; + // This is the last component, return directly without `if` + //default format (as is) + return getComponent(6); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -894,7 +889,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field35B(f)); } @@ -910,6 +905,7 @@ public static List getAll(final SwiftTagListBlock block) { * @return line content or null if not present or if line number is above the expected * @since 7.7 */ + @Override public String getLine(int line) { return getLine(line, 0); } @@ -923,6 +919,7 @@ public String getLine(int line) { * @return line content or null if not present or if line number is above the expected * @since 7.7 */ + @Override public String getLine(int line, int offset) { Field35B cp = newInstance(this); return getLine(cp, line, null, offset); @@ -935,6 +932,7 @@ public String getLine(int line, int offset) { * @return lines content or empty list if field's value is empty * @since 7.7 */ + @Override public List getLines() { return SwiftParseUtils.getLines(getValue()); } @@ -947,6 +945,7 @@ public List getLines() { * @return found lines or empty list if lines are not present or the offset is invalid * @since 7.7 */ + @Override public List getLines(int offset) { Field35B cp = newInstance(this); return SwiftParseUtils.getLines(getLine(cp, null, null, offset)); @@ -961,6 +960,7 @@ public List getLines(int offset) { * @return found lines or empty list if value is empty * @since 7.7 */ + @Override public List getLinesBetween(int start, int end) { return getLinesBetween(start, end, 0); } @@ -975,6 +975,7 @@ public List getLinesBetween(int start, int end) { * @return found lines or empty list if lines are not present or the offset is invalid * @since 7.7 */ + @Override public List getLinesBetween(int start, int end, int offset) { Field35B cp = newInstance(this); return SwiftParseUtils.getLines(getLine(cp, start, end, offset)); diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field35C.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field35C.java index 29477c0b4..09976073d 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field35C.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field35C.java @@ -29,12 +29,9 @@ -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -200,16 +197,14 @@ public String getValueDisplay(int component, Locale locale) { //default format (as is) return getComponent(1); } - if (component == 2) { - //default format (as is) - return getComponent(2); - } - return null; + // This is the last component, return directly without `if` + //default format (as is) + return getComponent(2); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -455,7 +450,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field35C(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field35D.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field35D.java index 1da3ef3ab..be2fea281 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field35D.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field35D.java @@ -32,12 +32,9 @@ import com.prowidesoftware.swift.model.field.DateContainer; import com.prowidesoftware.swift.model.field.DateResolver; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -186,23 +183,21 @@ public String getValue() { */ @Override public String getValueDisplay(int component, Locale locale) { - if (component < 1 || component > 1) { + if (component != 1) { throw new IllegalArgumentException("invalid component number " + component + " for field 35D"); } - if (component == 1) { - //date: [YY]YYMMDD - java.text.DateFormat f = java.text.DateFormat.getDateInstance(java.text.DateFormat.DEFAULT, notNull(locale)); - java.util.Calendar cal = getComponent1AsCalendar(); - if (cal != null) { - return f.format(cal.getTime()); - } + //date: [YY]YYMMDD + java.text.DateFormat f = java.text.DateFormat.getDateInstance(java.text.DateFormat.DEFAULT, notNull(locale)); + java.util.Calendar cal = getComponent1AsCalendar(); + if (cal != null) { + return f.format(cal.getTime()); } return null; } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -386,6 +381,7 @@ public Field35D setDate(java.util.Calendar component1) { * * @return the list of converted components (a Calendar object or null) */ + @Override public List dates() { return DateResolver.dates(this); } @@ -463,7 +459,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field35D(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field35E.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field35E.java index 639ec0f12..7d2ce3dc1 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field35E.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field35E.java @@ -30,12 +30,9 @@ import com.prowidesoftware.swift.model.field.MultiLineField; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -213,16 +210,14 @@ public String getValueDisplay(int component, Locale locale) { //default format (as is) return getComponent(5); } - if (component == 6) { - //default format (as is) - return getComponent(6); - } - return null; + // This is the last component, return directly without `if` + //default format (as is) + return getComponent(6); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -680,7 +675,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field35E(f)); } @@ -696,6 +691,7 @@ public static List getAll(final SwiftTagListBlock block) { * @return line content or null if not present or if line number is above the expected * @since 7.7 */ + @Override public String getLine(int line) { return getLine(line, 0); } @@ -709,6 +705,7 @@ public String getLine(int line) { * @return line content or null if not present or if line number is above the expected * @since 7.7 */ + @Override public String getLine(int line, int offset) { Field35E cp = newInstance(this); return getLine(cp, line, null, offset); @@ -721,6 +718,7 @@ public String getLine(int line, int offset) { * @return lines content or empty list if field's value is empty * @since 7.7 */ + @Override public List getLines() { return SwiftParseUtils.getLines(getValue()); } @@ -733,6 +731,7 @@ public List getLines() { * @return found lines or empty list if lines are not present or the offset is invalid * @since 7.7 */ + @Override public List getLines(int offset) { Field35E cp = newInstance(this); return SwiftParseUtils.getLines(getLine(cp, null, null, offset)); @@ -747,6 +746,7 @@ public List getLines(int offset) { * @return found lines or empty list if value is empty * @since 7.7 */ + @Override public List getLinesBetween(int start, int end) { return getLinesBetween(start, end, 0); } @@ -761,6 +761,7 @@ public List getLinesBetween(int start, int end) { * @return found lines or empty list if lines are not present or the offset is invalid * @since 7.7 */ + @Override public List getLinesBetween(int start, int end, int offset) { Field35E cp = newInstance(this); return SwiftParseUtils.getLines(getLine(cp, start, end, offset)); diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field35G.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field35G.java index a9b5a8f8f..76c9cd671 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field35G.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field35G.java @@ -30,12 +30,9 @@ import com.prowidesoftware.swift.model.field.MultiLineField; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -243,16 +240,14 @@ public String getValueDisplay(int component, Locale locale) { //default format (as is) return getComponent(11); } - if (component == 12) { - //default format (as is) - return getComponent(12); - } - return null; + // This is the last component, return directly without `if` + //default format (as is) + return getComponent(12); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -968,7 +963,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field35G(f)); } @@ -984,6 +979,7 @@ public static List getAll(final SwiftTagListBlock block) { * @return line content or null if not present or if line number is above the expected * @since 7.7 */ + @Override public String getLine(int line) { return getLine(line, 0); } @@ -997,6 +993,7 @@ public String getLine(int line) { * @return line content or null if not present or if line number is above the expected * @since 7.7 */ + @Override public String getLine(int line, int offset) { Field35G cp = newInstance(this); return getLine(cp, line, null, offset); @@ -1009,6 +1006,7 @@ public String getLine(int line, int offset) { * @return lines content or empty list if field's value is empty * @since 7.7 */ + @Override public List getLines() { return SwiftParseUtils.getLines(getValue()); } @@ -1021,6 +1019,7 @@ public List getLines() { * @return found lines or empty list if lines are not present or the offset is invalid * @since 7.7 */ + @Override public List getLines(int offset) { Field35G cp = newInstance(this); return SwiftParseUtils.getLines(getLine(cp, null, null, offset)); @@ -1035,6 +1034,7 @@ public List getLines(int offset) { * @return found lines or empty list if value is empty * @since 7.7 */ + @Override public List getLinesBetween(int start, int end) { return getLinesBetween(start, end, 0); } @@ -1049,6 +1049,7 @@ public List getLinesBetween(int start, int end) { * @return found lines or empty list if lines are not present or the offset is invalid * @since 7.7 */ + @Override public List getLinesBetween(int start, int end, int offset) { Field35G cp = newInstance(this); return SwiftParseUtils.getLines(getLine(cp, start, end, offset)); diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field35L.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field35L.java index 698f00ce9..883de0998 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field35L.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field35L.java @@ -30,12 +30,9 @@ import com.prowidesoftware.swift.model.field.MultiLineField; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -203,16 +200,14 @@ public String getValueDisplay(int component, Locale locale) { //default format (as is) return getComponent(3); } - if (component == 4) { - //default format (as is) - return getComponent(4); - } - return null; + // This is the last component, return directly without `if` + //default format (as is) + return getComponent(4); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -584,7 +579,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field35L(f)); } @@ -600,6 +595,7 @@ public static List getAll(final SwiftTagListBlock block) { * @return line content or null if not present or if line number is above the expected * @since 7.7 */ + @Override public String getLine(int line) { return getLine(line, 0); } @@ -613,6 +609,7 @@ public String getLine(int line) { * @return line content or null if not present or if line number is above the expected * @since 7.7 */ + @Override public String getLine(int line, int offset) { Field35L cp = newInstance(this); return getLine(cp, line, null, offset); @@ -625,6 +622,7 @@ public String getLine(int line, int offset) { * @return lines content or empty list if field's value is empty * @since 7.7 */ + @Override public List getLines() { return SwiftParseUtils.getLines(getValue()); } @@ -637,6 +635,7 @@ public List getLines() { * @return found lines or empty list if lines are not present or the offset is invalid * @since 7.7 */ + @Override public List getLines(int offset) { Field35L cp = newInstance(this); return SwiftParseUtils.getLines(getLine(cp, null, null, offset)); @@ -651,6 +650,7 @@ public List getLines(int offset) { * @return found lines or empty list if value is empty * @since 7.7 */ + @Override public List getLinesBetween(int start, int end) { return getLinesBetween(start, end, 0); } @@ -665,6 +665,7 @@ public List getLinesBetween(int start, int end) { * @return found lines or empty list if lines are not present or the offset is invalid * @since 7.7 */ + @Override public List getLinesBetween(int start, int end, int offset) { Field35L cp = newInstance(this); return SwiftParseUtils.getLines(getLine(cp, start, end, offset)); diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field36.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field36.java index 33abf890e..fe14f906f 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field36.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field36.java @@ -33,12 +33,9 @@ import com.prowidesoftware.swift.model.field.AmountContainer; import com.prowidesoftware.swift.model.field.AmountResolver; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -187,24 +184,22 @@ public String getValue() { */ @Override public String getValueDisplay(int component, Locale locale) { - if (component < 1 || component > 1) { + if (component != 1) { throw new IllegalArgumentException("invalid component number " + component + " for field 36"); } - if (component == 1) { - //amount, rate - java.text.NumberFormat f = java.text.NumberFormat.getNumberInstance(notNull(locale)); - f.setMaximumFractionDigits(13); - BigDecimal n = getComponent1AsBigDecimal(); - if (n != null) { - return f.format(n); - } + //amount, rate + java.text.NumberFormat f = java.text.NumberFormat.getNumberInstance(notNull(locale)); + f.setMaximumFractionDigits(13); + BigDecimal n = getComponent1AsBigDecimal(); + if (n != null) { + return f.format(n); } return null; } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -351,32 +346,13 @@ public Field36 setComponent1(String component1) { return this; } - /** - * Set the component1 from a BigDecimal object. - *
- * Parses the BigDecimal into a SWIFT amount with truncated zero decimals and mandatory decimal separator. - *

- * @since 9.2.7 - * - * @param component1 the BigDecimal with the Rate content to set - * @return the field object to enable build pattern - */ - public Field36 setComponent1(java.math.BigDecimal component1) { - setComponent(1, SwiftFormatUtils.getBigDecimal(component1)); - return this; - } /** * Alternative method setter for field's Rate (component 1) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10.0 becomes an Float) * * @param component1 the Number with the Rate content to set * @return the field object to enable build pattern - * @see #setRate(java.math.BigDecimal) */ public Field36 setComponent1(java.lang.Number component1) { @@ -408,27 +384,13 @@ public Field36 setRate(String component1) { return setComponent1(component1); } - /** - * Set the Rate (component 1) from a BigDecimal object. - * - * @see #setComponent1(java.math.BigDecimal) - * - * @param component1 BigDecimal with the Rate content to set - * @return the field object to enable build pattern - * @since 9.2.7 - */ - public Field36 setRate(java.math.BigDecimal component1) { - return setComponent1(component1); - } - /** * Alternative method setter for field's Rate (component 1) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10 becomes an Integer) * * @param component1 the Number with the Rate content to set * @return the field object to enable build pattern - * @see #setRate(java.math.BigDecimal) */ public Field36 setRate(java.lang.Number component1) { return setComponent1(component1); @@ -451,6 +413,7 @@ public List amounts() { * @return the first amount as BigDecimal value. Can be null * @see AmountResolver#amount(Field) */ + @Override public BigDecimal amount() { return AmountResolver.amount(this); } @@ -519,7 +482,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field36(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field36B.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field36B.java index 8883022d4..30af863e3 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field36B.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field36B.java @@ -34,12 +34,9 @@ import com.prowidesoftware.swift.model.field.AmountContainer; import com.prowidesoftware.swift.model.field.AmountResolver; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -219,21 +216,20 @@ public String getValueDisplay(int component, Locale locale) { //default format (as is) return getComponent(2); } - if (component == 3) { - //amount, rate - java.text.NumberFormat f = java.text.NumberFormat.getNumberInstance(notNull(locale)); - f.setMaximumFractionDigits(13); - BigDecimal n = getComponent3AsBigDecimal(); - if (n != null) { - return f.format(n); - } + // This is the last component, return directly without `if` + //amount, rate + java.text.NumberFormat f = java.text.NumberFormat.getNumberInstance(notNull(locale)); + f.setMaximumFractionDigits(13); + BigDecimal n = getComponent3AsBigDecimal(); + if (n != null) { + return f.format(n); } return null; } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -460,32 +456,13 @@ public Field36B setComponent3(String component3) { return this; } - /** - * Set the component3 from a BigDecimal object. - *
- * Parses the BigDecimal into a SWIFT amount with truncated zero decimals and mandatory decimal separator. - *

- * @since 9.2.7 - * - * @param component3 the BigDecimal with the Quantity content to set - * @return the field object to enable build pattern - */ - public Field36B setComponent3(java.math.BigDecimal component3) { - setComponent(3, SwiftFormatUtils.getBigDecimal(component3)); - return this; - } /** * Alternative method setter for field's Quantity (component 3) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10.0 becomes an Float) * * @param component3 the Number with the Quantity content to set * @return the field object to enable build pattern - * @see #setQuantity(java.math.BigDecimal) */ public Field36B setComponent3(java.lang.Number component3) { @@ -517,27 +494,13 @@ public Field36B setQuantity(String component3) { return setComponent3(component3); } - /** - * Set the Quantity (component 3) from a BigDecimal object. - * - * @see #setComponent3(java.math.BigDecimal) - * - * @param component3 BigDecimal with the Quantity content to set - * @return the field object to enable build pattern - * @since 9.2.7 - */ - public Field36B setQuantity(java.math.BigDecimal component3) { - return setComponent3(component3); - } - /** * Alternative method setter for field's Quantity (component 3) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10 becomes an Integer) * * @param component3 the Number with the Quantity content to set * @return the field object to enable build pattern - * @see #setQuantity(java.math.BigDecimal) */ public Field36B setQuantity(java.lang.Number component3) { return setComponent3(component3); @@ -560,6 +523,7 @@ public List amounts() { * @return the first amount as BigDecimal value. Can be null * @see AmountResolver#amount(Field) */ + @Override public BigDecimal amount() { return AmountResolver.amount(this); } @@ -571,6 +535,7 @@ public BigDecimal amount() { * * @return DSS component value or null if the DSS is not set or not available for this field. */ + @Override public String getDSS() { return null; } @@ -581,6 +546,7 @@ public String getDSS() { * @see #getDSS() * @return true if DSS is present, false otherwise. */ + @Override public boolean isDSSPresent() { return false; } @@ -595,6 +561,7 @@ public boolean isDSSPresent() { * * @return for generic fields returns the value of the conditional qualifier or null if not set or not applicable for this field. */ + @Override public String getConditionalQualifier() { return getComponent(CONDITIONAL_QUALIFIER); } @@ -662,7 +629,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field36B(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field36C.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field36C.java index afe5c967f..fde103011 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field36C.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field36C.java @@ -30,12 +30,9 @@ import com.prowidesoftware.swift.model.field.GenericField; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -202,16 +199,14 @@ public String getValueDisplay(int component, Locale locale) { //default format (as is) return getComponent(1); } - if (component == 2) { - //default format (as is) - return getComponent(2); - } - return null; + // This is the last component, return directly without `if` + //default format (as is) + return getComponent(2); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -400,6 +395,7 @@ public Field36C setQuantityCode(String component2) { * * @return DSS component value or null if the DSS is not set or not available for this field. */ + @Override public String getDSS() { return null; } @@ -410,6 +406,7 @@ public String getDSS() { * @see #getDSS() * @return true if DSS is present, false otherwise. */ + @Override public boolean isDSSPresent() { return false; } @@ -424,6 +421,7 @@ public boolean isDSSPresent() { * * @return for generic fields returns the value of the conditional qualifier or null if not set or not applicable for this field. */ + @Override public String getConditionalQualifier() { return getComponent(CONDITIONAL_QUALIFIER); } @@ -491,7 +489,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field36C(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field36D.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field36D.java index aa55e90a2..3478cccfe 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field36D.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field36D.java @@ -32,12 +32,9 @@ import com.prowidesoftware.swift.model.field.GenericField; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -217,16 +214,14 @@ public String getValueDisplay(int component, Locale locale) { //default format (as is) return getComponent(2); } - if (component == 3) { - //default format (as is) - return getComponent(3); - } - return null; + // This is the last component, return directly without `if` + //default format (as is) + return getComponent(3); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -453,32 +448,14 @@ public Field36D setComponent3(String component3) { return this; } - /** - * Set the component3 from a Long object. - *
- * If the component being set is a fixed length number, the argument will not be - * padded. It is recommended for these cases to use the setComponent3(String) - * method. - * - * @see #setComponent3(String) - * @since 9.2.7 - * - * @param component3 the Long with the Quantity Of Digital Tokens content to set - * @return the field object to enable build pattern - */ - public Field36D setComponent3(java.lang.Long component3) { - setComponent(3, SwiftFormatUtils.getLong(component3)); - return this; - } /** * Alternative method setter for field's Quantity Of Digital Tokens (component 3) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10 becomes an Integer) * * @param component3 the Number with the Quantity Of Digital Tokens content to set * @return the field object to enable build pattern - * @see #setQuantityOfDigitalTokens(java.lang.Long) */ public Field36D setComponent3(java.lang.Number component3) { @@ -508,27 +485,13 @@ public Field36D setQuantityOfDigitalTokens(String component3) { return setComponent3(component3); } - /** - * Set the Quantity Of Digital Tokens (component 3) from a Long object. - * - * @see #setComponent3(java.lang.Long) - * - * @param component3 Long with the Quantity Of Digital Tokens content to set - * @return the field object to enable build pattern - * @since 9.2.7 - */ - public Field36D setQuantityOfDigitalTokens(java.lang.Long component3) { - return setComponent3(component3); - } - /** * Alternative method setter for field's Quantity Of Digital Tokens (component 3) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10 becomes an Integer) * * @param component3 the Number with the Quantity Of Digital Tokens content to set * @return the field object to enable build pattern - * @see #setQuantityOfDigitalTokens(java.lang.Long) */ public Field36D setQuantityOfDigitalTokens(java.lang.Number component3) { return setComponent3(component3); @@ -542,6 +505,7 @@ public Field36D setQuantityOfDigitalTokens(java.lang.Number component3) { * * @return DSS component value or null if the DSS is not set or not available for this field. */ + @Override public String getDSS() { return null; } @@ -552,6 +516,7 @@ public String getDSS() { * @see #getDSS() * @return true if DSS is present, false otherwise. */ + @Override public boolean isDSSPresent() { return false; } @@ -566,6 +531,7 @@ public boolean isDSSPresent() { * * @return for generic fields returns the value of the conditional qualifier or null if not set or not applicable for this field. */ + @Override public String getConditionalQualifier() { return getComponent(CONDITIONAL_QUALIFIER); } @@ -633,7 +599,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field36D(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field37G.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field37G.java index 2929fe4d8..841866e46 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field37G.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field37G.java @@ -33,12 +33,9 @@ import com.prowidesoftware.swift.model.field.AmountContainer; import com.prowidesoftware.swift.model.field.AmountResolver; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -201,21 +198,20 @@ public String getValueDisplay(int component, Locale locale) { //default format (as is) return getComponent(1); } - if (component == 2) { - //amount, rate - java.text.NumberFormat f = java.text.NumberFormat.getNumberInstance(notNull(locale)); - f.setMaximumFractionDigits(13); - BigDecimal n = getComponent2AsBigDecimal(); - if (n != null) { - return f.format(n); - } + // This is the last component, return directly without `if` + //amount, rate + java.text.NumberFormat f = java.text.NumberFormat.getNumberInstance(notNull(locale)); + f.setMaximumFractionDigits(13); + BigDecimal n = getComponent2AsBigDecimal(); + if (n != null) { + return f.format(n); } return null; } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -405,32 +401,13 @@ public Field37G setComponent2(String component2) { return this; } - /** - * Set the component2 from a BigDecimal object. - *
- * Parses the BigDecimal into a SWIFT amount with truncated zero decimals and mandatory decimal separator. - *

- * @since 9.2.7 - * - * @param component2 the BigDecimal with the Rate content to set - * @return the field object to enable build pattern - */ - public Field37G setComponent2(java.math.BigDecimal component2) { - setComponent(2, SwiftFormatUtils.getBigDecimal(component2)); - return this; - } /** * Alternative method setter for field's Rate (component 2) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10.0 becomes an Float) * * @param component2 the Number with the Rate content to set * @return the field object to enable build pattern - * @see #setRate(java.math.BigDecimal) */ public Field37G setComponent2(java.lang.Number component2) { @@ -462,27 +439,13 @@ public Field37G setRate(String component2) { return setComponent2(component2); } - /** - * Set the Rate (component 2) from a BigDecimal object. - * - * @see #setComponent2(java.math.BigDecimal) - * - * @param component2 BigDecimal with the Rate content to set - * @return the field object to enable build pattern - * @since 9.2.7 - */ - public Field37G setRate(java.math.BigDecimal component2) { - return setComponent2(component2); - } - /** * Alternative method setter for field's Rate (component 2) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10 becomes an Integer) * * @param component2 the Number with the Rate content to set * @return the field object to enable build pattern - * @see #setRate(java.math.BigDecimal) */ public Field37G setRate(java.lang.Number component2) { return setComponent2(component2); @@ -505,6 +468,7 @@ public List amounts() { * @return the first amount as BigDecimal value. Can be null * @see AmountResolver#amount(Field) */ + @Override public BigDecimal amount() { return AmountResolver.amount(this); } @@ -573,7 +537,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field37G(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field37H.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field37H.java index fbbfc033a..72636c295 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field37H.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field37H.java @@ -33,12 +33,9 @@ import com.prowidesoftware.swift.model.field.AmountContainer; import com.prowidesoftware.swift.model.field.AmountResolver; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -220,21 +217,20 @@ public String getValueDisplay(int component, Locale locale) { //default format (as is) return getComponent(2); } - if (component == 3) { - //amount, rate - java.text.NumberFormat f = java.text.NumberFormat.getNumberInstance(notNull(locale)); - f.setMaximumFractionDigits(13); - BigDecimal n = getComponent3AsBigDecimal(); - if (n != null) { - return f.format(n); - } + // This is the last component, return directly without `if` + //amount, rate + java.text.NumberFormat f = java.text.NumberFormat.getNumberInstance(notNull(locale)); + f.setMaximumFractionDigits(13); + BigDecimal n = getComponent3AsBigDecimal(); + if (n != null) { + return f.format(n); } return null; } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -467,32 +463,13 @@ public Field37H setComponent3(String component3) { return this; } - /** - * Set the component3 from a BigDecimal object. - *
- * Parses the BigDecimal into a SWIFT amount with truncated zero decimals and mandatory decimal separator. - *

- * @since 9.2.7 - * - * @param component3 the BigDecimal with the Rate content to set - * @return the field object to enable build pattern - */ - public Field37H setComponent3(java.math.BigDecimal component3) { - setComponent(3, SwiftFormatUtils.getBigDecimal(component3)); - return this; - } /** * Alternative method setter for field's Rate (component 3) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10.0 becomes an Float) * * @param component3 the Number with the Rate content to set * @return the field object to enable build pattern - * @see #setRate(java.math.BigDecimal) */ public Field37H setComponent3(java.lang.Number component3) { @@ -524,27 +501,13 @@ public Field37H setRate(String component3) { return setComponent3(component3); } - /** - * Set the Rate (component 3) from a BigDecimal object. - * - * @see #setComponent3(java.math.BigDecimal) - * - * @param component3 BigDecimal with the Rate content to set - * @return the field object to enable build pattern - * @since 9.2.7 - */ - public Field37H setRate(java.math.BigDecimal component3) { - return setComponent3(component3); - } - /** * Alternative method setter for field's Rate (component 3) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10 becomes an Integer) * * @param component3 the Number with the Rate content to set * @return the field object to enable build pattern - * @see #setRate(java.math.BigDecimal) */ public Field37H setRate(java.lang.Number component3) { return setComponent3(component3); @@ -567,6 +530,7 @@ public List amounts() { * @return the first amount as BigDecimal value. Can be null * @see AmountResolver#amount(Field) */ + @Override public BigDecimal amount() { return AmountResolver.amount(this); } @@ -635,7 +599,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field37H(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field37J.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field37J.java index 9de7c95c2..a1de4b667 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field37J.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field37J.java @@ -33,12 +33,9 @@ import com.prowidesoftware.swift.model.field.AmountContainer; import com.prowidesoftware.swift.model.field.AmountResolver; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -187,24 +184,22 @@ public String getValue() { */ @Override public String getValueDisplay(int component, Locale locale) { - if (component < 1 || component > 1) { + if (component != 1) { throw new IllegalArgumentException("invalid component number " + component + " for field 37J"); } - if (component == 1) { - //amount, rate - java.text.NumberFormat f = java.text.NumberFormat.getNumberInstance(notNull(locale)); - f.setMaximumFractionDigits(13); - BigDecimal n = getComponent1AsBigDecimal(); - if (n != null) { - return f.format(n); - } + //amount, rate + java.text.NumberFormat f = java.text.NumberFormat.getNumberInstance(notNull(locale)); + f.setMaximumFractionDigits(13); + BigDecimal n = getComponent1AsBigDecimal(); + if (n != null) { + return f.format(n); } return null; } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -351,32 +346,13 @@ public Field37J setComponent1(String component1) { return this; } - /** - * Set the component1 from a BigDecimal object. - *
- * Parses the BigDecimal into a SWIFT amount with truncated zero decimals and mandatory decimal separator. - *

- * @since 9.2.7 - * - * @param component1 the BigDecimal with the Rate content to set - * @return the field object to enable build pattern - */ - public Field37J setComponent1(java.math.BigDecimal component1) { - setComponent(1, SwiftFormatUtils.getBigDecimal(component1)); - return this; - } /** * Alternative method setter for field's Rate (component 1) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10.0 becomes an Float) * * @param component1 the Number with the Rate content to set * @return the field object to enable build pattern - * @see #setRate(java.math.BigDecimal) */ public Field37J setComponent1(java.lang.Number component1) { @@ -408,27 +384,13 @@ public Field37J setRate(String component1) { return setComponent1(component1); } - /** - * Set the Rate (component 1) from a BigDecimal object. - * - * @see #setComponent1(java.math.BigDecimal) - * - * @param component1 BigDecimal with the Rate content to set - * @return the field object to enable build pattern - * @since 9.2.7 - */ - public Field37J setRate(java.math.BigDecimal component1) { - return setComponent1(component1); - } - /** * Alternative method setter for field's Rate (component 1) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10 becomes an Integer) * * @param component1 the Number with the Rate content to set * @return the field object to enable build pattern - * @see #setRate(java.math.BigDecimal) */ public Field37J setRate(java.lang.Number component1) { return setComponent1(component1); @@ -451,6 +413,7 @@ public List amounts() { * @return the first amount as BigDecimal value. Can be null * @see AmountResolver#amount(Field) */ + @Override public BigDecimal amount() { return AmountResolver.amount(this); } @@ -519,7 +482,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field37J(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field37K.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field37K.java index 7e3c66559..ad66ec6dc 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field37K.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field37K.java @@ -33,12 +33,9 @@ import com.prowidesoftware.swift.model.field.AmountContainer; import com.prowidesoftware.swift.model.field.AmountResolver; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -201,21 +198,20 @@ public String getValueDisplay(int component, Locale locale) { //default format (as is) return getComponent(1); } - if (component == 2) { - //amount, rate - java.text.NumberFormat f = java.text.NumberFormat.getNumberInstance(notNull(locale)); - f.setMaximumFractionDigits(13); - BigDecimal n = getComponent2AsBigDecimal(); - if (n != null) { - return f.format(n); - } + // This is the last component, return directly without `if` + //amount, rate + java.text.NumberFormat f = java.text.NumberFormat.getNumberInstance(notNull(locale)); + f.setMaximumFractionDigits(13); + BigDecimal n = getComponent2AsBigDecimal(); + if (n != null) { + return f.format(n); } return null; } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -402,32 +398,13 @@ public Field37K setComponent2(String component2) { return this; } - /** - * Set the component2 from a BigDecimal object. - *
- * Parses the BigDecimal into a SWIFT amount with truncated zero decimals and mandatory decimal separator. - *

- * @since 9.2.7 - * - * @param component2 the BigDecimal with the Rate content to set - * @return the field object to enable build pattern - */ - public Field37K setComponent2(java.math.BigDecimal component2) { - setComponent(2, SwiftFormatUtils.getBigDecimal(component2)); - return this; - } /** * Alternative method setter for field's Rate (component 2) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10.0 becomes an Float) * * @param component2 the Number with the Rate content to set * @return the field object to enable build pattern - * @see #setRate(java.math.BigDecimal) */ public Field37K setComponent2(java.lang.Number component2) { @@ -459,27 +436,13 @@ public Field37K setRate(String component2) { return setComponent2(component2); } - /** - * Set the Rate (component 2) from a BigDecimal object. - * - * @see #setComponent2(java.math.BigDecimal) - * - * @param component2 BigDecimal with the Rate content to set - * @return the field object to enable build pattern - * @since 9.2.7 - */ - public Field37K setRate(java.math.BigDecimal component2) { - return setComponent2(component2); - } - /** * Alternative method setter for field's Rate (component 2) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10 becomes an Integer) * * @param component2 the Number with the Rate content to set * @return the field object to enable build pattern - * @see #setRate(java.math.BigDecimal) */ public Field37K setRate(java.lang.Number component2) { return setComponent2(component2); @@ -502,6 +465,7 @@ public List amounts() { * @return the first amount as BigDecimal value. Can be null * @see AmountResolver#amount(Field) */ + @Override public BigDecimal amount() { return AmountResolver.amount(this); } @@ -570,7 +534,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field37K(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field37L.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field37L.java index 76ecccf88..8b51f1a76 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field37L.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field37L.java @@ -33,12 +33,9 @@ import com.prowidesoftware.swift.model.field.AmountContainer; import com.prowidesoftware.swift.model.field.AmountResolver; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -187,24 +184,22 @@ public String getValue() { */ @Override public String getValueDisplay(int component, Locale locale) { - if (component < 1 || component > 1) { + if (component != 1) { throw new IllegalArgumentException("invalid component number " + component + " for field 37L"); } - if (component == 1) { - //amount, rate - java.text.NumberFormat f = java.text.NumberFormat.getNumberInstance(notNull(locale)); - f.setMaximumFractionDigits(13); - BigDecimal n = getComponent1AsBigDecimal(); - if (n != null) { - return f.format(n); - } + //amount, rate + java.text.NumberFormat f = java.text.NumberFormat.getNumberInstance(notNull(locale)); + f.setMaximumFractionDigits(13); + BigDecimal n = getComponent1AsBigDecimal(); + if (n != null) { + return f.format(n); } return null; } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -351,32 +346,13 @@ public Field37L setComponent1(String component1) { return this; } - /** - * Set the component1 from a BigDecimal object. - *
- * Parses the BigDecimal into a SWIFT amount with truncated zero decimals and mandatory decimal separator. - *

- * @since 9.2.7 - * - * @param component1 the BigDecimal with the Rate content to set - * @return the field object to enable build pattern - */ - public Field37L setComponent1(java.math.BigDecimal component1) { - setComponent(1, SwiftFormatUtils.getBigDecimal(component1)); - return this; - } /** * Alternative method setter for field's Rate (component 1) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10.0 becomes an Float) * * @param component1 the Number with the Rate content to set * @return the field object to enable build pattern - * @see #setRate(java.math.BigDecimal) */ public Field37L setComponent1(java.lang.Number component1) { @@ -408,27 +384,13 @@ public Field37L setRate(String component1) { return setComponent1(component1); } - /** - * Set the Rate (component 1) from a BigDecimal object. - * - * @see #setComponent1(java.math.BigDecimal) - * - * @param component1 BigDecimal with the Rate content to set - * @return the field object to enable build pattern - * @since 9.2.7 - */ - public Field37L setRate(java.math.BigDecimal component1) { - return setComponent1(component1); - } - /** * Alternative method setter for field's Rate (component 1) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10 becomes an Integer) * * @param component1 the Number with the Rate content to set * @return the field object to enable build pattern - * @see #setRate(java.math.BigDecimal) */ public Field37L setRate(java.lang.Number component1) { return setComponent1(component1); @@ -451,6 +413,7 @@ public List amounts() { * @return the first amount as BigDecimal value. Can be null * @see AmountResolver#amount(Field) */ + @Override public BigDecimal amount() { return AmountResolver.amount(this); } @@ -519,7 +482,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field37L(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field37M.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field37M.java index b92af0d7d..eff84ccbc 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field37M.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field37M.java @@ -33,12 +33,9 @@ import com.prowidesoftware.swift.model.field.AmountContainer; import com.prowidesoftware.swift.model.field.AmountResolver; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -201,21 +198,20 @@ public String getValueDisplay(int component, Locale locale) { //default format (as is) return getComponent(1); } - if (component == 2) { - //amount, rate - java.text.NumberFormat f = java.text.NumberFormat.getNumberInstance(notNull(locale)); - f.setMaximumFractionDigits(13); - BigDecimal n = getComponent2AsBigDecimal(); - if (n != null) { - return f.format(n); - } + // This is the last component, return directly without `if` + //amount, rate + java.text.NumberFormat f = java.text.NumberFormat.getNumberInstance(notNull(locale)); + f.setMaximumFractionDigits(13); + BigDecimal n = getComponent2AsBigDecimal(); + if (n != null) { + return f.format(n); } return null; } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -405,32 +401,13 @@ public Field37M setComponent2(String component2) { return this; } - /** - * Set the component2 from a BigDecimal object. - *
- * Parses the BigDecimal into a SWIFT amount with truncated zero decimals and mandatory decimal separator. - *

- * @since 9.2.7 - * - * @param component2 the BigDecimal with the Rate content to set - * @return the field object to enable build pattern - */ - public Field37M setComponent2(java.math.BigDecimal component2) { - setComponent(2, SwiftFormatUtils.getBigDecimal(component2)); - return this; - } /** * Alternative method setter for field's Rate (component 2) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10.0 becomes an Float) * * @param component2 the Number with the Rate content to set * @return the field object to enable build pattern - * @see #setRate(java.math.BigDecimal) */ public Field37M setComponent2(java.lang.Number component2) { @@ -462,27 +439,13 @@ public Field37M setRate(String component2) { return setComponent2(component2); } - /** - * Set the Rate (component 2) from a BigDecimal object. - * - * @see #setComponent2(java.math.BigDecimal) - * - * @param component2 BigDecimal with the Rate content to set - * @return the field object to enable build pattern - * @since 9.2.7 - */ - public Field37M setRate(java.math.BigDecimal component2) { - return setComponent2(component2); - } - /** * Alternative method setter for field's Rate (component 2) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10 becomes an Integer) * * @param component2 the Number with the Rate content to set * @return the field object to enable build pattern - * @see #setRate(java.math.BigDecimal) */ public Field37M setRate(java.lang.Number component2) { return setComponent2(component2); @@ -505,6 +468,7 @@ public List amounts() { * @return the first amount as BigDecimal value. Can be null * @see AmountResolver#amount(Field) */ + @Override public BigDecimal amount() { return AmountResolver.amount(this); } @@ -573,7 +537,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field37M(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field37N.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field37N.java index f07a3e34b..6ef10413b 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field37N.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field37N.java @@ -30,12 +30,9 @@ import com.prowidesoftware.swift.model.field.MultiLineField; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -246,7 +243,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field37N(f)); } @@ -262,6 +259,7 @@ public static List getAll(final SwiftTagListBlock block) { * @return line content or null if not present or if line number is above the expected * @since 7.7 */ + @Override public String getLine(int line) { return getLine(line, 0); } @@ -275,6 +273,7 @@ public String getLine(int line) { * @return line content or null if not present or if line number is above the expected * @since 7.7 */ + @Override public String getLine(int line, int offset) { Field37N cp = newInstance(this); return getLine(cp, line, null, offset); @@ -287,6 +286,7 @@ public String getLine(int line, int offset) { * @return lines content or empty list if field's value is empty * @since 7.7 */ + @Override public List getLines() { return SwiftParseUtils.getLines(getValue()); } @@ -299,6 +299,7 @@ public List getLines() { * @return found lines or empty list if lines are not present or the offset is invalid * @since 7.7 */ + @Override public List getLines(int offset) { Field37N cp = newInstance(this); return SwiftParseUtils.getLines(getLine(cp, null, null, offset)); @@ -313,6 +314,7 @@ public List getLines(int offset) { * @return found lines or empty list if value is empty * @since 7.7 */ + @Override public List getLinesBetween(int start, int end) { return getLinesBetween(start, end, 0); } @@ -327,6 +329,7 @@ public List getLinesBetween(int start, int end) { * @return found lines or empty list if lines are not present or the offset is invalid * @since 7.7 */ + @Override public List getLinesBetween(int start, int end, int offset) { Field37N cp = newInstance(this); return SwiftParseUtils.getLines(getLine(cp, start, end, offset)); diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field37R.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field37R.java index bb5b68e37..48f2b9d94 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field37R.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field37R.java @@ -33,12 +33,9 @@ import com.prowidesoftware.swift.model.field.AmountContainer; import com.prowidesoftware.swift.model.field.AmountResolver; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -201,21 +198,20 @@ public String getValueDisplay(int component, Locale locale) { //default format (as is) return getComponent(1); } - if (component == 2) { - //amount, rate - java.text.NumberFormat f = java.text.NumberFormat.getNumberInstance(notNull(locale)); - f.setMaximumFractionDigits(13); - BigDecimal n = getComponent2AsBigDecimal(); - if (n != null) { - return f.format(n); - } + // This is the last component, return directly without `if` + //amount, rate + java.text.NumberFormat f = java.text.NumberFormat.getNumberInstance(notNull(locale)); + f.setMaximumFractionDigits(13); + BigDecimal n = getComponent2AsBigDecimal(); + if (n != null) { + return f.format(n); } return null; } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -405,32 +401,13 @@ public Field37R setComponent2(String component2) { return this; } - /** - * Set the component2 from a BigDecimal object. - *
- * Parses the BigDecimal into a SWIFT amount with truncated zero decimals and mandatory decimal separator. - *

- * @since 9.2.7 - * - * @param component2 the BigDecimal with the Rate content to set - * @return the field object to enable build pattern - */ - public Field37R setComponent2(java.math.BigDecimal component2) { - setComponent(2, SwiftFormatUtils.getBigDecimal(component2)); - return this; - } /** * Alternative method setter for field's Rate (component 2) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10.0 becomes an Float) * * @param component2 the Number with the Rate content to set * @return the field object to enable build pattern - * @see #setRate(java.math.BigDecimal) */ public Field37R setComponent2(java.lang.Number component2) { @@ -462,27 +439,13 @@ public Field37R setRate(String component2) { return setComponent2(component2); } - /** - * Set the Rate (component 2) from a BigDecimal object. - * - * @see #setComponent2(java.math.BigDecimal) - * - * @param component2 BigDecimal with the Rate content to set - * @return the field object to enable build pattern - * @since 9.2.7 - */ - public Field37R setRate(java.math.BigDecimal component2) { - return setComponent2(component2); - } - /** * Alternative method setter for field's Rate (component 2) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10 becomes an Integer) * * @param component2 the Number with the Rate content to set * @return the field object to enable build pattern - * @see #setRate(java.math.BigDecimal) */ public Field37R setRate(java.lang.Number component2) { return setComponent2(component2); @@ -505,6 +468,7 @@ public List amounts() { * @return the first amount as BigDecimal value. Can be null * @see AmountResolver#amount(Field) */ + @Override public BigDecimal amount() { return AmountResolver.amount(this); } @@ -573,7 +537,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field37R(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field37V.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field37V.java index d5c2164d0..d5f681e7d 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field37V.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field37V.java @@ -33,12 +33,9 @@ import com.prowidesoftware.swift.model.field.AmountContainer; import com.prowidesoftware.swift.model.field.AmountResolver; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -201,21 +198,20 @@ public String getValueDisplay(int component, Locale locale) { //default format (as is) return getComponent(1); } - if (component == 2) { - //amount, rate - java.text.NumberFormat f = java.text.NumberFormat.getNumberInstance(notNull(locale)); - f.setMaximumFractionDigits(13); - BigDecimal n = getComponent2AsBigDecimal(); - if (n != null) { - return f.format(n); - } + // This is the last component, return directly without `if` + //amount, rate + java.text.NumberFormat f = java.text.NumberFormat.getNumberInstance(notNull(locale)); + f.setMaximumFractionDigits(13); + BigDecimal n = getComponent2AsBigDecimal(); + if (n != null) { + return f.format(n); } return null; } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -405,32 +401,13 @@ public Field37V setComponent2(String component2) { return this; } - /** - * Set the component2 from a BigDecimal object. - *
- * Parses the BigDecimal into a SWIFT amount with truncated zero decimals and mandatory decimal separator. - *

- * @since 9.2.7 - * - * @param component2 the BigDecimal with the Rate content to set - * @return the field object to enable build pattern - */ - public Field37V setComponent2(java.math.BigDecimal component2) { - setComponent(2, SwiftFormatUtils.getBigDecimal(component2)); - return this; - } /** * Alternative method setter for field's Rate (component 2) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10.0 becomes an Float) * * @param component2 the Number with the Rate content to set * @return the field object to enable build pattern - * @see #setRate(java.math.BigDecimal) */ public Field37V setComponent2(java.lang.Number component2) { @@ -462,27 +439,13 @@ public Field37V setRate(String component2) { return setComponent2(component2); } - /** - * Set the Rate (component 2) from a BigDecimal object. - * - * @see #setComponent2(java.math.BigDecimal) - * - * @param component2 BigDecimal with the Rate content to set - * @return the field object to enable build pattern - * @since 9.2.7 - */ - public Field37V setRate(java.math.BigDecimal component2) { - return setComponent2(component2); - } - /** * Alternative method setter for field's Rate (component 2) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10 becomes an Integer) * * @param component2 the Number with the Rate content to set * @return the field object to enable build pattern - * @see #setRate(java.math.BigDecimal) */ public Field37V setRate(java.lang.Number component2) { return setComponent2(component2); @@ -505,6 +468,7 @@ public List amounts() { * @return the first amount as BigDecimal value. Can be null * @see AmountResolver#amount(Field) */ + @Override public BigDecimal amount() { return AmountResolver.amount(this); } @@ -573,7 +537,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field37V(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field38E.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field38E.java index aaf823100..1addb120f 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field38E.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field38E.java @@ -31,12 +31,9 @@ import java.math.BigInteger; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -199,16 +196,14 @@ public String getValueDisplay(int component, Locale locale) { //default format (as is) return getComponent(1); } - if (component == 2) { - //default format (as is) - return getComponent(2); - } - return null; + // This is the last component, return directly without `if` + //default format (as is) + return getComponent(2); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -374,32 +369,14 @@ public Field38E setComponent1(String component1) { return this; } - /** - * Set the component1 from a Long object. - *
- * If the component being set is a fixed length number, the argument will not be - * padded. It is recommended for these cases to use the setComponent1(String) - * method. - * - * @see #setComponent1(String) - * @since 9.2.7 - * - * @param component1 the Long with the Number content to set - * @return the field object to enable build pattern - */ - public Field38E setComponent1(java.lang.Long component1) { - setComponent(1, SwiftFormatUtils.getLong(component1)); - return this; - } /** * Alternative method setter for field's Number (component 1) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10 becomes an Integer) * * @param component1 the Number with the Number content to set * @return the field object to enable build pattern - * @see #setNumber(java.lang.Long) */ public Field38E setComponent1(java.lang.Number component1) { @@ -429,27 +406,13 @@ public Field38E setNumber(String component1) { return setComponent1(component1); } - /** - * Set the Number (component 1) from a Long object. - * - * @see #setComponent1(java.lang.Long) - * - * @param component1 Long with the Number content to set - * @return the field object to enable build pattern - * @since 9.2.7 - */ - public Field38E setNumber(java.lang.Long component1) { - return setComponent1(component1); - } - /** * Alternative method setter for field's Number (component 1) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10 becomes an Integer) * * @param component1 the Number with the Number content to set * @return the field object to enable build pattern - * @see #setNumber(java.lang.Long) */ public Field38E setNumber(java.lang.Number component1) { return setComponent1(component1); @@ -541,7 +504,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field38E(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field38G.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field38G.java index b8da59bc9..fbc9ae4e8 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field38G.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field38G.java @@ -31,12 +31,9 @@ import java.math.BigInteger; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -226,16 +223,14 @@ public String getValueDisplay(int component, Locale locale) { //default format (as is) return getComponent(3); } - if (component == 4) { - //default format (as is) - return getComponent(4); - } - return null; + // This is the last component, return directly without `if` + //default format (as is) + return getComponent(4); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -458,32 +453,14 @@ public Field38G setComponent1(String component1) { return this; } - /** - * Set the component1 from a Long object. - *
- * If the component being set is a fixed length number, the argument will not be - * padded. It is recommended for these cases to use the setComponent1(String) - * method. - * - * @see #setComponent1(String) - * @since 9.2.7 - * - * @param component1 the Long with the Number From content to set - * @return the field object to enable build pattern - */ - public Field38G setComponent1(java.lang.Long component1) { - setComponent(1, SwiftFormatUtils.getLong(component1)); - return this; - } /** * Alternative method setter for field's Number From (component 1) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10 becomes an Integer) * * @param component1 the Number with the Number From content to set * @return the field object to enable build pattern - * @see #setNumberFrom(java.lang.Long) */ public Field38G setComponent1(java.lang.Number component1) { @@ -513,27 +490,13 @@ public Field38G setNumberFrom(String component1) { return setComponent1(component1); } - /** - * Set the Number From (component 1) from a Long object. - * - * @see #setComponent1(java.lang.Long) - * - * @param component1 Long with the Number From content to set - * @return the field object to enable build pattern - * @since 9.2.7 - */ - public Field38G setNumberFrom(java.lang.Long component1) { - return setComponent1(component1); - } - /** * Alternative method setter for field's Number From (component 1) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10 becomes an Integer) * * @param component1 the Number with the Number From content to set * @return the field object to enable build pattern - * @see #setNumberFrom(java.lang.Long) */ public Field38G setNumberFrom(java.lang.Number component1) { return setComponent1(component1); @@ -571,32 +534,14 @@ public Field38G setComponent3(String component3) { return this; } - /** - * Set the component3 from a Long object. - *
- * If the component being set is a fixed length number, the argument will not be - * padded. It is recommended for these cases to use the setComponent3(String) - * method. - * - * @see #setComponent3(String) - * @since 9.2.7 - * - * @param component3 the Long with the Number To content to set - * @return the field object to enable build pattern - */ - public Field38G setComponent3(java.lang.Long component3) { - setComponent(3, SwiftFormatUtils.getLong(component3)); - return this; - } /** * Alternative method setter for field's Number To (component 3) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10 becomes an Integer) * * @param component3 the Number with the Number To content to set * @return the field object to enable build pattern - * @see #setNumberTo(java.lang.Long) */ public Field38G setComponent3(java.lang.Number component3) { @@ -626,27 +571,13 @@ public Field38G setNumberTo(String component3) { return setComponent3(component3); } - /** - * Set the Number To (component 3) from a Long object. - * - * @see #setComponent3(java.lang.Long) - * - * @param component3 Long with the Number To content to set - * @return the field object to enable build pattern - * @since 9.2.7 - */ - public Field38G setNumberTo(java.lang.Long component3) { - return setComponent3(component3); - } - /** * Alternative method setter for field's Number To (component 3) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10 becomes an Integer) * * @param component3 the Number with the Number To content to set * @return the field object to enable build pattern - * @see #setNumberTo(java.lang.Long) */ public Field38G setNumberTo(java.lang.Number component3) { return setComponent3(component3); @@ -738,7 +669,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field38G(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field38H.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field38H.java index a81e07671..c730fc7b9 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field38H.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field38H.java @@ -31,12 +31,9 @@ import java.math.BigInteger; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -226,16 +223,14 @@ public String getValueDisplay(int component, Locale locale) { //default format (as is) return getComponent(3); } - if (component == 4) { - //default format (as is) - return getComponent(4); - } - return null; + // This is the last component, return directly without `if` + //default format (as is) + return getComponent(4); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -458,32 +453,14 @@ public Field38H setComponent1(String component1) { return this; } - /** - * Set the component1 from a Long object. - *
- * If the component being set is a fixed length number, the argument will not be - * padded. It is recommended for these cases to use the setComponent1(String) - * method. - * - * @see #setComponent1(String) - * @since 9.2.7 - * - * @param component1 the Long with the Number From content to set - * @return the field object to enable build pattern - */ - public Field38H setComponent1(java.lang.Long component1) { - setComponent(1, SwiftFormatUtils.getLong(component1)); - return this; - } /** * Alternative method setter for field's Number From (component 1) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10 becomes an Integer) * * @param component1 the Number with the Number From content to set * @return the field object to enable build pattern - * @see #setNumberFrom(java.lang.Long) */ public Field38H setComponent1(java.lang.Number component1) { @@ -513,27 +490,13 @@ public Field38H setNumberFrom(String component1) { return setComponent1(component1); } - /** - * Set the Number From (component 1) from a Long object. - * - * @see #setComponent1(java.lang.Long) - * - * @param component1 Long with the Number From content to set - * @return the field object to enable build pattern - * @since 9.2.7 - */ - public Field38H setNumberFrom(java.lang.Long component1) { - return setComponent1(component1); - } - /** * Alternative method setter for field's Number From (component 1) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10 becomes an Integer) * * @param component1 the Number with the Number From content to set * @return the field object to enable build pattern - * @see #setNumberFrom(java.lang.Long) */ public Field38H setNumberFrom(java.lang.Number component1) { return setComponent1(component1); @@ -571,32 +534,14 @@ public Field38H setComponent3(String component3) { return this; } - /** - * Set the component3 from a Long object. - *
- * If the component being set is a fixed length number, the argument will not be - * padded. It is recommended for these cases to use the setComponent3(String) - * method. - * - * @see #setComponent3(String) - * @since 9.2.7 - * - * @param component3 the Long with the Number To content to set - * @return the field object to enable build pattern - */ - public Field38H setComponent3(java.lang.Long component3) { - setComponent(3, SwiftFormatUtils.getLong(component3)); - return this; - } /** * Alternative method setter for field's Number To (component 3) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10 becomes an Integer) * * @param component3 the Number with the Number To content to set * @return the field object to enable build pattern - * @see #setNumberTo(java.lang.Long) */ public Field38H setComponent3(java.lang.Number component3) { @@ -626,27 +571,13 @@ public Field38H setNumberTo(String component3) { return setComponent3(component3); } - /** - * Set the Number To (component 3) from a Long object. - * - * @see #setComponent3(java.lang.Long) - * - * @param component3 Long with the Number To content to set - * @return the field object to enable build pattern - * @since 9.2.7 - */ - public Field38H setNumberTo(java.lang.Long component3) { - return setComponent3(component3); - } - /** * Alternative method setter for field's Number To (component 3) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10 becomes an Integer) * * @param component3 the Number with the Number To content to set * @return the field object to enable build pattern - * @see #setNumberTo(java.lang.Long) */ public Field38H setNumberTo(java.lang.Number component3) { return setComponent3(component3); @@ -738,7 +669,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field38H(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field38J.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field38J.java index 0f664e92d..252b59029 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field38J.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field38J.java @@ -31,12 +31,9 @@ import java.math.BigInteger; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -200,16 +197,14 @@ public String getValueDisplay(int component, Locale locale) { //default format (as is) return getComponent(1); } - if (component == 2) { - //default format (as is) - return getComponent(2); - } - return null; + // This is the last component, return directly without `if` + //default format (as is) + return getComponent(2); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -399,32 +394,14 @@ public Field38J setComponent2(String component2) { return this; } - /** - * Set the component2 from a Long object. - *
- * If the component being set is a fixed length number, the argument will not be - * padded. It is recommended for these cases to use the setComponent2(String) - * method. - * - * @see #setComponent2(String) - * @since 9.2.7 - * - * @param component2 the Long with the Number content to set - * @return the field object to enable build pattern - */ - public Field38J setComponent2(java.lang.Long component2) { - setComponent(2, SwiftFormatUtils.getLong(component2)); - return this; - } /** * Alternative method setter for field's Number (component 2) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10 becomes an Integer) * * @param component2 the Number with the Number content to set * @return the field object to enable build pattern - * @see #setNumber(java.lang.Long) */ public Field38J setComponent2(java.lang.Number component2) { @@ -454,27 +431,13 @@ public Field38J setNumber(String component2) { return setComponent2(component2); } - /** - * Set the Number (component 2) from a Long object. - * - * @see #setComponent2(java.lang.Long) - * - * @param component2 Long with the Number content to set - * @return the field object to enable build pattern - * @since 9.2.7 - */ - public Field38J setNumber(java.lang.Long component2) { - return setComponent2(component2); - } - /** * Alternative method setter for field's Number (component 2) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10 becomes an Integer) * * @param component2 the Number with the Number content to set * @return the field object to enable build pattern - * @see #setNumber(java.lang.Long) */ public Field38J setNumber(java.lang.Number component2) { return setComponent2(component2); @@ -545,7 +508,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field38J(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field39A.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field39A.java index 8ed8a6125..923bc593a 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field39A.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field39A.java @@ -31,12 +31,9 @@ import java.math.BigInteger; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -201,16 +198,14 @@ public String getValueDisplay(int component, Locale locale) { //default format (as is) return getComponent(1); } - if (component == 2) { - //default format (as is) - return getComponent(2); - } - return null; + // This is the last component, return directly without `if` + //default format (as is) + return getComponent(2); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -395,32 +390,14 @@ public Field39A setComponent1(String component1) { return this; } - /** - * Set the component1 from a Long object. - *
- * If the component being set is a fixed length number, the argument will not be - * padded. It is recommended for these cases to use the setComponent1(String) - * method. - * - * @see #setComponent1(String) - * @since 9.2.7 - * - * @param component1 the Long with the Tolerance 1 content to set - * @return the field object to enable build pattern - */ - public Field39A setComponent1(java.lang.Long component1) { - setComponent(1, SwiftFormatUtils.getLong(component1)); - return this; - } /** * Alternative method setter for field's Tolerance 1 (component 1) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10 becomes an Integer) * * @param component1 the Number with the Tolerance 1 content to set * @return the field object to enable build pattern - * @see #setTolerance1(java.lang.Long) */ public Field39A setComponent1(java.lang.Number component1) { @@ -450,27 +427,13 @@ public Field39A setTolerance1(String component1) { return setComponent1(component1); } - /** - * Set the Tolerance 1 (component 1) from a Long object. - * - * @see #setComponent1(java.lang.Long) - * - * @param component1 Long with the Tolerance 1 content to set - * @return the field object to enable build pattern - * @since 9.2.7 - */ - public Field39A setTolerance1(java.lang.Long component1) { - return setComponent1(component1); - } - /** * Alternative method setter for field's Tolerance 1 (component 1) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10 becomes an Integer) * * @param component1 the Number with the Tolerance 1 content to set * @return the field object to enable build pattern - * @see #setTolerance1(java.lang.Long) */ public Field39A setTolerance1(java.lang.Number component1) { return setComponent1(component1); @@ -487,32 +450,14 @@ public Field39A setComponent2(String component2) { return this; } - /** - * Set the component2 from a Long object. - *
- * If the component being set is a fixed length number, the argument will not be - * padded. It is recommended for these cases to use the setComponent2(String) - * method. - * - * @see #setComponent2(String) - * @since 9.2.7 - * - * @param component2 the Long with the Tolerance 2 content to set - * @return the field object to enable build pattern - */ - public Field39A setComponent2(java.lang.Long component2) { - setComponent(2, SwiftFormatUtils.getLong(component2)); - return this; - } /** * Alternative method setter for field's Tolerance 2 (component 2) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10 becomes an Integer) * * @param component2 the Number with the Tolerance 2 content to set * @return the field object to enable build pattern - * @see #setTolerance2(java.lang.Long) */ public Field39A setComponent2(java.lang.Number component2) { @@ -542,27 +487,13 @@ public Field39A setTolerance2(String component2) { return setComponent2(component2); } - /** - * Set the Tolerance 2 (component 2) from a Long object. - * - * @see #setComponent2(java.lang.Long) - * - * @param component2 Long with the Tolerance 2 content to set - * @return the field object to enable build pattern - * @since 9.2.7 - */ - public Field39A setTolerance2(java.lang.Long component2) { - return setComponent2(component2); - } - /** * Alternative method setter for field's Tolerance 2 (component 2) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10 becomes an Integer) * * @param component2 the Number with the Tolerance 2 content to set * @return the field object to enable build pattern - * @see #setTolerance2(java.lang.Long) */ public Field39A setTolerance2(java.lang.Number component2) { return setComponent2(component2); @@ -633,7 +564,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field39A(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field39B.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field39B.java index b4346c1a0..187996214 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field39B.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field39B.java @@ -29,12 +29,9 @@ -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -183,19 +180,16 @@ public String getValue() { */ @Override public String getValueDisplay(int component, Locale locale) { - if (component < 1 || component > 1) { + if (component != 1) { throw new IllegalArgumentException("invalid component number " + component + " for field 39B"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -398,7 +392,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field39B(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field39C.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field39C.java index 5e595e139..648cf8213 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field39C.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field39C.java @@ -30,12 +30,9 @@ import com.prowidesoftware.swift.model.field.MultiLineField; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -203,16 +200,14 @@ public String getValueDisplay(int component, Locale locale) { //default format (as is) return getComponent(3); } - if (component == 4) { - //default format (as is) - return getComponent(4); - } - return null; + // This is the last component, return directly without `if` + //default format (as is) + return getComponent(4); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -584,7 +579,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field39C(f)); } @@ -600,6 +595,7 @@ public static List getAll(final SwiftTagListBlock block) { * @return line content or null if not present or if line number is above the expected * @since 7.7 */ + @Override public String getLine(int line) { return getLine(line, 0); } @@ -613,6 +609,7 @@ public String getLine(int line) { * @return line content or null if not present or if line number is above the expected * @since 7.7 */ + @Override public String getLine(int line, int offset) { Field39C cp = newInstance(this); return getLine(cp, line, null, offset); @@ -625,6 +622,7 @@ public String getLine(int line, int offset) { * @return lines content or empty list if field's value is empty * @since 7.7 */ + @Override public List getLines() { return SwiftParseUtils.getLines(getValue()); } @@ -637,6 +635,7 @@ public List getLines() { * @return found lines or empty list if lines are not present or the offset is invalid * @since 7.7 */ + @Override public List getLines(int offset) { Field39C cp = newInstance(this); return SwiftParseUtils.getLines(getLine(cp, null, null, offset)); @@ -651,6 +650,7 @@ public List getLines(int offset) { * @return found lines or empty list if value is empty * @since 7.7 */ + @Override public List getLinesBetween(int start, int end) { return getLinesBetween(start, end, 0); } @@ -665,6 +665,7 @@ public List getLinesBetween(int start, int end) { * @return found lines or empty list if lines are not present or the offset is invalid * @since 7.7 */ + @Override public List getLinesBetween(int start, int end, int offset) { Field39C cp = newInstance(this); return SwiftParseUtils.getLines(getLine(cp, start, end, offset)); diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field39E.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field39E.java index edb7de331..f51f349d2 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field39E.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field39E.java @@ -30,12 +30,9 @@ import com.prowidesoftware.swift.model.field.MultiLineField; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -243,16 +240,14 @@ public String getValueDisplay(int component, Locale locale) { //default format (as is) return getComponent(11); } - if (component == 12) { - //default format (as is) - return getComponent(12); - } - return null; + // This is the last component, return directly without `if` + //default format (as is) + return getComponent(12); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -968,7 +963,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field39E(f)); } @@ -984,6 +979,7 @@ public static List getAll(final SwiftTagListBlock block) { * @return line content or null if not present or if line number is above the expected * @since 7.7 */ + @Override public String getLine(int line) { return getLine(line, 0); } @@ -997,6 +993,7 @@ public String getLine(int line) { * @return line content or null if not present or if line number is above the expected * @since 7.7 */ + @Override public String getLine(int line, int offset) { Field39E cp = newInstance(this); return getLine(cp, line, null, offset); @@ -1009,6 +1006,7 @@ public String getLine(int line, int offset) { * @return lines content or empty list if field's value is empty * @since 7.7 */ + @Override public List getLines() { return SwiftParseUtils.getLines(getValue()); } @@ -1021,6 +1019,7 @@ public List getLines() { * @return found lines or empty list if lines are not present or the offset is invalid * @since 7.7 */ + @Override public List getLines(int offset) { Field39E cp = newInstance(this); return SwiftParseUtils.getLines(getLine(cp, null, null, offset)); @@ -1035,6 +1034,7 @@ public List getLines(int offset) { * @return found lines or empty list if value is empty * @since 7.7 */ + @Override public List getLinesBetween(int start, int end) { return getLinesBetween(start, end, 0); } @@ -1049,6 +1049,7 @@ public List getLinesBetween(int start, int end) { * @return found lines or empty list if lines are not present or the offset is invalid * @since 7.7 */ + @Override public List getLinesBetween(int start, int end, int offset) { Field39E cp = newInstance(this); return SwiftParseUtils.getLines(getLine(cp, start, end, offset)); diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field39F.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field39F.java index 71f71d6ed..7d833d49f 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field39F.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field39F.java @@ -30,12 +30,9 @@ import com.prowidesoftware.swift.model.field.MultiLineField; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -243,16 +240,14 @@ public String getValueDisplay(int component, Locale locale) { //default format (as is) return getComponent(11); } - if (component == 12) { - //default format (as is) - return getComponent(12); - } - return null; + // This is the last component, return directly without `if` + //default format (as is) + return getComponent(12); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -968,7 +963,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field39F(f)); } @@ -984,6 +979,7 @@ public static List getAll(final SwiftTagListBlock block) { * @return line content or null if not present or if line number is above the expected * @since 7.7 */ + @Override public String getLine(int line) { return getLine(line, 0); } @@ -997,6 +993,7 @@ public String getLine(int line) { * @return line content or null if not present or if line number is above the expected * @since 7.7 */ + @Override public String getLine(int line, int offset) { Field39F cp = newInstance(this); return getLine(cp, line, null, offset); @@ -1009,6 +1006,7 @@ public String getLine(int line, int offset) { * @return lines content or empty list if field's value is empty * @since 7.7 */ + @Override public List getLines() { return SwiftParseUtils.getLines(getValue()); } @@ -1021,6 +1019,7 @@ public List getLines() { * @return found lines or empty list if lines are not present or the offset is invalid * @since 7.7 */ + @Override public List getLines(int offset) { Field39F cp = newInstance(this); return SwiftParseUtils.getLines(getLine(cp, null, null, offset)); @@ -1035,6 +1034,7 @@ public List getLines(int offset) { * @return found lines or empty list if value is empty * @since 7.7 */ + @Override public List getLinesBetween(int start, int end) { return getLinesBetween(start, end, 0); } @@ -1049,6 +1049,7 @@ public List getLinesBetween(int start, int end) { * @return found lines or empty list if lines are not present or the offset is invalid * @since 7.7 */ + @Override public List getLinesBetween(int start, int end, int offset) { Field39F cp = newInstance(this); return SwiftParseUtils.getLines(getLine(cp, start, end, offset)); diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field39M.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field39M.java index 0966963a8..9bfab6b4f 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field39M.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field39M.java @@ -29,12 +29,9 @@ -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -183,19 +180,16 @@ public String getValue() { */ @Override public String getValueDisplay(int component, Locale locale) { - if (component < 1 || component > 1) { + if (component != 1) { throw new IllegalArgumentException("invalid component number " + component + " for field 39M"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -398,7 +392,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field39M(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field401.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field401.java index 7314fc35d..750b07c74 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field401.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field401.java @@ -31,12 +31,9 @@ import java.math.BigInteger; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -185,19 +182,16 @@ public String getValue() { */ @Override public String getValueDisplay(int component, Locale locale) { - if (component < 1 || component > 1) { + if (component != 1) { throw new IllegalArgumentException("invalid component number " + component + " for field 401"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -344,32 +338,14 @@ public Field401 setComponent1(String component1) { return this; } - /** - * Set the component1 from a Long object. - *
- * If the component being set is a fixed length number, the argument will not be - * padded. It is recommended for these cases to use the setComponent1(String) - * method. - * - * @see #setComponent1(String) - * @since 9.2.7 - * - * @param component1 the Long with the Code content to set - * @return the field object to enable build pattern - */ - public Field401 setComponent1(java.lang.Long component1) { - setComponent(1, SwiftFormatUtils.getLong(component1)); - return this; - } /** * Alternative method setter for field's Code (component 1) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10 becomes an Integer) * * @param component1 the Number with the Code content to set * @return the field object to enable build pattern - * @see #setCode(java.lang.Long) */ public Field401 setComponent1(java.lang.Number component1) { @@ -399,27 +375,13 @@ public Field401 setCode(String component1) { return setComponent1(component1); } - /** - * Set the Code (component 1) from a Long object. - * - * @see #setComponent1(java.lang.Long) - * - * @param component1 Long with the Code content to set - * @return the field object to enable build pattern - * @since 9.2.7 - */ - public Field401 setCode(java.lang.Long component1) { - return setComponent1(component1); - } - /** * Alternative method setter for field's Code (component 1) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10 becomes an Integer) * * @param component1 the Number with the Code content to set * @return the field object to enable build pattern - * @see #setCode(java.lang.Long) */ public Field401 setCode(java.lang.Number component1) { return setComponent1(component1); @@ -490,7 +452,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field401(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field405.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field405.java index 1b19cbed7..979d4c206 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field405.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field405.java @@ -31,12 +31,9 @@ import java.math.BigInteger; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -205,16 +202,14 @@ public String getValueDisplay(int component, Locale locale) { //default format (as is) return getComponent(1); } - if (component == 2) { - //default format (as is) - return getComponent(2); - } - return null; + // This is the last component, return directly without `if` + //default format (as is) + return getComponent(2); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -401,32 +396,14 @@ public Field405 setComponent2(String component2) { return this; } - /** - * Set the component2 from a Long object. - *
- * If the component being set is a fixed length number, the argument will not be - * padded. It is recommended for these cases to use the setComponent2(String) - * method. - * - * @see #setComponent2(String) - * @since 9.2.7 - * - * @param component2 the Long with the Line Field Number content to set - * @return the field object to enable build pattern - */ - public Field405 setComponent2(java.lang.Long component2) { - setComponent(2, SwiftFormatUtils.getLong(component2)); - return this; - } /** * Alternative method setter for field's Line Field Number (component 2) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10 becomes an Integer) * * @param component2 the Number with the Line Field Number content to set * @return the field object to enable build pattern - * @see #setLineFieldNumber(java.lang.Long) */ public Field405 setComponent2(java.lang.Number component2) { @@ -456,27 +433,13 @@ public Field405 setLineFieldNumber(String component2) { return setComponent2(component2); } - /** - * Set the Line Field Number (component 2) from a Long object. - * - * @see #setComponent2(java.lang.Long) - * - * @param component2 Long with the Line Field Number content to set - * @return the field object to enable build pattern - * @since 9.2.7 - */ - public Field405 setLineFieldNumber(java.lang.Long component2) { - return setComponent2(component2); - } - /** * Alternative method setter for field's Line Field Number (component 2) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10 becomes an Integer) * * @param component2 the Number with the Line Field Number content to set * @return the field object to enable build pattern - * @see #setLineFieldNumber(java.lang.Long) */ public Field405 setLineFieldNumber(java.lang.Number component2) { return setComponent2(component2); @@ -547,7 +510,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field405(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field40A.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field40A.java index 8a3dc969d..6b5110e86 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field40A.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field40A.java @@ -29,12 +29,9 @@ -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -183,19 +180,16 @@ public String getValue() { */ @Override public String getValueDisplay(int component, Locale locale) { - if (component < 1 || component > 1) { + if (component != 1) { throw new IllegalArgumentException("invalid component number " + component + " for field 40A"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -398,7 +392,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field40A(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field40B.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field40B.java index 1dcf84a1b..dab021d85 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field40B.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field40B.java @@ -30,12 +30,9 @@ import com.prowidesoftware.swift.model.field.MultiLineField; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -203,16 +200,14 @@ public String getValueDisplay(int component, Locale locale) { //default format (as is) return getComponent(1); } - if (component == 2) { - //default format (as is) - return getComponent(2); - } - return null; + // This is the last component, return directly without `if` + //default format (as is) + return getComponent(2); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -455,7 +450,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field40B(f)); } @@ -471,6 +466,7 @@ public static List getAll(final SwiftTagListBlock block) { * @return line content or null if not present or if line number is above the expected * @since 7.7 */ + @Override public String getLine(int line) { return getLine(line, 0); } @@ -484,6 +480,7 @@ public String getLine(int line) { * @return line content or null if not present or if line number is above the expected * @since 7.7 */ + @Override public String getLine(int line, int offset) { Field40B cp = newInstance(this); return getLine(cp, line, null, offset); @@ -496,6 +493,7 @@ public String getLine(int line, int offset) { * @return lines content or empty list if field's value is empty * @since 7.7 */ + @Override public List getLines() { return SwiftParseUtils.getLines(getValue()); } @@ -508,6 +506,7 @@ public List getLines() { * @return found lines or empty list if lines are not present or the offset is invalid * @since 7.7 */ + @Override public List getLines(int offset) { Field40B cp = newInstance(this); return SwiftParseUtils.getLines(getLine(cp, null, null, offset)); @@ -522,6 +521,7 @@ public List getLines(int offset) { * @return found lines or empty list if value is empty * @since 7.7 */ + @Override public List getLinesBetween(int start, int end) { return getLinesBetween(start, end, 0); } @@ -536,6 +536,7 @@ public List getLinesBetween(int start, int end) { * @return found lines or empty list if lines are not present or the offset is invalid * @since 7.7 */ + @Override public List getLinesBetween(int start, int end, int offset) { Field40B cp = newInstance(this); return SwiftParseUtils.getLines(getLine(cp, start, end, offset)); diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field40C.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field40C.java index 706a8e2c2..d29775eea 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field40C.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field40C.java @@ -29,12 +29,9 @@ -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -200,16 +197,14 @@ public String getValueDisplay(int component, Locale locale) { //default format (as is) return getComponent(1); } - if (component == 2) { - //default format (as is) - return getComponent(2); - } - return null; + // This is the last component, return directly without `if` + //default format (as is) + return getComponent(2); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -455,7 +450,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field40C(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field40D.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field40D.java index 34ac5f0a8..17128e945 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field40D.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field40D.java @@ -29,12 +29,9 @@ -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -183,19 +180,16 @@ public String getValue() { */ @Override public String getValueDisplay(int component, Locale locale) { - if (component < 1 || component > 1) { + if (component != 1) { throw new IllegalArgumentException("invalid component number " + component + " for field 40D"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -398,7 +392,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field40D(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field40E.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field40E.java index ff1c16653..616e02c10 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field40E.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field40E.java @@ -29,12 +29,9 @@ -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -200,16 +197,14 @@ public String getValueDisplay(int component, Locale locale) { //default format (as is) return getComponent(1); } - if (component == 2) { - //default format (as is) - return getComponent(2); - } - return null; + // This is the last component, return directly without `if` + //default format (as is) + return getComponent(2); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -455,7 +450,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field40E(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field40F.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field40F.java index ca6385559..d9fdf2ffc 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field40F.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field40F.java @@ -29,12 +29,9 @@ -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -183,19 +180,16 @@ public String getValue() { */ @Override public String getValueDisplay(int component, Locale locale) { - if (component < 1 || component > 1) { + if (component != 1) { throw new IllegalArgumentException("invalid component number " + component + " for field 40F"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -398,7 +392,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field40F(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field41A.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field41A.java index 028d82fec..dfdc32ba8 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field41A.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field41A.java @@ -33,12 +33,9 @@ import com.prowidesoftware.swift.model.field.BICContainer; import com.prowidesoftware.swift.model.field.BICResolver; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -207,16 +204,14 @@ public String getValueDisplay(int component, Locale locale) { //default format (as is) return getComponent(1); } - if (component == 2) { - //default format (as is) - return getComponent(2); - } - return null; + // This is the last component, return directly without `if` + //default format (as is) + return getComponent(2); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -438,10 +433,12 @@ public Field41A setCode(String component2) { } + @Override public List bics() { return BICResolver.bics(this); } + @Override public List bicStrings () { return BICResolver.bicStrings(this); } @@ -510,7 +507,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field41A(f)); } @@ -526,6 +523,7 @@ public static List getAll(final SwiftTagListBlock block) { * @return line content or null if not present or if line number is above the expected * @since 7.7 */ + @Override public String getLine(int line) { return getLine(line, 0); } @@ -539,6 +537,7 @@ public String getLine(int line) { * @return line content or null if not present or if line number is above the expected * @since 7.7 */ + @Override public String getLine(int line, int offset) { Field41A cp = newInstance(this); return getLine(cp, line, null, offset); @@ -551,6 +550,7 @@ public String getLine(int line, int offset) { * @return lines content or empty list if field's value is empty * @since 7.7 */ + @Override public List getLines() { return SwiftParseUtils.getLines(getValue()); } @@ -563,6 +563,7 @@ public List getLines() { * @return found lines or empty list if lines are not present or the offset is invalid * @since 7.7 */ + @Override public List getLines(int offset) { Field41A cp = newInstance(this); return SwiftParseUtils.getLines(getLine(cp, null, null, offset)); @@ -577,6 +578,7 @@ public List getLines(int offset) { * @return found lines or empty list if value is empty * @since 7.7 */ + @Override public List getLinesBetween(int start, int end) { return getLinesBetween(start, end, 0); } @@ -591,6 +593,7 @@ public List getLinesBetween(int start, int end) { * @return found lines or empty list if lines are not present or the offset is invalid * @since 7.7 */ + @Override public List getLinesBetween(int start, int end, int offset) { Field41A cp = newInstance(this); return SwiftParseUtils.getLines(getLine(cp, start, end, offset)); diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field41D.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field41D.java index d746117e8..da821b9ae 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field41D.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field41D.java @@ -30,12 +30,9 @@ import com.prowidesoftware.swift.model.field.MultiLineField; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -231,16 +228,14 @@ public String getValueDisplay(int component, Locale locale) { //default format (as is) return getComponent(4); } - if (component == 5) { - //default format (as is) - return getComponent(5); - } - return null; + // This is the last component, return directly without `if` + //default format (as is) + return getComponent(5); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -652,7 +647,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field41D(f)); } @@ -668,6 +663,7 @@ public static List getAll(final SwiftTagListBlock block) { * @return line content or null if not present or if line number is above the expected * @since 7.7 */ + @Override public String getLine(int line) { return getLine(line, 0); } @@ -681,6 +677,7 @@ public String getLine(int line) { * @return line content or null if not present or if line number is above the expected * @since 7.7 */ + @Override public String getLine(int line, int offset) { Field41D cp = newInstance(this); return getLine(cp, line, null, offset); @@ -693,6 +690,7 @@ public String getLine(int line, int offset) { * @return lines content or empty list if field's value is empty * @since 7.7 */ + @Override public List getLines() { return SwiftParseUtils.getLines(getValue()); } @@ -705,6 +703,7 @@ public List getLines() { * @return found lines or empty list if lines are not present or the offset is invalid * @since 7.7 */ + @Override public List getLines(int offset) { Field41D cp = newInstance(this); return SwiftParseUtils.getLines(getLine(cp, null, null, offset)); @@ -719,6 +718,7 @@ public List getLines(int offset) { * @return found lines or empty list if value is empty * @since 7.7 */ + @Override public List getLinesBetween(int start, int end) { return getLinesBetween(start, end, 0); } @@ -733,6 +733,7 @@ public List getLinesBetween(int start, int end) { * @return found lines or empty list if lines are not present or the offset is invalid * @since 7.7 */ + @Override public List getLinesBetween(int start, int end, int offset) { Field41D cp = newInstance(this); return SwiftParseUtils.getLines(getLine(cp, start, end, offset)); diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field41F.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field41F.java index 50b1afb08..6dba08a42 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field41F.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field41F.java @@ -32,12 +32,9 @@ import com.prowidesoftware.swift.model.field.BICContainer; import com.prowidesoftware.swift.model.field.BICResolver; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -187,19 +184,16 @@ public String getValue() { */ @Override public String getValueDisplay(int component, Locale locale) { - if (component < 1 || component > 1) { + if (component != 1) { throw new IllegalArgumentException("invalid component number " + component + " for field 41F"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -381,10 +375,12 @@ public Field41F setIdentifierCode(com.prowidesoftware.swift.model.BIC component1 } + @Override public List bics() { return BICResolver.bics(this); } + @Override public List bicStrings () { return BICResolver.bicStrings(this); } @@ -453,7 +449,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field41F(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field41G.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field41G.java index b22c47445..8d2a67856 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field41G.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field41G.java @@ -30,12 +30,9 @@ import com.prowidesoftware.swift.model.field.MultiLineField; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -203,16 +200,14 @@ public String getValueDisplay(int component, Locale locale) { //default format (as is) return getComponent(3); } - if (component == 4) { - //default format (as is) - return getComponent(4); - } - return null; + // This is the last component, return directly without `if` + //default format (as is) + return getComponent(4); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -584,7 +579,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field41G(f)); } @@ -600,6 +595,7 @@ public static List getAll(final SwiftTagListBlock block) { * @return line content or null if not present or if line number is above the expected * @since 7.7 */ + @Override public String getLine(int line) { return getLine(line, 0); } @@ -613,6 +609,7 @@ public String getLine(int line) { * @return line content or null if not present or if line number is above the expected * @since 7.7 */ + @Override public String getLine(int line, int offset) { Field41G cp = newInstance(this); return getLine(cp, line, null, offset); @@ -625,6 +622,7 @@ public String getLine(int line, int offset) { * @return lines content or empty list if field's value is empty * @since 7.7 */ + @Override public List getLines() { return SwiftParseUtils.getLines(getValue()); } @@ -637,6 +635,7 @@ public List getLines() { * @return found lines or empty list if lines are not present or the offset is invalid * @since 7.7 */ + @Override public List getLines(int offset) { Field41G cp = newInstance(this); return SwiftParseUtils.getLines(getLine(cp, null, null, offset)); @@ -651,6 +650,7 @@ public List getLines(int offset) { * @return found lines or empty list if value is empty * @since 7.7 */ + @Override public List getLinesBetween(int start, int end) { return getLinesBetween(start, end, 0); } @@ -665,6 +665,7 @@ public List getLinesBetween(int start, int end) { * @return found lines or empty list if lines are not present or the offset is invalid * @since 7.7 */ + @Override public List getLinesBetween(int start, int end, int offset) { Field41G cp = newInstance(this); return SwiftParseUtils.getLines(getLine(cp, start, end, offset)); diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field421.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field421.java index ea120b448..a70ab1ad8 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field421.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field421.java @@ -29,12 +29,9 @@ -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -183,19 +180,16 @@ public String getValue() { */ @Override public String getValueDisplay(int component, Locale locale) { - if (component < 1 || component > 1) { + if (component != 1) { throw new IllegalArgumentException("invalid component number " + component + " for field 421"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -398,7 +392,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field421(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field422.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field422.java index 57282a31c..1a05a0581 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field422.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field422.java @@ -29,12 +29,9 @@ -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -214,7 +211,6 @@ public String getValue() { final StringBuilder result = new StringBuilder(); //FIXME serialization 12*(S/S) // @NotImplemented - int notImplemented; return result.toString(); } @@ -324,16 +320,14 @@ public String getValueDisplay(int component, Locale locale) { //default format (as is) return getComponent(23); } - if (component == 24) { - //default format (as is) - return getComponent(24); - } - return null; + // This is the last component, return directly without `if` + //default format (as is) + return getComponent(24); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -976,7 +970,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field422(f)); } @@ -991,11 +985,9 @@ public static List getAll(final SwiftTagListBlock block) { * @since 7.10.3 * @see Field#fromJson(String) */ + @SuppressWarnings("unused") public static Field422 fromJson(final String json) { - final Field422 field = new Field422(); - - @@ -1020,7 +1012,7 @@ public static Field422 fromJson(final String json) { - return field; + return new Field422(); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field423.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field423.java index 9ebb7441a..869b6ccd7 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field423.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field423.java @@ -29,12 +29,9 @@ -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -183,19 +180,16 @@ public String getValue() { */ @Override public String getValueDisplay(int component, Locale locale) { - if (component < 1 || component > 1) { + if (component != 1) { throw new IllegalArgumentException("invalid component number " + component + " for field 423"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -398,7 +392,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field423(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field424.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field424.java index 7ef8e856b..eccdd2272 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field424.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field424.java @@ -29,12 +29,9 @@ -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -183,19 +180,16 @@ public String getValue() { */ @Override public String getValueDisplay(int component, Locale locale) { - if (component < 1 || component > 1) { + if (component != 1) { throw new IllegalArgumentException("invalid component number " + component + " for field 424"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -398,7 +392,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field424(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field425.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field425.java index b6d1a4842..a0a78e8ef 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field425.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field425.java @@ -29,12 +29,9 @@ -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -230,7 +227,6 @@ public String getValue() { final StringBuilder result = new StringBuilder(); //FIXME serialization 20*(S/S) // @NotImplemented - int notImplemented; return result.toString(); } @@ -404,16 +400,14 @@ public String getValueDisplay(int component, Locale locale) { //default format (as is) return getComponent(39); } - if (component == 40) { - //default format (as is) - return getComponent(40); - } - return null; + // This is the last component, return directly without `if` + //default format (as is) + return getComponent(40); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -1376,7 +1370,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field425(f)); } @@ -1391,11 +1385,9 @@ public static List getAll(final SwiftTagListBlock block) { * @since 7.10.3 * @see Field#fromJson(String) */ + @SuppressWarnings("unused") public static Field425 fromJson(final String json) { - final Field425 field = new Field425(); - - @@ -1436,7 +1428,7 @@ public static Field425 fromJson(final String json) { - return field; + return new Field425(); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field42A.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field42A.java index f7b80ed23..ddda8cb73 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field42A.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field42A.java @@ -33,12 +33,9 @@ import com.prowidesoftware.swift.model.field.BICContainer; import com.prowidesoftware.swift.model.field.BICResolver; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -242,10 +239,12 @@ public Field42A setIdentifierCode(com.prowidesoftware.swift.model.BIC component3 } + @Override public List bics() { return BICResolver.bics(this); } + @Override public List bicStrings () { return BICResolver.bicStrings(this); } @@ -314,7 +313,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field42A(f)); } @@ -330,6 +329,7 @@ public static List getAll(final SwiftTagListBlock block) { * @return line content or null if not present or if line number is above the expected * @since 7.7 */ + @Override public String getLine(int line) { return getLine(line, 0); } @@ -343,6 +343,7 @@ public String getLine(int line) { * @return line content or null if not present or if line number is above the expected * @since 7.7 */ + @Override public String getLine(int line, int offset) { Field42A cp = newInstance(this); return getLine(cp, line, null, offset); @@ -355,6 +356,7 @@ public String getLine(int line, int offset) { * @return lines content or empty list if field's value is empty * @since 7.7 */ + @Override public List getLines() { return SwiftParseUtils.getLines(getValue()); } @@ -367,6 +369,7 @@ public List getLines() { * @return found lines or empty list if lines are not present or the offset is invalid * @since 7.7 */ + @Override public List getLines(int offset) { Field42A cp = newInstance(this); return SwiftParseUtils.getLines(getLine(cp, null, null, offset)); @@ -381,6 +384,7 @@ public List getLines(int offset) { * @return found lines or empty list if value is empty * @since 7.7 */ + @Override public List getLinesBetween(int start, int end) { return getLinesBetween(start, end, 0); } @@ -395,6 +399,7 @@ public List getLinesBetween(int start, int end) { * @return found lines or empty list if lines are not present or the offset is invalid * @since 7.7 */ + @Override public List getLinesBetween(int start, int end, int offset) { Field42A cp = newInstance(this); return SwiftParseUtils.getLines(getLine(cp, start, end, offset)); diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field42C.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field42C.java index 5d7d50d54..eaa0e6f62 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field42C.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field42C.java @@ -30,12 +30,9 @@ import com.prowidesoftware.swift.model.field.MultiLineField; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -198,16 +195,14 @@ public String getValueDisplay(int component, Locale locale) { //default format (as is) return getComponent(2); } - if (component == 3) { - //default format (as is) - return getComponent(3); - } - return null; + // This is the last component, return directly without `if` + //default format (as is) + return getComponent(3); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -536,7 +531,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field42C(f)); } @@ -552,6 +547,7 @@ public static List getAll(final SwiftTagListBlock block) { * @return line content or null if not present or if line number is above the expected * @since 7.7 */ + @Override public String getLine(int line) { return getLine(line, 0); } @@ -565,6 +561,7 @@ public String getLine(int line) { * @return line content or null if not present or if line number is above the expected * @since 7.7 */ + @Override public String getLine(int line, int offset) { Field42C cp = newInstance(this); return getLine(cp, line, null, offset); @@ -577,6 +574,7 @@ public String getLine(int line, int offset) { * @return lines content or empty list if field's value is empty * @since 7.7 */ + @Override public List getLines() { return SwiftParseUtils.getLines(getValue()); } @@ -589,6 +587,7 @@ public List getLines() { * @return found lines or empty list if lines are not present or the offset is invalid * @since 7.7 */ + @Override public List getLines(int offset) { Field42C cp = newInstance(this); return SwiftParseUtils.getLines(getLine(cp, null, null, offset)); @@ -603,6 +602,7 @@ public List getLines(int offset) { * @return found lines or empty list if value is empty * @since 7.7 */ + @Override public List getLinesBetween(int start, int end) { return getLinesBetween(start, end, 0); } @@ -617,6 +617,7 @@ public List getLinesBetween(int start, int end) { * @return found lines or empty list if lines are not present or the offset is invalid * @since 7.7 */ + @Override public List getLinesBetween(int start, int end, int offset) { Field42C cp = newInstance(this); return SwiftParseUtils.getLines(getLine(cp, start, end, offset)); diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field42D.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field42D.java index d71005edd..29b614643 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field42D.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field42D.java @@ -30,12 +30,9 @@ import com.prowidesoftware.swift.model.field.MultiLineField; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -358,7 +355,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field42D(f)); } @@ -374,6 +371,7 @@ public static List getAll(final SwiftTagListBlock block) { * @return line content or null if not present or if line number is above the expected * @since 7.7 */ + @Override public String getLine(int line) { return getLine(line, 0); } @@ -387,6 +385,7 @@ public String getLine(int line) { * @return line content or null if not present or if line number is above the expected * @since 7.7 */ + @Override public String getLine(int line, int offset) { Field42D cp = newInstance(this); return getLine(cp, line, null, offset); @@ -399,6 +398,7 @@ public String getLine(int line, int offset) { * @return lines content or empty list if field's value is empty * @since 7.7 */ + @Override public List getLines() { return SwiftParseUtils.getLines(getValue()); } @@ -411,6 +411,7 @@ public List getLines() { * @return found lines or empty list if lines are not present or the offset is invalid * @since 7.7 */ + @Override public List getLines(int offset) { Field42D cp = newInstance(this); return SwiftParseUtils.getLines(getLine(cp, null, null, offset)); @@ -425,6 +426,7 @@ public List getLines(int offset) { * @return found lines or empty list if value is empty * @since 7.7 */ + @Override public List getLinesBetween(int start, int end) { return getLinesBetween(start, end, 0); } @@ -439,6 +441,7 @@ public List getLinesBetween(int start, int end) { * @return found lines or empty list if lines are not present or the offset is invalid * @since 7.7 */ + @Override public List getLinesBetween(int start, int end, int offset) { Field42D cp = newInstance(this); return SwiftParseUtils.getLines(getLine(cp, start, end, offset)); diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field42M.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field42M.java index 92036a380..b82a234e7 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field42M.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field42M.java @@ -30,12 +30,9 @@ import com.prowidesoftware.swift.model.field.MultiLineField; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -203,16 +200,14 @@ public String getValueDisplay(int component, Locale locale) { //default format (as is) return getComponent(3); } - if (component == 4) { - //default format (as is) - return getComponent(4); - } - return null; + // This is the last component, return directly without `if` + //default format (as is) + return getComponent(4); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -584,7 +579,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field42M(f)); } @@ -600,6 +595,7 @@ public static List getAll(final SwiftTagListBlock block) { * @return line content or null if not present or if line number is above the expected * @since 7.7 */ + @Override public String getLine(int line) { return getLine(line, 0); } @@ -613,6 +609,7 @@ public String getLine(int line) { * @return line content or null if not present or if line number is above the expected * @since 7.7 */ + @Override public String getLine(int line, int offset) { Field42M cp = newInstance(this); return getLine(cp, line, null, offset); @@ -625,6 +622,7 @@ public String getLine(int line, int offset) { * @return lines content or empty list if field's value is empty * @since 7.7 */ + @Override public List getLines() { return SwiftParseUtils.getLines(getValue()); } @@ -637,6 +635,7 @@ public List getLines() { * @return found lines or empty list if lines are not present or the offset is invalid * @since 7.7 */ + @Override public List getLines(int offset) { Field42M cp = newInstance(this); return SwiftParseUtils.getLines(getLine(cp, null, null, offset)); @@ -651,6 +650,7 @@ public List getLines(int offset) { * @return found lines or empty list if value is empty * @since 7.7 */ + @Override public List getLinesBetween(int start, int end) { return getLinesBetween(start, end, 0); } @@ -665,6 +665,7 @@ public List getLinesBetween(int start, int end) { * @return found lines or empty list if lines are not present or the offset is invalid * @since 7.7 */ + @Override public List getLinesBetween(int start, int end, int offset) { Field42M cp = newInstance(this); return SwiftParseUtils.getLines(getLine(cp, start, end, offset)); diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field42P.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field42P.java index 0d2d1b0a9..febf39d8a 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field42P.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field42P.java @@ -30,12 +30,9 @@ import com.prowidesoftware.swift.model.field.MultiLineField; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -203,16 +200,14 @@ public String getValueDisplay(int component, Locale locale) { //default format (as is) return getComponent(3); } - if (component == 4) { - //default format (as is) - return getComponent(4); - } - return null; + // This is the last component, return directly without `if` + //default format (as is) + return getComponent(4); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -584,7 +579,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field42P(f)); } @@ -600,6 +595,7 @@ public static List getAll(final SwiftTagListBlock block) { * @return line content or null if not present or if line number is above the expected * @since 7.7 */ + @Override public String getLine(int line) { return getLine(line, 0); } @@ -613,6 +609,7 @@ public String getLine(int line) { * @return line content or null if not present or if line number is above the expected * @since 7.7 */ + @Override public String getLine(int line, int offset) { Field42P cp = newInstance(this); return getLine(cp, line, null, offset); @@ -625,6 +622,7 @@ public String getLine(int line, int offset) { * @return lines content or empty list if field's value is empty * @since 7.7 */ + @Override public List getLines() { return SwiftParseUtils.getLines(getValue()); } @@ -637,6 +635,7 @@ public List getLines() { * @return found lines or empty list if lines are not present or the offset is invalid * @since 7.7 */ + @Override public List getLines(int offset) { Field42P cp = newInstance(this); return SwiftParseUtils.getLines(getLine(cp, null, null, offset)); @@ -651,6 +650,7 @@ public List getLines(int offset) { * @return found lines or empty list if value is empty * @since 7.7 */ + @Override public List getLinesBetween(int start, int end) { return getLinesBetween(start, end, 0); } @@ -665,6 +665,7 @@ public List getLinesBetween(int start, int end) { * @return found lines or empty list if lines are not present or the offset is invalid * @since 7.7 */ + @Override public List getLinesBetween(int start, int end, int offset) { Field42P cp = newInstance(this); return SwiftParseUtils.getLines(getLine(cp, start, end, offset)); diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field431.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field431.java index fad6e2747..e8778f16d 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field431.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field431.java @@ -31,12 +31,9 @@ import java.math.BigInteger; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -185,19 +182,16 @@ public String getValue() { */ @Override public String getValueDisplay(int component, Locale locale) { - if (component < 1 || component > 1) { + if (component != 1) { throw new IllegalArgumentException("invalid component number " + component + " for field 431"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -344,32 +338,14 @@ public Field431 setComponent1(String component1) { return this; } - /** - * Set the component1 from a Long object. - *
- * If the component being set is a fixed length number, the argument will not be - * padded. It is recommended for these cases to use the setComponent1(String) - * method. - * - * @see #setComponent1(String) - * @since 9.2.7 - * - * @param component1 the Long with the Status Code content to set - * @return the field object to enable build pattern - */ - public Field431 setComponent1(java.lang.Long component1) { - setComponent(1, SwiftFormatUtils.getLong(component1)); - return this; - } /** * Alternative method setter for field's Status Code (component 1) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10 becomes an Integer) * * @param component1 the Number with the Status Code content to set * @return the field object to enable build pattern - * @see #setStatusCode(java.lang.Long) */ public Field431 setComponent1(java.lang.Number component1) { @@ -399,27 +375,13 @@ public Field431 setStatusCode(String component1) { return setComponent1(component1); } - /** - * Set the Status Code (component 1) from a Long object. - * - * @see #setComponent1(java.lang.Long) - * - * @param component1 Long with the Status Code content to set - * @return the field object to enable build pattern - * @since 9.2.7 - */ - public Field431 setStatusCode(java.lang.Long component1) { - return setComponent1(component1); - } - /** * Alternative method setter for field's Status Code (component 1) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10 becomes an Integer) * * @param component1 the Number with the Status Code content to set * @return the field object to enable build pattern - * @see #setStatusCode(java.lang.Long) */ public Field431 setStatusCode(java.lang.Number component1) { return setComponent1(component1); @@ -490,7 +452,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field431(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field432.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field432.java index 5da26c20c..cd4459415 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field432.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field432.java @@ -29,12 +29,9 @@ -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -183,19 +180,16 @@ public String getValue() { */ @Override public String getValueDisplay(int component, Locale locale) { - if (component < 1 || component > 1) { + if (component != 1) { throw new IllegalArgumentException("invalid component number " + component + " for field 432"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -398,7 +392,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field432(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field433.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field433.java index d488b54da..2e57329b6 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field433.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field433.java @@ -29,12 +29,9 @@ -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -200,16 +197,14 @@ public String getValueDisplay(int component, Locale locale) { //default format (as is) return getComponent(1); } - if (component == 2) { - //default format (as is) - return getComponent(2); - } - return null; + // This is the last component, return directly without `if` + //default format (as is) + return getComponent(2); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -452,7 +447,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field433(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field434.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field434.java index 687711236..2bcca3353 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field434.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field434.java @@ -29,12 +29,9 @@ -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -200,16 +197,14 @@ public String getValueDisplay(int component, Locale locale) { //default format (as is) return getComponent(1); } - if (component == 2) { - //default format (as is) - return getComponent(2); - } - return null; + // This is the last component, return directly without `if` + //default format (as is) + return getComponent(2); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -452,7 +447,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field434(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field43P.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field43P.java index 8ca0a4c13..46dc3bea7 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field43P.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field43P.java @@ -29,12 +29,9 @@ -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -184,19 +181,16 @@ public String getValue() { */ @Override public String getValueDisplay(int component, Locale locale) { - if (component < 1 || component > 1) { + if (component != 1) { throw new IllegalArgumentException("invalid component number " + component + " for field 43P"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -402,7 +396,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field43P(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field43T.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field43T.java index 0ae53c41c..200ca85ac 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field43T.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field43T.java @@ -29,12 +29,9 @@ -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -184,19 +181,16 @@ public String getValue() { */ @Override public String getValueDisplay(int component, Locale locale) { - if (component < 1 || component > 1) { + if (component != 1) { throw new IllegalArgumentException("invalid component number " + component + " for field 43T"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -402,7 +396,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field43T(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field443.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field443.java index 51449cb93..a138d5015 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field443.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field443.java @@ -29,12 +29,9 @@ -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -183,19 +180,16 @@ public String getValue() { */ @Override public String getValueDisplay(int component, Locale locale) { - if (component < 1 || component > 1) { + if (component != 1) { throw new IllegalArgumentException("invalid component number " + component + " for field 443"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -398,7 +392,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field443(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field44A.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field44A.java index 4d1f619ea..2b30b9928 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field44A.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field44A.java @@ -29,12 +29,9 @@ -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -183,19 +180,16 @@ public String getValue() { */ @Override public String getValueDisplay(int component, Locale locale) { - if (component < 1 || component > 1) { + if (component != 1) { throw new IllegalArgumentException("invalid component number " + component + " for field 44A"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -398,7 +392,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field44A(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field44B.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field44B.java index ed3019183..17f7c0453 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field44B.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field44B.java @@ -29,12 +29,9 @@ -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -183,19 +180,16 @@ public String getValue() { */ @Override public String getValueDisplay(int component, Locale locale) { - if (component < 1 || component > 1) { + if (component != 1) { throw new IllegalArgumentException("invalid component number " + component + " for field 44B"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -398,7 +392,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field44B(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field44C.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field44C.java index 25ee25e03..555c8e156 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field44C.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field44C.java @@ -32,12 +32,9 @@ import com.prowidesoftware.swift.model.field.DateContainer; import com.prowidesoftware.swift.model.field.DateResolver; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -186,23 +183,21 @@ public String getValue() { */ @Override public String getValueDisplay(int component, Locale locale) { - if (component < 1 || component > 1) { + if (component != 1) { throw new IllegalArgumentException("invalid component number " + component + " for field 44C"); } - if (component == 1) { - //date: [YY]YYMMDD - java.text.DateFormat f = java.text.DateFormat.getDateInstance(java.text.DateFormat.DEFAULT, notNull(locale)); - java.util.Calendar cal = getComponent1AsCalendar(); - if (cal != null) { - return f.format(cal.getTime()); - } + //date: [YY]YYMMDD + java.text.DateFormat f = java.text.DateFormat.getDateInstance(java.text.DateFormat.DEFAULT, notNull(locale)); + java.util.Calendar cal = getComponent1AsCalendar(); + if (cal != null) { + return f.format(cal.getTime()); } return null; } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -386,6 +381,7 @@ public Field44C setDate(java.util.Calendar component1) { * * @return the list of converted components (a Calendar object or null) */ + @Override public List dates() { return DateResolver.dates(this); } @@ -463,7 +459,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field44C(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field44D.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field44D.java index 3d79e5996..089510b29 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field44D.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field44D.java @@ -30,12 +30,9 @@ import com.prowidesoftware.swift.model.field.MultiLineField; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -213,16 +210,14 @@ public String getValueDisplay(int component, Locale locale) { //default format (as is) return getComponent(5); } - if (component == 6) { - //default format (as is) - return getComponent(6); - } - return null; + // This is the last component, return directly without `if` + //default format (as is) + return getComponent(6); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -680,7 +675,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field44D(f)); } @@ -696,6 +691,7 @@ public static List getAll(final SwiftTagListBlock block) { * @return line content or null if not present or if line number is above the expected * @since 7.7 */ + @Override public String getLine(int line) { return getLine(line, 0); } @@ -709,6 +705,7 @@ public String getLine(int line) { * @return line content or null if not present or if line number is above the expected * @since 7.7 */ + @Override public String getLine(int line, int offset) { Field44D cp = newInstance(this); return getLine(cp, line, null, offset); @@ -721,6 +718,7 @@ public String getLine(int line, int offset) { * @return lines content or empty list if field's value is empty * @since 7.7 */ + @Override public List getLines() { return SwiftParseUtils.getLines(getValue()); } @@ -733,6 +731,7 @@ public List getLines() { * @return found lines or empty list if lines are not present or the offset is invalid * @since 7.7 */ + @Override public List getLines(int offset) { Field44D cp = newInstance(this); return SwiftParseUtils.getLines(getLine(cp, null, null, offset)); @@ -747,6 +746,7 @@ public List getLines(int offset) { * @return found lines or empty list if value is empty * @since 7.7 */ + @Override public List getLinesBetween(int start, int end) { return getLinesBetween(start, end, 0); } @@ -761,6 +761,7 @@ public List getLinesBetween(int start, int end) { * @return found lines or empty list if lines are not present or the offset is invalid * @since 7.7 */ + @Override public List getLinesBetween(int start, int end, int offset) { Field44D cp = newInstance(this); return SwiftParseUtils.getLines(getLine(cp, start, end, offset)); diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field44E.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field44E.java index 3dd316665..bb5ee4f20 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field44E.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field44E.java @@ -29,12 +29,9 @@ -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -183,19 +180,16 @@ public String getValue() { */ @Override public String getValueDisplay(int component, Locale locale) { - if (component < 1 || component > 1) { + if (component != 1) { throw new IllegalArgumentException("invalid component number " + component + " for field 44E"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -398,7 +392,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field44E(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field44F.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field44F.java index 68e5756c8..77cfbab60 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field44F.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field44F.java @@ -29,12 +29,9 @@ -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -183,19 +180,16 @@ public String getValue() { */ @Override public String getValueDisplay(int component, Locale locale) { - if (component < 1 || component > 1) { + if (component != 1) { throw new IllegalArgumentException("invalid component number " + component + " for field 44F"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -398,7 +392,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field44F(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field44J.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field44J.java index e771c8092..a8ab4a898 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field44J.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field44J.java @@ -30,12 +30,9 @@ import com.prowidesoftware.swift.model.field.MultiLineField; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -219,16 +216,14 @@ public String getValueDisplay(int component, Locale locale) { //default format (as is) return getComponent(2); } - if (component == 3) { - //default format (as is) - return getComponent(3); - } - return null; + // This is the last component, return directly without `if` + //default format (as is) + return getComponent(3); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -517,7 +512,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field44J(f)); } @@ -533,6 +528,7 @@ public static List getAll(final SwiftTagListBlock block) { * @return line content or null if not present or if line number is above the expected * @since 7.7 */ + @Override public String getLine(int line) { return getLine(line, 0); } @@ -546,6 +542,7 @@ public String getLine(int line) { * @return line content or null if not present or if line number is above the expected * @since 7.7 */ + @Override public String getLine(int line, int offset) { Field44J cp = newInstance(this); return getLine(cp, line, null, offset); @@ -558,6 +555,7 @@ public String getLine(int line, int offset) { * @return lines content or empty list if field's value is empty * @since 7.7 */ + @Override public List getLines() { return SwiftParseUtils.getLines(getValue()); } @@ -570,6 +568,7 @@ public List getLines() { * @return found lines or empty list if lines are not present or the offset is invalid * @since 7.7 */ + @Override public List getLines(int offset) { Field44J cp = newInstance(this); return SwiftParseUtils.getLines(getLine(cp, null, null, offset)); @@ -584,6 +583,7 @@ public List getLines(int offset) { * @return found lines or empty list if value is empty * @since 7.7 */ + @Override public List getLinesBetween(int start, int end) { return getLinesBetween(start, end, 0); } @@ -598,6 +598,7 @@ public List getLinesBetween(int start, int end) { * @return found lines or empty list if lines are not present or the offset is invalid * @since 7.7 */ + @Override public List getLinesBetween(int start, int end, int offset) { Field44J cp = newInstance(this); return SwiftParseUtils.getLines(getLine(cp, start, end, offset)); diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field451.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field451.java index f77e6c1b4..e1c067507 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field451.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field451.java @@ -31,12 +31,9 @@ import java.math.BigInteger; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -185,19 +182,16 @@ public String getValue() { */ @Override public String getValueDisplay(int component, Locale locale) { - if (component < 1 || component > 1) { + if (component != 1) { throw new IllegalArgumentException("invalid component number " + component + " for field 451"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -344,32 +338,14 @@ public Field451 setComponent1(String component1) { return this; } - /** - * Set the component1 from a Long object. - *
- * If the component being set is a fixed length number, the argument will not be - * padded. It is recommended for these cases to use the setComponent1(String) - * method. - * - * @see #setComponent1(String) - * @since 9.2.7 - * - * @param component1 the Long with the Accept Reject Option content to set - * @return the field object to enable build pattern - */ - public Field451 setComponent1(java.lang.Long component1) { - setComponent(1, SwiftFormatUtils.getLong(component1)); - return this; - } /** * Alternative method setter for field's Accept Reject Option (component 1) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10 becomes an Integer) * * @param component1 the Number with the Accept Reject Option content to set * @return the field object to enable build pattern - * @see #setAcceptRejectOption(java.lang.Long) */ public Field451 setComponent1(java.lang.Number component1) { @@ -399,27 +375,13 @@ public Field451 setAcceptRejectOption(String component1) { return setComponent1(component1); } - /** - * Set the Accept Reject Option (component 1) from a Long object. - * - * @see #setComponent1(java.lang.Long) - * - * @param component1 Long with the Accept Reject Option content to set - * @return the field object to enable build pattern - * @since 9.2.7 - */ - public Field451 setAcceptRejectOption(java.lang.Long component1) { - return setComponent1(component1); - } - /** * Alternative method setter for field's Accept Reject Option (component 1) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10 becomes an Integer) * * @param component1 the Number with the Accept Reject Option content to set * @return the field object to enable build pattern - * @see #setAcceptRejectOption(java.lang.Long) */ public Field451 setAcceptRejectOption(java.lang.Number component1) { return setComponent1(component1); @@ -490,7 +452,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field451(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field45A.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field45A.java index eb081eeed..6a7776b67 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field45A.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field45A.java @@ -30,12 +30,9 @@ import com.prowidesoftware.swift.model.field.MultiLineField; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -184,19 +181,16 @@ public String getValue() { */ @Override public String getValueDisplay(int component, Locale locale) { - if (component < 1 || component > 1) { + if (component != 1) { throw new IllegalArgumentException("invalid component number " + component + " for field 45A"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -399,7 +393,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field45A(f)); } @@ -415,6 +409,7 @@ public static List getAll(final SwiftTagListBlock block) { * @return line content or null if not present or if line number is above the expected * @since 7.7 */ + @Override public String getLine(int line) { return getLine(line, 0); } @@ -428,6 +423,7 @@ public String getLine(int line) { * @return line content or null if not present or if line number is above the expected * @since 7.7 */ + @Override public String getLine(int line, int offset) { Field45A cp = newInstance(this); return getLine(cp, line, null, offset); @@ -440,6 +436,7 @@ public String getLine(int line, int offset) { * @return lines content or empty list if field's value is empty * @since 7.7 */ + @Override public List getLines() { return SwiftParseUtils.getLines(getValue()); } @@ -452,6 +449,7 @@ public List getLines() { * @return found lines or empty list if lines are not present or the offset is invalid * @since 7.7 */ + @Override public List getLines(int offset) { Field45A cp = newInstance(this); return SwiftParseUtils.getLines(getLine(cp, null, null, offset)); @@ -466,6 +464,7 @@ public List getLines(int offset) { * @return found lines or empty list if value is empty * @since 7.7 */ + @Override public List getLinesBetween(int start, int end) { return getLinesBetween(start, end, 0); } @@ -480,6 +479,7 @@ public List getLinesBetween(int start, int end) { * @return found lines or empty list if lines are not present or the offset is invalid * @since 7.7 */ + @Override public List getLinesBetween(int start, int end, int offset) { Field45A cp = newInstance(this); return SwiftParseUtils.getLines(getLine(cp, start, end, offset)); diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field45B.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field45B.java index c4efe2cb7..d2e5dfd58 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field45B.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field45B.java @@ -30,12 +30,9 @@ import com.prowidesoftware.swift.model.field.MultiLineField; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -246,7 +243,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field45B(f)); } @@ -262,6 +259,7 @@ public static List getAll(final SwiftTagListBlock block) { * @return line content or null if not present or if line number is above the expected * @since 7.7 */ + @Override public String getLine(int line) { return getLine(line, 0); } @@ -275,6 +273,7 @@ public String getLine(int line) { * @return line content or null if not present or if line number is above the expected * @since 7.7 */ + @Override public String getLine(int line, int offset) { Field45B cp = newInstance(this); return getLine(cp, line, null, offset); @@ -287,6 +286,7 @@ public String getLine(int line, int offset) { * @return lines content or empty list if field's value is empty * @since 7.7 */ + @Override public List getLines() { return SwiftParseUtils.getLines(getValue()); } @@ -299,6 +299,7 @@ public List getLines() { * @return found lines or empty list if lines are not present or the offset is invalid * @since 7.7 */ + @Override public List getLines(int offset) { Field45B cp = newInstance(this); return SwiftParseUtils.getLines(getLine(cp, null, null, offset)); @@ -313,6 +314,7 @@ public List getLines(int offset) { * @return found lines or empty list if value is empty * @since 7.7 */ + @Override public List getLinesBetween(int start, int end) { return getLinesBetween(start, end, 0); } @@ -327,6 +329,7 @@ public List getLinesBetween(int start, int end) { * @return found lines or empty list if lines are not present or the offset is invalid * @since 7.7 */ + @Override public List getLinesBetween(int start, int end, int offset) { Field45B cp = newInstance(this); return SwiftParseUtils.getLines(getLine(cp, start, end, offset)); diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field45C.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field45C.java index bcf66d719..bed051561 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field45C.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field45C.java @@ -30,12 +30,9 @@ import com.prowidesoftware.swift.model.field.MultiLineField; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -184,19 +181,16 @@ public String getValue() { */ @Override public String getValueDisplay(int component, Locale locale) { - if (component < 1 || component > 1) { + if (component != 1) { throw new IllegalArgumentException("invalid component number " + component + " for field 45C"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -399,7 +393,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field45C(f)); } @@ -415,6 +409,7 @@ public static List getAll(final SwiftTagListBlock block) { * @return line content or null if not present or if line number is above the expected * @since 7.7 */ + @Override public String getLine(int line) { return getLine(line, 0); } @@ -428,6 +423,7 @@ public String getLine(int line) { * @return line content or null if not present or if line number is above the expected * @since 7.7 */ + @Override public String getLine(int line, int offset) { Field45C cp = newInstance(this); return getLine(cp, line, null, offset); @@ -440,6 +436,7 @@ public String getLine(int line, int offset) { * @return lines content or empty list if field's value is empty * @since 7.7 */ + @Override public List getLines() { return SwiftParseUtils.getLines(getValue()); } @@ -452,6 +449,7 @@ public List getLines() { * @return found lines or empty list if lines are not present or the offset is invalid * @since 7.7 */ + @Override public List getLines(int offset) { Field45C cp = newInstance(this); return SwiftParseUtils.getLines(getLine(cp, null, null, offset)); @@ -466,6 +464,7 @@ public List getLines(int offset) { * @return found lines or empty list if value is empty * @since 7.7 */ + @Override public List getLinesBetween(int start, int end) { return getLinesBetween(start, end, 0); } @@ -480,6 +479,7 @@ public List getLinesBetween(int start, int end) { * @return found lines or empty list if lines are not present or the offset is invalid * @since 7.7 */ + @Override public List getLinesBetween(int start, int end, int offset) { Field45C cp = newInstance(this); return SwiftParseUtils.getLines(getLine(cp, start, end, offset)); diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field45D.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field45D.java index 8ab6430d1..ea4296e12 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field45D.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field45D.java @@ -30,12 +30,9 @@ import com.prowidesoftware.swift.model.field.MultiLineField; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -184,19 +181,16 @@ public String getValue() { */ @Override public String getValueDisplay(int component, Locale locale) { - if (component < 1 || component > 1) { + if (component != 1) { throw new IllegalArgumentException("invalid component number " + component + " for field 45D"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -399,7 +393,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field45D(f)); } @@ -415,6 +409,7 @@ public static List getAll(final SwiftTagListBlock block) { * @return line content or null if not present or if line number is above the expected * @since 7.7 */ + @Override public String getLine(int line) { return getLine(line, 0); } @@ -428,6 +423,7 @@ public String getLine(int line) { * @return line content or null if not present or if line number is above the expected * @since 7.7 */ + @Override public String getLine(int line, int offset) { Field45D cp = newInstance(this); return getLine(cp, line, null, offset); @@ -440,6 +436,7 @@ public String getLine(int line, int offset) { * @return lines content or empty list if field's value is empty * @since 7.7 */ + @Override public List getLines() { return SwiftParseUtils.getLines(getValue()); } @@ -452,6 +449,7 @@ public List getLines() { * @return found lines or empty list if lines are not present or the offset is invalid * @since 7.7 */ + @Override public List getLines(int offset) { Field45D cp = newInstance(this); return SwiftParseUtils.getLines(getLine(cp, null, null, offset)); @@ -466,6 +464,7 @@ public List getLines(int offset) { * @return found lines or empty list if value is empty * @since 7.7 */ + @Override public List getLinesBetween(int start, int end) { return getLinesBetween(start, end, 0); } @@ -480,6 +479,7 @@ public List getLinesBetween(int start, int end) { * @return found lines or empty list if lines are not present or the offset is invalid * @since 7.7 */ + @Override public List getLinesBetween(int start, int end, int offset) { Field45D cp = newInstance(this); return SwiftParseUtils.getLines(getLine(cp, start, end, offset)); diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field45L.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field45L.java index d566ec2eb..96b263bcf 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field45L.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field45L.java @@ -30,12 +30,9 @@ import com.prowidesoftware.swift.model.field.MultiLineField; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -184,19 +181,16 @@ public String getValue() { */ @Override public String getValueDisplay(int component, Locale locale) { - if (component < 1 || component > 1) { + if (component != 1) { throw new IllegalArgumentException("invalid component number " + component + " for field 45L"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -399,7 +393,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field45L(f)); } @@ -415,6 +409,7 @@ public static List getAll(final SwiftTagListBlock block) { * @return line content or null if not present or if line number is above the expected * @since 7.7 */ + @Override public String getLine(int line) { return getLine(line, 0); } @@ -428,6 +423,7 @@ public String getLine(int line) { * @return line content or null if not present or if line number is above the expected * @since 7.7 */ + @Override public String getLine(int line, int offset) { Field45L cp = newInstance(this); return getLine(cp, line, null, offset); @@ -440,6 +436,7 @@ public String getLine(int line, int offset) { * @return lines content or empty list if field's value is empty * @since 7.7 */ + @Override public List getLines() { return SwiftParseUtils.getLines(getValue()); } @@ -452,6 +449,7 @@ public List getLines() { * @return found lines or empty list if lines are not present or the offset is invalid * @since 7.7 */ + @Override public List getLines(int offset) { Field45L cp = newInstance(this); return SwiftParseUtils.getLines(getLine(cp, null, null, offset)); @@ -466,6 +464,7 @@ public List getLines(int offset) { * @return found lines or empty list if value is empty * @since 7.7 */ + @Override public List getLinesBetween(int start, int end) { return getLinesBetween(start, end, 0); } @@ -480,6 +479,7 @@ public List getLinesBetween(int start, int end) { * @return found lines or empty list if lines are not present or the offset is invalid * @since 7.7 */ + @Override public List getLinesBetween(int start, int end, int offset) { Field45L cp = newInstance(this); return SwiftParseUtils.getLines(getLine(cp, start, end, offset)); diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field461.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field461.java index 95d60085d..1cc83a2be 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field461.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field461.java @@ -29,12 +29,9 @@ -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -183,19 +180,16 @@ public String getValue() { */ @Override public String getValueDisplay(int component, Locale locale) { - if (component < 1 || component > 1) { + if (component != 1) { throw new IllegalArgumentException("invalid component number " + component + " for field 461"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -398,7 +392,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field461(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field46A.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field46A.java index 8e76a7166..985a84205 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field46A.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field46A.java @@ -30,12 +30,9 @@ import com.prowidesoftware.swift.model.field.MultiLineField; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -184,19 +181,16 @@ public String getValue() { */ @Override public String getValueDisplay(int component, Locale locale) { - if (component < 1 || component > 1) { + if (component != 1) { throw new IllegalArgumentException("invalid component number " + component + " for field 46A"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -399,7 +393,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field46A(f)); } @@ -415,6 +409,7 @@ public static List getAll(final SwiftTagListBlock block) { * @return line content or null if not present or if line number is above the expected * @since 7.7 */ + @Override public String getLine(int line) { return getLine(line, 0); } @@ -428,6 +423,7 @@ public String getLine(int line) { * @return line content or null if not present or if line number is above the expected * @since 7.7 */ + @Override public String getLine(int line, int offset) { Field46A cp = newInstance(this); return getLine(cp, line, null, offset); @@ -440,6 +436,7 @@ public String getLine(int line, int offset) { * @return lines content or empty list if field's value is empty * @since 7.7 */ + @Override public List getLines() { return SwiftParseUtils.getLines(getValue()); } @@ -452,6 +449,7 @@ public List getLines() { * @return found lines or empty list if lines are not present or the offset is invalid * @since 7.7 */ + @Override public List getLines(int offset) { Field46A cp = newInstance(this); return SwiftParseUtils.getLines(getLine(cp, null, null, offset)); @@ -466,6 +464,7 @@ public List getLines(int offset) { * @return found lines or empty list if value is empty * @since 7.7 */ + @Override public List getLinesBetween(int start, int end) { return getLinesBetween(start, end, 0); } @@ -480,6 +479,7 @@ public List getLinesBetween(int start, int end) { * @return found lines or empty list if lines are not present or the offset is invalid * @since 7.7 */ + @Override public List getLinesBetween(int start, int end, int offset) { Field46A cp = newInstance(this); return SwiftParseUtils.getLines(getLine(cp, start, end, offset)); diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field46B.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field46B.java index 2699c9668..6696f24d0 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field46B.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field46B.java @@ -30,12 +30,9 @@ import com.prowidesoftware.swift.model.field.MultiLineField; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -246,7 +243,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field46B(f)); } @@ -262,6 +259,7 @@ public static List getAll(final SwiftTagListBlock block) { * @return line content or null if not present or if line number is above the expected * @since 7.7 */ + @Override public String getLine(int line) { return getLine(line, 0); } @@ -275,6 +273,7 @@ public String getLine(int line) { * @return line content or null if not present or if line number is above the expected * @since 7.7 */ + @Override public String getLine(int line, int offset) { Field46B cp = newInstance(this); return getLine(cp, line, null, offset); @@ -287,6 +286,7 @@ public String getLine(int line, int offset) { * @return lines content or empty list if field's value is empty * @since 7.7 */ + @Override public List getLines() { return SwiftParseUtils.getLines(getValue()); } @@ -299,6 +299,7 @@ public List getLines() { * @return found lines or empty list if lines are not present or the offset is invalid * @since 7.7 */ + @Override public List getLines(int offset) { Field46B cp = newInstance(this); return SwiftParseUtils.getLines(getLine(cp, null, null, offset)); @@ -313,6 +314,7 @@ public List getLines(int offset) { * @return found lines or empty list if value is empty * @since 7.7 */ + @Override public List getLinesBetween(int start, int end) { return getLinesBetween(start, end, 0); } @@ -327,6 +329,7 @@ public List getLinesBetween(int start, int end) { * @return found lines or empty list if lines are not present or the offset is invalid * @since 7.7 */ + @Override public List getLinesBetween(int start, int end, int offset) { Field46B cp = newInstance(this); return SwiftParseUtils.getLines(getLine(cp, start, end, offset)); diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field47A.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field47A.java index da487218e..2742cb014 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field47A.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field47A.java @@ -30,12 +30,9 @@ import com.prowidesoftware.swift.model.field.MultiLineField; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -184,19 +181,16 @@ public String getValue() { */ @Override public String getValueDisplay(int component, Locale locale) { - if (component < 1 || component > 1) { + if (component != 1) { throw new IllegalArgumentException("invalid component number " + component + " for field 47A"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -399,7 +393,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field47A(f)); } @@ -415,6 +409,7 @@ public static List getAll(final SwiftTagListBlock block) { * @return line content or null if not present or if line number is above the expected * @since 7.7 */ + @Override public String getLine(int line) { return getLine(line, 0); } @@ -428,6 +423,7 @@ public String getLine(int line) { * @return line content or null if not present or if line number is above the expected * @since 7.7 */ + @Override public String getLine(int line, int offset) { Field47A cp = newInstance(this); return getLine(cp, line, null, offset); @@ -440,6 +436,7 @@ public String getLine(int line, int offset) { * @return lines content or empty list if field's value is empty * @since 7.7 */ + @Override public List getLines() { return SwiftParseUtils.getLines(getValue()); } @@ -452,6 +449,7 @@ public List getLines() { * @return found lines or empty list if lines are not present or the offset is invalid * @since 7.7 */ + @Override public List getLines(int offset) { Field47A cp = newInstance(this); return SwiftParseUtils.getLines(getLine(cp, null, null, offset)); @@ -466,6 +464,7 @@ public List getLines(int offset) { * @return found lines or empty list if value is empty * @since 7.7 */ + @Override public List getLinesBetween(int start, int end) { return getLinesBetween(start, end, 0); } @@ -480,6 +479,7 @@ public List getLinesBetween(int start, int end) { * @return found lines or empty list if lines are not present or the offset is invalid * @since 7.7 */ + @Override public List getLinesBetween(int start, int end, int offset) { Field47A cp = newInstance(this); return SwiftParseUtils.getLines(getLine(cp, start, end, offset)); diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field47B.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field47B.java index 5258478f1..fcf285d0a 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field47B.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field47B.java @@ -30,12 +30,9 @@ import com.prowidesoftware.swift.model.field.MultiLineField; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -246,7 +243,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field47B(f)); } @@ -262,6 +259,7 @@ public static List getAll(final SwiftTagListBlock block) { * @return line content or null if not present or if line number is above the expected * @since 7.7 */ + @Override public String getLine(int line) { return getLine(line, 0); } @@ -275,6 +273,7 @@ public String getLine(int line) { * @return line content or null if not present or if line number is above the expected * @since 7.7 */ + @Override public String getLine(int line, int offset) { Field47B cp = newInstance(this); return getLine(cp, line, null, offset); @@ -287,6 +286,7 @@ public String getLine(int line, int offset) { * @return lines content or empty list if field's value is empty * @since 7.7 */ + @Override public List getLines() { return SwiftParseUtils.getLines(getValue()); } @@ -299,6 +299,7 @@ public List getLines() { * @return found lines or empty list if lines are not present or the offset is invalid * @since 7.7 */ + @Override public List getLines(int offset) { Field47B cp = newInstance(this); return SwiftParseUtils.getLines(getLine(cp, null, null, offset)); @@ -313,6 +314,7 @@ public List getLines(int offset) { * @return found lines or empty list if value is empty * @since 7.7 */ + @Override public List getLinesBetween(int start, int end) { return getLinesBetween(start, end, 0); } @@ -327,6 +329,7 @@ public List getLinesBetween(int start, int end) { * @return found lines or empty list if lines are not present or the offset is invalid * @since 7.7 */ + @Override public List getLinesBetween(int start, int end, int offset) { Field47B cp = newInstance(this); return SwiftParseUtils.getLines(getLine(cp, start, end, offset)); diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field48.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field48.java index acd45dbac..0371f0a97 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field48.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field48.java @@ -31,12 +31,9 @@ import java.math.BigInteger; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -202,16 +199,14 @@ public String getValueDisplay(int component, Locale locale) { //default format (as is) return getComponent(1); } - if (component == 2) { - //default format (as is) - return getComponent(2); - } - return null; + // This is the last component, return directly without `if` + //default format (as is) + return getComponent(2); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -380,32 +375,14 @@ public Field48 setComponent1(String component1) { return this; } - /** - * Set the component1 from a Long object. - *
- * If the component being set is a fixed length number, the argument will not be - * padded. It is recommended for these cases to use the setComponent1(String) - * method. - * - * @see #setComponent1(String) - * @since 9.2.7 - * - * @param component1 the Long with the Days content to set - * @return the field object to enable build pattern - */ - public Field48 setComponent1(java.lang.Long component1) { - setComponent(1, SwiftFormatUtils.getLong(component1)); - return this; - } /** * Alternative method setter for field's Days (component 1) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10 becomes an Integer) * * @param component1 the Number with the Days content to set * @return the field object to enable build pattern - * @see #setDays(java.lang.Long) */ public Field48 setComponent1(java.lang.Number component1) { @@ -435,27 +412,13 @@ public Field48 setDays(String component1) { return setComponent1(component1); } - /** - * Set the Days (component 1) from a Long object. - * - * @see #setComponent1(java.lang.Long) - * - * @param component1 Long with the Days content to set - * @return the field object to enable build pattern - * @since 9.2.7 - */ - public Field48 setDays(java.lang.Long component1) { - return setComponent1(component1); - } - /** * Alternative method setter for field's Days (component 1) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10 becomes an Integer) * * @param component1 the Number with the Days content to set * @return the field object to enable build pattern - * @see #setDays(java.lang.Long) */ public Field48 setDays(java.lang.Number component1) { return setComponent1(component1); @@ -547,7 +510,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field48(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field48B.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field48B.java index fd2b7be87..29acce99f 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field48B.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field48B.java @@ -29,12 +29,9 @@ -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -183,19 +180,16 @@ public String getValue() { */ @Override public String getValueDisplay(int component, Locale locale) { - if (component < 1 || component > 1) { + if (component != 1) { throw new IllegalArgumentException("invalid component number " + component + " for field 48B"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -398,7 +392,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field48B(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field48D.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field48D.java index 15ba589b0..28b2ef09b 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field48D.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field48D.java @@ -29,12 +29,9 @@ -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -183,19 +180,16 @@ public String getValue() { */ @Override public String getValueDisplay(int component, Locale locale) { - if (component < 1 || component > 1) { + if (component != 1) { throw new IllegalArgumentException("invalid component number " + component + " for field 48D"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -398,7 +392,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field48D(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field49.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field49.java index 57810d0a4..ec3e160d5 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field49.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field49.java @@ -29,12 +29,9 @@ -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -183,19 +180,16 @@ public String getValue() { */ @Override public String getValueDisplay(int component, Locale locale) { - if (component < 1 || component > 1) { + if (component != 1) { throw new IllegalArgumentException("invalid component number " + component + " for field 49"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -398,7 +392,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field49(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field49A.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field49A.java index 592a0670a..a29a85aa1 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field49A.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field49A.java @@ -30,12 +30,9 @@ import com.prowidesoftware.swift.model.field.MultiLineField; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -208,16 +205,14 @@ public String getValueDisplay(int component, Locale locale) { //default format (as is) return getComponent(1); } - if (component == 2) { - //default format (as is) - return getComponent(2); - } - return null; + // This is the last component, return directly without `if` + //default format (as is) + return getComponent(2); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -466,7 +461,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field49A(f)); } @@ -482,6 +477,7 @@ public static List getAll(final SwiftTagListBlock block) { * @return line content or null if not present or if line number is above the expected * @since 7.7 */ + @Override public String getLine(int line) { return getLine(line, 0); } @@ -495,6 +491,7 @@ public String getLine(int line) { * @return line content or null if not present or if line number is above the expected * @since 7.7 */ + @Override public String getLine(int line, int offset) { Field49A cp = newInstance(this); return getLine(cp, line, null, offset); @@ -507,6 +504,7 @@ public String getLine(int line, int offset) { * @return lines content or empty list if field's value is empty * @since 7.7 */ + @Override public List getLines() { return SwiftParseUtils.getLines(getValue()); } @@ -519,6 +517,7 @@ public List getLines() { * @return found lines or empty list if lines are not present or the offset is invalid * @since 7.7 */ + @Override public List getLines(int offset) { Field49A cp = newInstance(this); return SwiftParseUtils.getLines(getLine(cp, null, null, offset)); @@ -533,6 +532,7 @@ public List getLines(int offset) { * @return found lines or empty list if value is empty * @since 7.7 */ + @Override public List getLinesBetween(int start, int end) { return getLinesBetween(start, end, 0); } @@ -547,6 +547,7 @@ public List getLinesBetween(int start, int end) { * @return found lines or empty list if lines are not present or the offset is invalid * @since 7.7 */ + @Override public List getLinesBetween(int start, int end, int offset) { Field49A cp = newInstance(this); return SwiftParseUtils.getLines(getLine(cp, start, end, offset)); diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field49G.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field49G.java index cb70cf023..4ce429eea 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field49G.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field49G.java @@ -30,12 +30,9 @@ import com.prowidesoftware.swift.model.field.MultiLineField; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -184,19 +181,16 @@ public String getValue() { */ @Override public String getValueDisplay(int component, Locale locale) { - if (component < 1 || component > 1) { + if (component != 1) { throw new IllegalArgumentException("invalid component number " + component + " for field 49G"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -399,7 +393,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field49G(f)); } @@ -415,6 +409,7 @@ public static List getAll(final SwiftTagListBlock block) { * @return line content or null if not present or if line number is above the expected * @since 7.7 */ + @Override public String getLine(int line) { return getLine(line, 0); } @@ -428,6 +423,7 @@ public String getLine(int line) { * @return line content or null if not present or if line number is above the expected * @since 7.7 */ + @Override public String getLine(int line, int offset) { Field49G cp = newInstance(this); return getLine(cp, line, null, offset); @@ -440,6 +436,7 @@ public String getLine(int line, int offset) { * @return lines content or empty list if field's value is empty * @since 7.7 */ + @Override public List getLines() { return SwiftParseUtils.getLines(getValue()); } @@ -452,6 +449,7 @@ public List getLines() { * @return found lines or empty list if lines are not present or the offset is invalid * @since 7.7 */ + @Override public List getLines(int offset) { Field49G cp = newInstance(this); return SwiftParseUtils.getLines(getLine(cp, null, null, offset)); @@ -466,6 +464,7 @@ public List getLines(int offset) { * @return found lines or empty list if value is empty * @since 7.7 */ + @Override public List getLinesBetween(int start, int end) { return getLinesBetween(start, end, 0); } @@ -480,6 +479,7 @@ public List getLinesBetween(int start, int end) { * @return found lines or empty list if lines are not present or the offset is invalid * @since 7.7 */ + @Override public List getLinesBetween(int start, int end, int offset) { Field49G cp = newInstance(this); return SwiftParseUtils.getLines(getLine(cp, start, end, offset)); diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field49H.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field49H.java index 410de0de3..5ae7fae22 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field49H.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field49H.java @@ -30,12 +30,9 @@ import com.prowidesoftware.swift.model.field.MultiLineField; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -184,19 +181,16 @@ public String getValue() { */ @Override public String getValueDisplay(int component, Locale locale) { - if (component < 1 || component > 1) { + if (component != 1) { throw new IllegalArgumentException("invalid component number " + component + " for field 49H"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -399,7 +393,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field49H(f)); } @@ -415,6 +409,7 @@ public static List getAll(final SwiftTagListBlock block) { * @return line content or null if not present or if line number is above the expected * @since 7.7 */ + @Override public String getLine(int line) { return getLine(line, 0); } @@ -428,6 +423,7 @@ public String getLine(int line) { * @return line content or null if not present or if line number is above the expected * @since 7.7 */ + @Override public String getLine(int line, int offset) { Field49H cp = newInstance(this); return getLine(cp, line, null, offset); @@ -440,6 +436,7 @@ public String getLine(int line, int offset) { * @return lines content or empty list if field's value is empty * @since 7.7 */ + @Override public List getLines() { return SwiftParseUtils.getLines(getValue()); } @@ -452,6 +449,7 @@ public List getLines() { * @return found lines or empty list if lines are not present or the offset is invalid * @since 7.7 */ + @Override public List getLines(int offset) { Field49H cp = newInstance(this); return SwiftParseUtils.getLines(getLine(cp, null, null, offset)); @@ -466,6 +464,7 @@ public List getLines(int offset) { * @return found lines or empty list if value is empty * @since 7.7 */ + @Override public List getLinesBetween(int start, int end) { return getLinesBetween(start, end, 0); } @@ -480,6 +479,7 @@ public List getLinesBetween(int start, int end) { * @return found lines or empty list if lines are not present or the offset is invalid * @since 7.7 */ + @Override public List getLinesBetween(int start, int end, int offset) { Field49H cp = newInstance(this); return SwiftParseUtils.getLines(getLine(cp, start, end, offset)); diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field49M.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field49M.java index 052459edf..4fa6917e7 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field49M.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field49M.java @@ -30,12 +30,9 @@ import com.prowidesoftware.swift.model.field.MultiLineField; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -246,7 +243,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field49M(f)); } @@ -262,6 +259,7 @@ public static List getAll(final SwiftTagListBlock block) { * @return line content or null if not present or if line number is above the expected * @since 7.7 */ + @Override public String getLine(int line) { return getLine(line, 0); } @@ -275,6 +273,7 @@ public String getLine(int line) { * @return line content or null if not present or if line number is above the expected * @since 7.7 */ + @Override public String getLine(int line, int offset) { Field49M cp = newInstance(this); return getLine(cp, line, null, offset); @@ -287,6 +286,7 @@ public String getLine(int line, int offset) { * @return lines content or empty list if field's value is empty * @since 7.7 */ + @Override public List getLines() { return SwiftParseUtils.getLines(getValue()); } @@ -299,6 +299,7 @@ public List getLines() { * @return found lines or empty list if lines are not present or the offset is invalid * @since 7.7 */ + @Override public List getLines(int offset) { Field49M cp = newInstance(this); return SwiftParseUtils.getLines(getLine(cp, null, null, offset)); @@ -313,6 +314,7 @@ public List getLines(int offset) { * @return found lines or empty list if value is empty * @since 7.7 */ + @Override public List getLinesBetween(int start, int end) { return getLinesBetween(start, end, 0); } @@ -327,6 +329,7 @@ public List getLinesBetween(int start, int end) { * @return found lines or empty list if lines are not present or the offset is invalid * @since 7.7 */ + @Override public List getLinesBetween(int start, int end, int offset) { Field49M cp = newInstance(this); return SwiftParseUtils.getLines(getLine(cp, start, end, offset)); diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field49N.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field49N.java index d746d96da..5c137f060 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field49N.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field49N.java @@ -30,12 +30,9 @@ import com.prowidesoftware.swift.model.field.MultiLineField; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -246,7 +243,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field49N(f)); } @@ -262,6 +259,7 @@ public static List getAll(final SwiftTagListBlock block) { * @return line content or null if not present or if line number is above the expected * @since 7.7 */ + @Override public String getLine(int line) { return getLine(line, 0); } @@ -275,6 +273,7 @@ public String getLine(int line) { * @return line content or null if not present or if line number is above the expected * @since 7.7 */ + @Override public String getLine(int line, int offset) { Field49N cp = newInstance(this); return getLine(cp, line, null, offset); @@ -287,6 +286,7 @@ public String getLine(int line, int offset) { * @return lines content or empty list if field's value is empty * @since 7.7 */ + @Override public List getLines() { return SwiftParseUtils.getLines(getValue()); } @@ -299,6 +299,7 @@ public List getLines() { * @return found lines or empty list if lines are not present or the offset is invalid * @since 7.7 */ + @Override public List getLines(int offset) { Field49N cp = newInstance(this); return SwiftParseUtils.getLines(getLine(cp, null, null, offset)); @@ -313,6 +314,7 @@ public List getLines(int offset) { * @return found lines or empty list if value is empty * @since 7.7 */ + @Override public List getLinesBetween(int start, int end) { return getLinesBetween(start, end, 0); } @@ -327,6 +329,7 @@ public List getLinesBetween(int start, int end) { * @return found lines or empty list if lines are not present or the offset is invalid * @since 7.7 */ + @Override public List getLinesBetween(int start, int end, int offset) { Field49N cp = newInstance(this); return SwiftParseUtils.getLines(getLine(cp, start, end, offset)); diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field50.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field50.java index 31b4dcbf8..407d8742a 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field50.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field50.java @@ -30,12 +30,9 @@ import com.prowidesoftware.swift.model.field.MultiLineField; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -203,16 +200,14 @@ public String getValueDisplay(int component, Locale locale) { //default format (as is) return getComponent(3); } - if (component == 4) { - //default format (as is) - return getComponent(4); - } - return null; + // This is the last component, return directly without `if` + //default format (as is) + return getComponent(4); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -584,7 +579,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field50(f)); } @@ -600,6 +595,7 @@ public static List getAll(final SwiftTagListBlock block) { * @return line content or null if not present or if line number is above the expected * @since 7.7 */ + @Override public String getLine(int line) { return getLine(line, 0); } @@ -613,6 +609,7 @@ public String getLine(int line) { * @return line content or null if not present or if line number is above the expected * @since 7.7 */ + @Override public String getLine(int line, int offset) { Field50 cp = newInstance(this); return getLine(cp, line, null, offset); @@ -625,6 +622,7 @@ public String getLine(int line, int offset) { * @return lines content or empty list if field's value is empty * @since 7.7 */ + @Override public List getLines() { return SwiftParseUtils.getLines(getValue()); } @@ -637,6 +635,7 @@ public List getLines() { * @return found lines or empty list if lines are not present or the offset is invalid * @since 7.7 */ + @Override public List getLines(int offset) { Field50 cp = newInstance(this); return SwiftParseUtils.getLines(getLine(cp, null, null, offset)); @@ -651,6 +650,7 @@ public List getLines(int offset) { * @return found lines or empty list if value is empty * @since 7.7 */ + @Override public List getLinesBetween(int start, int end) { return getLinesBetween(start, end, 0); } @@ -665,6 +665,7 @@ public List getLinesBetween(int start, int end) { * @return found lines or empty list if lines are not present or the offset is invalid * @since 7.7 */ + @Override public List getLinesBetween(int start, int end, int offset) { Field50 cp = newInstance(this); return SwiftParseUtils.getLines(getLine(cp, start, end, offset)); diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field503.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field503.java index 2eb798a7d..98130f6e0 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field503.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field503.java @@ -29,12 +29,9 @@ -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -183,19 +180,16 @@ public String getValue() { */ @Override public String getValueDisplay(int component, Locale locale) { - if (component < 1 || component > 1) { + if (component != 1) { throw new IllegalArgumentException("invalid component number " + component + " for field 503"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -398,7 +392,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field503(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field50A.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field50A.java index 23d901c07..76dda23c8 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field50A.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field50A.java @@ -33,12 +33,9 @@ import com.prowidesoftware.swift.model.field.BICContainer; import com.prowidesoftware.swift.model.field.BICResolver; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -212,16 +209,14 @@ public String getValueDisplay(int component, Locale locale) { //default format (as is) return getComponent(1); } - if (component == 2) { - //default format (as is) - return getComponent(2); - } - return null; + // This is the last component, return directly without `if` + //default format (as is) + return getComponent(2); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -455,10 +450,12 @@ public Field50A setIdentifierCode(com.prowidesoftware.swift.model.BIC component2 } + @Override public List bics() { return BICResolver.bics(this); } + @Override public List bicStrings () { return BICResolver.bicStrings(this); } @@ -527,7 +524,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field50A(f)); } @@ -543,6 +540,7 @@ public static List getAll(final SwiftTagListBlock block) { * @return line content or null if not present or if line number is above the expected * @since 7.7 */ + @Override public String getLine(int line) { return getLine(line, 0); } @@ -556,6 +554,7 @@ public String getLine(int line) { * @return line content or null if not present or if line number is above the expected * @since 7.7 */ + @Override public String getLine(int line, int offset) { Field50A cp = newInstance(this); return getLine(cp, line, null, offset); @@ -568,6 +567,7 @@ public String getLine(int line, int offset) { * @return lines content or empty list if field's value is empty * @since 7.7 */ + @Override public List getLines() { return SwiftParseUtils.getLines(getValue()); } @@ -580,6 +580,7 @@ public List getLines() { * @return found lines or empty list if lines are not present or the offset is invalid * @since 7.7 */ + @Override public List getLines(int offset) { Field50A cp = newInstance(this); return SwiftParseUtils.getLines(getLine(cp, null, null, offset)); @@ -594,6 +595,7 @@ public List getLines(int offset) { * @return found lines or empty list if value is empty * @since 7.7 */ + @Override public List getLinesBetween(int start, int end) { return getLinesBetween(start, end, 0); } @@ -608,6 +610,7 @@ public List getLinesBetween(int start, int end) { * @return found lines or empty list if lines are not present or the offset is invalid * @since 7.7 */ + @Override public List getLinesBetween(int start, int end, int offset) { Field50A cp = newInstance(this); return SwiftParseUtils.getLines(getLine(cp, start, end, offset)); diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field50B.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field50B.java index faf73e79a..1bf958a36 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field50B.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field50B.java @@ -30,12 +30,9 @@ import com.prowidesoftware.swift.model.field.MultiLineField; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -203,16 +200,14 @@ public String getValueDisplay(int component, Locale locale) { //default format (as is) return getComponent(3); } - if (component == 4) { - //default format (as is) - return getComponent(4); - } - return null; + // This is the last component, return directly without `if` + //default format (as is) + return getComponent(4); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -584,7 +579,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field50B(f)); } @@ -600,6 +595,7 @@ public static List getAll(final SwiftTagListBlock block) { * @return line content or null if not present or if line number is above the expected * @since 7.7 */ + @Override public String getLine(int line) { return getLine(line, 0); } @@ -613,6 +609,7 @@ public String getLine(int line) { * @return line content or null if not present or if line number is above the expected * @since 7.7 */ + @Override public String getLine(int line, int offset) { Field50B cp = newInstance(this); return getLine(cp, line, null, offset); @@ -625,6 +622,7 @@ public String getLine(int line, int offset) { * @return lines content or empty list if field's value is empty * @since 7.7 */ + @Override public List getLines() { return SwiftParseUtils.getLines(getValue()); } @@ -637,6 +635,7 @@ public List getLines() { * @return found lines or empty list if lines are not present or the offset is invalid * @since 7.7 */ + @Override public List getLines(int offset) { Field50B cp = newInstance(this); return SwiftParseUtils.getLines(getLine(cp, null, null, offset)); @@ -651,6 +650,7 @@ public List getLines(int offset) { * @return found lines or empty list if value is empty * @since 7.7 */ + @Override public List getLinesBetween(int start, int end) { return getLinesBetween(start, end, 0); } @@ -665,6 +665,7 @@ public List getLinesBetween(int start, int end) { * @return found lines or empty list if lines are not present or the offset is invalid * @since 7.7 */ + @Override public List getLinesBetween(int start, int end, int offset) { Field50B cp = newInstance(this); return SwiftParseUtils.getLines(getLine(cp, start, end, offset)); diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field50C.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field50C.java index 2a92edac8..bfe3c7186 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field50C.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field50C.java @@ -32,12 +32,9 @@ import com.prowidesoftware.swift.model.field.BICContainer; import com.prowidesoftware.swift.model.field.BICResolver; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -187,19 +184,16 @@ public String getValue() { */ @Override public String getValueDisplay(int component, Locale locale) { - if (component < 1 || component > 1) { + if (component != 1) { throw new IllegalArgumentException("invalid component number " + component + " for field 50C"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -381,10 +375,12 @@ public Field50C setIdentifierCode(com.prowidesoftware.swift.model.BIC component1 } + @Override public List bics() { return BICResolver.bics(this); } + @Override public List bicStrings () { return BICResolver.bicStrings(this); } @@ -453,7 +449,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field50C(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field50D.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field50D.java index e1185d45a..33c59ed51 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field50D.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field50D.java @@ -30,12 +30,9 @@ import com.prowidesoftware.swift.model.field.MultiLineField; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -358,7 +355,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field50D(f)); } @@ -374,6 +371,7 @@ public static List getAll(final SwiftTagListBlock block) { * @return line content or null if not present or if line number is above the expected * @since 7.7 */ + @Override public String getLine(int line) { return getLine(line, 0); } @@ -387,6 +385,7 @@ public String getLine(int line) { * @return line content or null if not present or if line number is above the expected * @since 7.7 */ + @Override public String getLine(int line, int offset) { Field50D cp = newInstance(this); return getLine(cp, line, null, offset); @@ -399,6 +398,7 @@ public String getLine(int line, int offset) { * @return lines content or empty list if field's value is empty * @since 7.7 */ + @Override public List getLines() { return SwiftParseUtils.getLines(getValue()); } @@ -411,6 +411,7 @@ public List getLines() { * @return found lines or empty list if lines are not present or the offset is invalid * @since 7.7 */ + @Override public List getLines(int offset) { Field50D cp = newInstance(this); return SwiftParseUtils.getLines(getLine(cp, null, null, offset)); @@ -425,6 +426,7 @@ public List getLines(int offset) { * @return found lines or empty list if value is empty * @since 7.7 */ + @Override public List getLinesBetween(int start, int end) { return getLinesBetween(start, end, 0); } @@ -439,6 +441,7 @@ public List getLinesBetween(int start, int end) { * @return found lines or empty list if lines are not present or the offset is invalid * @since 7.7 */ + @Override public List getLinesBetween(int start, int end, int offset) { Field50D cp = newInstance(this); return SwiftParseUtils.getLines(getLine(cp, start, end, offset)); diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field50F.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field50F.java index bfefa2c8f..3bf7f8cc6 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field50F.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field50F.java @@ -32,12 +32,9 @@ import com.prowidesoftware.swift.model.field.MultiLineField; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -284,9 +281,8 @@ public String getValueDisplay(int component, Locale locale) { //special case for party identifier in field 50F if (StringUtils.startsWith(getComponent(1), "/")) { return getComponent(1).substring(1); - } else { - return getComponent(1); } + return getComponent(1); } if (component == 2) { //default format (as is) @@ -316,16 +312,14 @@ public String getValueDisplay(int component, Locale locale) { //default format (as is) return getComponent(8); } - if (component == 9) { - //default format (as is) - return getComponent(9); - } - return null; + // This is the last component, return directly without `if` + //default format (as is) + return getComponent(9); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -720,32 +714,14 @@ public Field50F setComponent2(String component2) { return this; } - /** - * Set the component2 from a Long object. - *
- * If the component being set is a fixed length number, the argument will not be - * padded. It is recommended for these cases to use the setComponent2(String) - * method. - * - * @see #setComponent2(String) - * @since 9.2.7 - * - * @param component2 the Long with the Number 1 content to set - * @return the field object to enable build pattern - */ - public Field50F setComponent2(java.lang.Long component2) { - setComponent(2, SwiftFormatUtils.getLong(component2)); - return this; - } /** * Alternative method setter for field's Number 1 (component 2) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10 becomes an Integer) * * @param component2 the Number with the Number 1 content to set * @return the field object to enable build pattern - * @see #setNumber1(java.lang.Long) */ public Field50F setComponent2(java.lang.Number component2) { @@ -775,27 +751,13 @@ public Field50F setNumber1(String component2) { return setComponent2(component2); } - /** - * Set the Number 1 (component 2) from a Long object. - * - * @see #setComponent2(java.lang.Long) - * - * @param component2 Long with the Number 1 content to set - * @return the field object to enable build pattern - * @since 9.2.7 - */ - public Field50F setNumber1(java.lang.Long component2) { - return setComponent2(component2); - } - /** * Alternative method setter for field's Number 1 (component 2) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10 becomes an Integer) * * @param component2 the Number with the Number 1 content to set * @return the field object to enable build pattern - * @see #setNumber1(java.lang.Long) */ public Field50F setNumber1(java.lang.Number component2) { return setComponent2(component2); @@ -833,32 +795,14 @@ public Field50F setComponent4(String component4) { return this; } - /** - * Set the component4 from a Long object. - *
- * If the component being set is a fixed length number, the argument will not be - * padded. It is recommended for these cases to use the setComponent4(String) - * method. - * - * @see #setComponent4(String) - * @since 9.2.7 - * - * @param component4 the Long with the Number 2 content to set - * @return the field object to enable build pattern - */ - public Field50F setComponent4(java.lang.Long component4) { - setComponent(4, SwiftFormatUtils.getLong(component4)); - return this; - } /** * Alternative method setter for field's Number 2 (component 4) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10 becomes an Integer) * * @param component4 the Number with the Number 2 content to set * @return the field object to enable build pattern - * @see #setNumber2(java.lang.Long) */ public Field50F setComponent4(java.lang.Number component4) { @@ -888,27 +832,13 @@ public Field50F setNumber2(String component4) { return setComponent4(component4); } - /** - * Set the Number 2 (component 4) from a Long object. - * - * @see #setComponent4(java.lang.Long) - * - * @param component4 Long with the Number 2 content to set - * @return the field object to enable build pattern - * @since 9.2.7 - */ - public Field50F setNumber2(java.lang.Long component4) { - return setComponent4(component4); - } - /** * Alternative method setter for field's Number 2 (component 4) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10 becomes an Integer) * * @param component4 the Number with the Number 2 content to set * @return the field object to enable build pattern - * @see #setNumber2(java.lang.Long) */ public Field50F setNumber2(java.lang.Number component4) { return setComponent4(component4); @@ -946,32 +876,14 @@ public Field50F setComponent6(String component6) { return this; } - /** - * Set the component6 from a Long object. - *
- * If the component being set is a fixed length number, the argument will not be - * padded. It is recommended for these cases to use the setComponent6(String) - * method. - * - * @see #setComponent6(String) - * @since 9.2.7 - * - * @param component6 the Long with the Number 3 content to set - * @return the field object to enable build pattern - */ - public Field50F setComponent6(java.lang.Long component6) { - setComponent(6, SwiftFormatUtils.getLong(component6)); - return this; - } /** * Alternative method setter for field's Number 3 (component 6) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10 becomes an Integer) * * @param component6 the Number with the Number 3 content to set * @return the field object to enable build pattern - * @see #setNumber3(java.lang.Long) */ public Field50F setComponent6(java.lang.Number component6) { @@ -1001,27 +913,13 @@ public Field50F setNumber3(String component6) { return setComponent6(component6); } - /** - * Set the Number 3 (component 6) from a Long object. - * - * @see #setComponent6(java.lang.Long) - * - * @param component6 Long with the Number 3 content to set - * @return the field object to enable build pattern - * @since 9.2.7 - */ - public Field50F setNumber3(java.lang.Long component6) { - return setComponent6(component6); - } - /** * Alternative method setter for field's Number 3 (component 6) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10 becomes an Integer) * * @param component6 the Number with the Number 3 content to set * @return the field object to enable build pattern - * @see #setNumber3(java.lang.Long) */ public Field50F setNumber3(java.lang.Number component6) { return setComponent6(component6); @@ -1059,32 +957,14 @@ public Field50F setComponent8(String component8) { return this; } - /** - * Set the component8 from a Long object. - *
- * If the component being set is a fixed length number, the argument will not be - * padded. It is recommended for these cases to use the setComponent8(String) - * method. - * - * @see #setComponent8(String) - * @since 9.2.7 - * - * @param component8 the Long with the Number 4 content to set - * @return the field object to enable build pattern - */ - public Field50F setComponent8(java.lang.Long component8) { - setComponent(8, SwiftFormatUtils.getLong(component8)); - return this; - } /** * Alternative method setter for field's Number 4 (component 8) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10 becomes an Integer) * * @param component8 the Number with the Number 4 content to set * @return the field object to enable build pattern - * @see #setNumber4(java.lang.Long) */ public Field50F setComponent8(java.lang.Number component8) { @@ -1114,27 +994,13 @@ public Field50F setNumber4(String component8) { return setComponent8(component8); } - /** - * Set the Number 4 (component 8) from a Long object. - * - * @see #setComponent8(java.lang.Long) - * - * @param component8 Long with the Number 4 content to set - * @return the field object to enable build pattern - * @since 9.2.7 - */ - public Field50F setNumber4(java.lang.Long component8) { - return setComponent8(component8); - } - /** * Alternative method setter for field's Number 4 (component 8) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10 becomes an Integer) * * @param component8 the Number with the Number 4 content to set * @return the field object to enable build pattern - * @see #setNumber4(java.lang.Long) */ public Field50F setNumber4(java.lang.Number component8) { return setComponent8(component8); @@ -1226,7 +1092,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field50F(f)); } @@ -1242,6 +1108,7 @@ public static List getAll(final SwiftTagListBlock block) { * @return line content or null if not present or if line number is above the expected * @since 7.7 */ + @Override public String getLine(int line) { return getLine(line, 0); } @@ -1255,6 +1122,7 @@ public String getLine(int line) { * @return line content or null if not present or if line number is above the expected * @since 7.7 */ + @Override public String getLine(int line, int offset) { Field50F cp = newInstance(this); return getLine(cp, line, null, offset); @@ -1267,6 +1135,7 @@ public String getLine(int line, int offset) { * @return lines content or empty list if field's value is empty * @since 7.7 */ + @Override public List getLines() { return SwiftParseUtils.getLines(getValue()); } @@ -1279,6 +1148,7 @@ public List getLines() { * @return found lines or empty list if lines are not present or the offset is invalid * @since 7.7 */ + @Override public List getLines(int offset) { Field50F cp = newInstance(this); return SwiftParseUtils.getLines(getLine(cp, null, null, offset)); @@ -1293,6 +1163,7 @@ public List getLines(int offset) { * @return found lines or empty list if value is empty * @since 7.7 */ + @Override public List getLinesBetween(int start, int end) { return getLinesBetween(start, end, 0); } @@ -1307,6 +1178,7 @@ public List getLinesBetween(int start, int end) { * @return found lines or empty list if lines are not present or the offset is invalid * @since 7.7 */ + @Override public List getLinesBetween(int start, int end, int offset) { Field50F cp = newInstance(this); return SwiftParseUtils.getLines(getLine(cp, start, end, offset)); @@ -1454,25 +1326,29 @@ public String getComponentLabel(final int number) { */ public String getLabelForLineNumber(String lineIdentifier) { if (StringUtils.isNumeric(StringUtils.trimToNull(lineIdentifier))) { - int number = Integer.valueOf(lineIdentifier.trim()); - if (number == 1) { - return "Name of the Ordering Customer"; - } else if (number == 2) { - return "Address Line"; - } else if (number == 3) { - return "Country and Town"; - } else if (number == 4) { - return "Date of Birth"; - } else if (number == 5) { - return "Place of Birth"; - } else if (number == 6) { - return "Customer Identification Number"; - } else if (number == 7) { - return "National Identity Number"; - } else if (number == 8) { - return "Additional Information"; - } - } + try { + int number = Integer.valueOf(lineIdentifier.trim()); + if (number == 1) { + return "Name of the Ordering Customer"; + } else if (number == 2) { + return "Address Line"; + } else if (number == 3) { + return "Country and Town"; + } else if (number == 4) { + return "Date of Birth"; + } else if (number == 5) { + return "Place of Birth"; + } else if (number == 6) { + return "Customer Identification Number"; + } else if (number == 7) { + return "National Identity Number"; + } else if (number == 8) { + return "Additional Information"; + } + } catch (NumberFormatException e) { + // ignore + } + } return null; } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field50G.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field50G.java index f0e165325..9164d00d4 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field50G.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field50G.java @@ -33,12 +33,9 @@ import com.prowidesoftware.swift.model.field.BICContainer; import com.prowidesoftware.swift.model.field.BICResolver; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -220,10 +217,12 @@ public Field50G setIdentifierCode(com.prowidesoftware.swift.model.BIC component2 } + @Override public List bics() { return BICResolver.bics(this); } + @Override public List bicStrings () { return BICResolver.bicStrings(this); } @@ -292,7 +291,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field50G(f)); } @@ -308,6 +307,7 @@ public static List getAll(final SwiftTagListBlock block) { * @return line content or null if not present or if line number is above the expected * @since 7.7 */ + @Override public String getLine(int line) { return getLine(line, 0); } @@ -321,6 +321,7 @@ public String getLine(int line) { * @return line content or null if not present or if line number is above the expected * @since 7.7 */ + @Override public String getLine(int line, int offset) { Field50G cp = newInstance(this); return getLine(cp, line, null, offset); @@ -333,6 +334,7 @@ public String getLine(int line, int offset) { * @return lines content or empty list if field's value is empty * @since 7.7 */ + @Override public List getLines() { return SwiftParseUtils.getLines(getValue()); } @@ -345,6 +347,7 @@ public List getLines() { * @return found lines or empty list if lines are not present or the offset is invalid * @since 7.7 */ + @Override public List getLines(int offset) { Field50G cp = newInstance(this); return SwiftParseUtils.getLines(getLine(cp, null, null, offset)); @@ -359,6 +362,7 @@ public List getLines(int offset) { * @return found lines or empty list if value is empty * @since 7.7 */ + @Override public List getLinesBetween(int start, int end) { return getLinesBetween(start, end, 0); } @@ -373,6 +377,7 @@ public List getLinesBetween(int start, int end) { * @return found lines or empty list if lines are not present or the offset is invalid * @since 7.7 */ + @Override public List getLinesBetween(int start, int end, int offset) { Field50G cp = newInstance(this); return SwiftParseUtils.getLines(getLine(cp, start, end, offset)); diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field50H.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field50H.java index f72a6f567..6fa0a288b 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field50H.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field50H.java @@ -30,12 +30,9 @@ import com.prowidesoftware.swift.model.field.MultiLineField; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -336,7 +333,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field50H(f)); } @@ -352,6 +349,7 @@ public static List getAll(final SwiftTagListBlock block) { * @return line content or null if not present or if line number is above the expected * @since 7.7 */ + @Override public String getLine(int line) { return getLine(line, 0); } @@ -365,6 +363,7 @@ public String getLine(int line) { * @return line content or null if not present or if line number is above the expected * @since 7.7 */ + @Override public String getLine(int line, int offset) { Field50H cp = newInstance(this); return getLine(cp, line, null, offset); @@ -377,6 +376,7 @@ public String getLine(int line, int offset) { * @return lines content or empty list if field's value is empty * @since 7.7 */ + @Override public List getLines() { return SwiftParseUtils.getLines(getValue()); } @@ -389,6 +389,7 @@ public List getLines() { * @return found lines or empty list if lines are not present or the offset is invalid * @since 7.7 */ + @Override public List getLines(int offset) { Field50H cp = newInstance(this); return SwiftParseUtils.getLines(getLine(cp, null, null, offset)); @@ -403,6 +404,7 @@ public List getLines(int offset) { * @return found lines or empty list if value is empty * @since 7.7 */ + @Override public List getLinesBetween(int start, int end) { return getLinesBetween(start, end, 0); } @@ -417,6 +419,7 @@ public List getLinesBetween(int start, int end) { * @return found lines or empty list if lines are not present or the offset is invalid * @since 7.7 */ + @Override public List getLinesBetween(int start, int end, int offset) { Field50H cp = newInstance(this); return SwiftParseUtils.getLines(getLine(cp, start, end, offset)); diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field50K.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field50K.java index f77dc58cb..aca3dfa58 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field50K.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field50K.java @@ -30,12 +30,9 @@ import com.prowidesoftware.swift.model.field.MultiLineField; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -336,7 +333,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field50K(f)); } @@ -352,6 +349,7 @@ public static List getAll(final SwiftTagListBlock block) { * @return line content or null if not present or if line number is above the expected * @since 7.7 */ + @Override public String getLine(int line) { return getLine(line, 0); } @@ -365,6 +363,7 @@ public String getLine(int line) { * @return line content or null if not present or if line number is above the expected * @since 7.7 */ + @Override public String getLine(int line, int offset) { Field50K cp = newInstance(this); return getLine(cp, line, null, offset); @@ -377,6 +376,7 @@ public String getLine(int line, int offset) { * @return lines content or empty list if field's value is empty * @since 7.7 */ + @Override public List getLines() { return SwiftParseUtils.getLines(getValue()); } @@ -389,6 +389,7 @@ public List getLines() { * @return found lines or empty list if lines are not present or the offset is invalid * @since 7.7 */ + @Override public List getLines(int offset) { Field50K cp = newInstance(this); return SwiftParseUtils.getLines(getLine(cp, null, null, offset)); @@ -403,6 +404,7 @@ public List getLines(int offset) { * @return found lines or empty list if value is empty * @since 7.7 */ + @Override public List getLinesBetween(int start, int end) { return getLinesBetween(start, end, 0); } @@ -417,6 +419,7 @@ public List getLinesBetween(int start, int end) { * @return found lines or empty list if lines are not present or the offset is invalid * @since 7.7 */ + @Override public List getLinesBetween(int start, int end, int offset) { Field50K cp = newInstance(this); return SwiftParseUtils.getLines(getLine(cp, start, end, offset)); diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field50L.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field50L.java index 9705d1900..081ef3997 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field50L.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field50L.java @@ -29,12 +29,9 @@ -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -235,7 +232,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field50L(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field51.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field51.java index 3fa6e9a7b..01c31effd 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field51.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field51.java @@ -30,12 +30,9 @@ import com.prowidesoftware.swift.model.field.MultiLineField; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -203,16 +200,14 @@ public String getValueDisplay(int component, Locale locale) { //default format (as is) return getComponent(3); } - if (component == 4) { - //default format (as is) - return getComponent(4); - } - return null; + // This is the last component, return directly without `if` + //default format (as is) + return getComponent(4); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -584,7 +579,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field51(f)); } @@ -600,6 +595,7 @@ public static List getAll(final SwiftTagListBlock block) { * @return line content or null if not present or if line number is above the expected * @since 7.7 */ + @Override public String getLine(int line) { return getLine(line, 0); } @@ -613,6 +609,7 @@ public String getLine(int line) { * @return line content or null if not present or if line number is above the expected * @since 7.7 */ + @Override public String getLine(int line, int offset) { Field51 cp = newInstance(this); return getLine(cp, line, null, offset); @@ -625,6 +622,7 @@ public String getLine(int line, int offset) { * @return lines content or empty list if field's value is empty * @since 7.7 */ + @Override public List getLines() { return SwiftParseUtils.getLines(getValue()); } @@ -637,6 +635,7 @@ public List getLines() { * @return found lines or empty list if lines are not present or the offset is invalid * @since 7.7 */ + @Override public List getLines(int offset) { Field51 cp = newInstance(this); return SwiftParseUtils.getLines(getLine(cp, null, null, offset)); @@ -651,6 +650,7 @@ public List getLines(int offset) { * @return found lines or empty list if value is empty * @since 7.7 */ + @Override public List getLinesBetween(int start, int end) { return getLinesBetween(start, end, 0); } @@ -665,6 +665,7 @@ public List getLinesBetween(int start, int end) { * @return found lines or empty list if lines are not present or the offset is invalid * @since 7.7 */ + @Override public List getLinesBetween(int start, int end, int offset) { Field51 cp = newInstance(this); return SwiftParseUtils.getLines(getLine(cp, start, end, offset)); diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field51A.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field51A.java index 9337a90aa..b3002af08 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field51A.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field51A.java @@ -33,12 +33,9 @@ import com.prowidesoftware.swift.model.field.BICContainer; import com.prowidesoftware.swift.model.field.BICResolver; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -242,10 +239,12 @@ public Field51A setIdentifierCode(com.prowidesoftware.swift.model.BIC component3 } + @Override public List bics() { return BICResolver.bics(this); } + @Override public List bicStrings () { return BICResolver.bicStrings(this); } @@ -314,7 +313,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field51A(f)); } @@ -330,6 +329,7 @@ public static List getAll(final SwiftTagListBlock block) { * @return line content or null if not present or if line number is above the expected * @since 7.7 */ + @Override public String getLine(int line) { return getLine(line, 0); } @@ -343,6 +343,7 @@ public String getLine(int line) { * @return line content or null if not present or if line number is above the expected * @since 7.7 */ + @Override public String getLine(int line, int offset) { Field51A cp = newInstance(this); return getLine(cp, line, null, offset); @@ -355,6 +356,7 @@ public String getLine(int line, int offset) { * @return lines content or empty list if field's value is empty * @since 7.7 */ + @Override public List getLines() { return SwiftParseUtils.getLines(getValue()); } @@ -367,6 +369,7 @@ public List getLines() { * @return found lines or empty list if lines are not present or the offset is invalid * @since 7.7 */ + @Override public List getLines(int offset) { Field51A cp = newInstance(this); return SwiftParseUtils.getLines(getLine(cp, null, null, offset)); @@ -381,6 +384,7 @@ public List getLines(int offset) { * @return found lines or empty list if value is empty * @since 7.7 */ + @Override public List getLinesBetween(int start, int end) { return getLinesBetween(start, end, 0); } @@ -395,6 +399,7 @@ public List getLinesBetween(int start, int end) { * @return found lines or empty list if lines are not present or the offset is invalid * @since 7.7 */ + @Override public List getLinesBetween(int start, int end, int offset) { Field51A cp = newInstance(this); return SwiftParseUtils.getLines(getLine(cp, start, end, offset)); diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field51C.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field51C.java index 9cb01f492..dda4e81ab 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field51C.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field51C.java @@ -29,12 +29,9 @@ -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -235,7 +232,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field51C(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field51D.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field51D.java index 18c83e97f..325fe0cae 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field51D.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field51D.java @@ -30,12 +30,9 @@ import com.prowidesoftware.swift.model.field.MultiLineField; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -358,7 +355,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field51D(f)); } @@ -374,6 +371,7 @@ public static List getAll(final SwiftTagListBlock block) { * @return line content or null if not present or if line number is above the expected * @since 7.7 */ + @Override public String getLine(int line) { return getLine(line, 0); } @@ -387,6 +385,7 @@ public String getLine(int line) { * @return line content or null if not present or if line number is above the expected * @since 7.7 */ + @Override public String getLine(int line, int offset) { Field51D cp = newInstance(this); return getLine(cp, line, null, offset); @@ -399,6 +398,7 @@ public String getLine(int line, int offset) { * @return lines content or empty list if field's value is empty * @since 7.7 */ + @Override public List getLines() { return SwiftParseUtils.getLines(getValue()); } @@ -411,6 +411,7 @@ public List getLines() { * @return found lines or empty list if lines are not present or the offset is invalid * @since 7.7 */ + @Override public List getLines(int offset) { Field51D cp = newInstance(this); return SwiftParseUtils.getLines(getLine(cp, null, null, offset)); @@ -425,6 +426,7 @@ public List getLines(int offset) { * @return found lines or empty list if value is empty * @since 7.7 */ + @Override public List getLinesBetween(int start, int end) { return getLinesBetween(start, end, 0); } @@ -439,6 +441,7 @@ public List getLinesBetween(int start, int end) { * @return found lines or empty list if lines are not present or the offset is invalid * @since 7.7 */ + @Override public List getLinesBetween(int start, int end, int offset) { Field51D cp = newInstance(this); return SwiftParseUtils.getLines(getLine(cp, start, end, offset)); diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field52A.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field52A.java index 2983db030..a511ec4c1 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field52A.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field52A.java @@ -33,12 +33,9 @@ import com.prowidesoftware.swift.model.field.BICContainer; import com.prowidesoftware.swift.model.field.BICResolver; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -242,10 +239,12 @@ public Field52A setIdentifierCode(com.prowidesoftware.swift.model.BIC component3 } + @Override public List bics() { return BICResolver.bics(this); } + @Override public List bicStrings () { return BICResolver.bicStrings(this); } @@ -314,7 +313,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field52A(f)); } @@ -330,6 +329,7 @@ public static List getAll(final SwiftTagListBlock block) { * @return line content or null if not present or if line number is above the expected * @since 7.7 */ + @Override public String getLine(int line) { return getLine(line, 0); } @@ -343,6 +343,7 @@ public String getLine(int line) { * @return line content or null if not present or if line number is above the expected * @since 7.7 */ + @Override public String getLine(int line, int offset) { Field52A cp = newInstance(this); return getLine(cp, line, null, offset); @@ -355,6 +356,7 @@ public String getLine(int line, int offset) { * @return lines content or empty list if field's value is empty * @since 7.7 */ + @Override public List getLines() { return SwiftParseUtils.getLines(getValue()); } @@ -367,6 +369,7 @@ public List getLines() { * @return found lines or empty list if lines are not present or the offset is invalid * @since 7.7 */ + @Override public List getLines(int offset) { Field52A cp = newInstance(this); return SwiftParseUtils.getLines(getLine(cp, null, null, offset)); @@ -381,6 +384,7 @@ public List getLines(int offset) { * @return found lines or empty list if value is empty * @since 7.7 */ + @Override public List getLinesBetween(int start, int end) { return getLinesBetween(start, end, 0); } @@ -395,6 +399,7 @@ public List getLinesBetween(int start, int end) { * @return found lines or empty list if lines are not present or the offset is invalid * @since 7.7 */ + @Override public List getLinesBetween(int start, int end, int offset) { Field52A cp = newInstance(this); return SwiftParseUtils.getLines(getLine(cp, start, end, offset)); diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field52B.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field52B.java index cd56f8ea5..3d4086b66 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field52B.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field52B.java @@ -30,12 +30,9 @@ import com.prowidesoftware.swift.model.field.MultiLineField; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -280,7 +277,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field52B(f)); } @@ -296,6 +293,7 @@ public static List getAll(final SwiftTagListBlock block) { * @return line content or null if not present or if line number is above the expected * @since 7.7 */ + @Override public String getLine(int line) { return getLine(line, 0); } @@ -309,6 +307,7 @@ public String getLine(int line) { * @return line content or null if not present or if line number is above the expected * @since 7.7 */ + @Override public String getLine(int line, int offset) { Field52B cp = newInstance(this); return getLine(cp, line, null, offset); @@ -321,6 +320,7 @@ public String getLine(int line, int offset) { * @return lines content or empty list if field's value is empty * @since 7.7 */ + @Override public List getLines() { return SwiftParseUtils.getLines(getValue()); } @@ -333,6 +333,7 @@ public List getLines() { * @return found lines or empty list if lines are not present or the offset is invalid * @since 7.7 */ + @Override public List getLines(int offset) { Field52B cp = newInstance(this); return SwiftParseUtils.getLines(getLine(cp, null, null, offset)); @@ -347,6 +348,7 @@ public List getLines(int offset) { * @return found lines or empty list if value is empty * @since 7.7 */ + @Override public List getLinesBetween(int start, int end) { return getLinesBetween(start, end, 0); } @@ -361,6 +363,7 @@ public List getLinesBetween(int start, int end) { * @return found lines or empty list if lines are not present or the offset is invalid * @since 7.7 */ + @Override public List getLinesBetween(int start, int end, int offset) { Field52B cp = newInstance(this); return SwiftParseUtils.getLines(getLine(cp, start, end, offset)); diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field52C.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field52C.java index 07206300f..ab3ccd1eb 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field52C.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field52C.java @@ -29,12 +29,9 @@ -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -235,7 +232,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field52C(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field52D.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field52D.java index a7486ff11..f707d94ec 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field52D.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field52D.java @@ -30,12 +30,9 @@ import com.prowidesoftware.swift.model.field.MultiLineField; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -358,7 +355,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field52D(f)); } @@ -374,6 +371,7 @@ public static List getAll(final SwiftTagListBlock block) { * @return line content or null if not present or if line number is above the expected * @since 7.7 */ + @Override public String getLine(int line) { return getLine(line, 0); } @@ -387,6 +385,7 @@ public String getLine(int line) { * @return line content or null if not present or if line number is above the expected * @since 7.7 */ + @Override public String getLine(int line, int offset) { Field52D cp = newInstance(this); return getLine(cp, line, null, offset); @@ -399,6 +398,7 @@ public String getLine(int line, int offset) { * @return lines content or empty list if field's value is empty * @since 7.7 */ + @Override public List getLines() { return SwiftParseUtils.getLines(getValue()); } @@ -411,6 +411,7 @@ public List getLines() { * @return found lines or empty list if lines are not present or the offset is invalid * @since 7.7 */ + @Override public List getLines(int offset) { Field52D cp = newInstance(this); return SwiftParseUtils.getLines(getLine(cp, null, null, offset)); @@ -425,6 +426,7 @@ public List getLines(int offset) { * @return found lines or empty list if value is empty * @since 7.7 */ + @Override public List getLinesBetween(int start, int end) { return getLinesBetween(start, end, 0); } @@ -439,6 +441,7 @@ public List getLinesBetween(int start, int end) { * @return found lines or empty list if lines are not present or the offset is invalid * @since 7.7 */ + @Override public List getLinesBetween(int start, int end, int offset) { Field52D cp = newInstance(this); return SwiftParseUtils.getLines(getLine(cp, start, end, offset)); diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field533.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field533.java index 2f5927f0e..845a7c0c9 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field533.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field533.java @@ -31,12 +31,9 @@ import java.math.BigInteger; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -185,19 +182,16 @@ public String getValue() { */ @Override public String getValueDisplay(int component, Locale locale) { - if (component < 1 || component > 1) { + if (component != 1) { throw new IllegalArgumentException("invalid component number " + component + " for field 533"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -344,32 +338,14 @@ public Field533 setComponent1(String component1) { return this; } - /** - * Set the component1 from a Long object. - *
- * If the component being set is a fixed length number, the argument will not be - * padded. It is recommended for these cases to use the setComponent1(String) - * method. - * - * @see #setComponent1(String) - * @since 9.2.7 - * - * @param component1 the Long with the Cut Off Time Count content to set - * @return the field object to enable build pattern - */ - public Field533 setComponent1(java.lang.Long component1) { - setComponent(1, SwiftFormatUtils.getLong(component1)); - return this; - } /** * Alternative method setter for field's Cut Off Time Count (component 1) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10 becomes an Integer) * * @param component1 the Number with the Cut Off Time Count content to set * @return the field object to enable build pattern - * @see #setCutOffTimeCount(java.lang.Long) */ public Field533 setComponent1(java.lang.Number component1) { @@ -399,27 +375,13 @@ public Field533 setCutOffTimeCount(String component1) { return setComponent1(component1); } - /** - * Set the Cut Off Time Count (component 1) from a Long object. - * - * @see #setComponent1(java.lang.Long) - * - * @param component1 Long with the Cut Off Time Count content to set - * @return the field object to enable build pattern - * @since 9.2.7 - */ - public Field533 setCutOffTimeCount(java.lang.Long component1) { - return setComponent1(component1); - } - /** * Alternative method setter for field's Cut Off Time Count (component 1) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10 becomes an Integer) * * @param component1 the Number with the Cut Off Time Count content to set * @return the field object to enable build pattern - * @see #setCutOffTimeCount(java.lang.Long) */ public Field533 setCutOffTimeCount(java.lang.Number component1) { return setComponent1(component1); @@ -490,7 +452,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field533(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field53A.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field53A.java index 95efb4a83..37aa6bf0d 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field53A.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field53A.java @@ -33,12 +33,9 @@ import com.prowidesoftware.swift.model.field.BICContainer; import com.prowidesoftware.swift.model.field.BICResolver; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -242,10 +239,12 @@ public Field53A setIdentifierCode(com.prowidesoftware.swift.model.BIC component3 } + @Override public List bics() { return BICResolver.bics(this); } + @Override public List bicStrings () { return BICResolver.bicStrings(this); } @@ -314,7 +313,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field53A(f)); } @@ -330,6 +329,7 @@ public static List getAll(final SwiftTagListBlock block) { * @return line content or null if not present or if line number is above the expected * @since 7.7 */ + @Override public String getLine(int line) { return getLine(line, 0); } @@ -343,6 +343,7 @@ public String getLine(int line) { * @return line content or null if not present or if line number is above the expected * @since 7.7 */ + @Override public String getLine(int line, int offset) { Field53A cp = newInstance(this); return getLine(cp, line, null, offset); @@ -355,6 +356,7 @@ public String getLine(int line, int offset) { * @return lines content or empty list if field's value is empty * @since 7.7 */ + @Override public List getLines() { return SwiftParseUtils.getLines(getValue()); } @@ -367,6 +369,7 @@ public List getLines() { * @return found lines or empty list if lines are not present or the offset is invalid * @since 7.7 */ + @Override public List getLines(int offset) { Field53A cp = newInstance(this); return SwiftParseUtils.getLines(getLine(cp, null, null, offset)); @@ -381,6 +384,7 @@ public List getLines(int offset) { * @return found lines or empty list if value is empty * @since 7.7 */ + @Override public List getLinesBetween(int start, int end) { return getLinesBetween(start, end, 0); } @@ -395,6 +399,7 @@ public List getLinesBetween(int start, int end) { * @return found lines or empty list if lines are not present or the offset is invalid * @since 7.7 */ + @Override public List getLinesBetween(int start, int end, int offset) { Field53A cp = newInstance(this); return SwiftParseUtils.getLines(getLine(cp, start, end, offset)); diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field53B.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field53B.java index 8a7c14851..548cf9a1f 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field53B.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field53B.java @@ -30,12 +30,9 @@ import com.prowidesoftware.swift.model.field.MultiLineField; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -280,7 +277,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field53B(f)); } @@ -296,6 +293,7 @@ public static List getAll(final SwiftTagListBlock block) { * @return line content or null if not present or if line number is above the expected * @since 7.7 */ + @Override public String getLine(int line) { return getLine(line, 0); } @@ -309,6 +307,7 @@ public String getLine(int line) { * @return line content or null if not present or if line number is above the expected * @since 7.7 */ + @Override public String getLine(int line, int offset) { Field53B cp = newInstance(this); return getLine(cp, line, null, offset); @@ -321,6 +320,7 @@ public String getLine(int line, int offset) { * @return lines content or empty list if field's value is empty * @since 7.7 */ + @Override public List getLines() { return SwiftParseUtils.getLines(getValue()); } @@ -333,6 +333,7 @@ public List getLines() { * @return found lines or empty list if lines are not present or the offset is invalid * @since 7.7 */ + @Override public List getLines(int offset) { Field53B cp = newInstance(this); return SwiftParseUtils.getLines(getLine(cp, null, null, offset)); @@ -347,6 +348,7 @@ public List getLines(int offset) { * @return found lines or empty list if value is empty * @since 7.7 */ + @Override public List getLinesBetween(int start, int end) { return getLinesBetween(start, end, 0); } @@ -361,6 +363,7 @@ public List getLinesBetween(int start, int end) { * @return found lines or empty list if lines are not present or the offset is invalid * @since 7.7 */ + @Override public List getLinesBetween(int start, int end, int offset) { Field53B cp = newInstance(this); return SwiftParseUtils.getLines(getLine(cp, start, end, offset)); diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field53C.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field53C.java index b2bd5e232..24e0010f4 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field53C.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field53C.java @@ -29,12 +29,9 @@ -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -235,7 +232,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field53C(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field53D.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field53D.java index a6fef3a79..117a046fa 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field53D.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field53D.java @@ -30,12 +30,9 @@ import com.prowidesoftware.swift.model.field.MultiLineField; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -358,7 +355,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field53D(f)); } @@ -374,6 +371,7 @@ public static List getAll(final SwiftTagListBlock block) { * @return line content or null if not present or if line number is above the expected * @since 7.7 */ + @Override public String getLine(int line) { return getLine(line, 0); } @@ -387,6 +385,7 @@ public String getLine(int line) { * @return line content or null if not present or if line number is above the expected * @since 7.7 */ + @Override public String getLine(int line, int offset) { Field53D cp = newInstance(this); return getLine(cp, line, null, offset); @@ -399,6 +398,7 @@ public String getLine(int line, int offset) { * @return lines content or empty list if field's value is empty * @since 7.7 */ + @Override public List getLines() { return SwiftParseUtils.getLines(getValue()); } @@ -411,6 +411,7 @@ public List getLines() { * @return found lines or empty list if lines are not present or the offset is invalid * @since 7.7 */ + @Override public List getLines(int offset) { Field53D cp = newInstance(this); return SwiftParseUtils.getLines(getLine(cp, null, null, offset)); @@ -425,6 +426,7 @@ public List getLines(int offset) { * @return found lines or empty list if value is empty * @since 7.7 */ + @Override public List getLinesBetween(int start, int end) { return getLinesBetween(start, end, 0); } @@ -439,6 +441,7 @@ public List getLinesBetween(int start, int end) { * @return found lines or empty list if lines are not present or the offset is invalid * @since 7.7 */ + @Override public List getLinesBetween(int start, int end, int offset) { Field53D cp = newInstance(this); return SwiftParseUtils.getLines(getLine(cp, start, end, offset)); diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field53J.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field53J.java index 203b7b107..dab14e342 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field53J.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field53J.java @@ -29,12 +29,9 @@ -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -235,7 +232,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field53J(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field54A.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field54A.java index fb6fa0c39..f14bf404d 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field54A.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field54A.java @@ -33,12 +33,9 @@ import com.prowidesoftware.swift.model.field.BICContainer; import com.prowidesoftware.swift.model.field.BICResolver; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -242,10 +239,12 @@ public Field54A setIdentifierCode(com.prowidesoftware.swift.model.BIC component3 } + @Override public List bics() { return BICResolver.bics(this); } + @Override public List bicStrings () { return BICResolver.bicStrings(this); } @@ -314,7 +313,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field54A(f)); } @@ -330,6 +329,7 @@ public static List getAll(final SwiftTagListBlock block) { * @return line content or null if not present or if line number is above the expected * @since 7.7 */ + @Override public String getLine(int line) { return getLine(line, 0); } @@ -343,6 +343,7 @@ public String getLine(int line) { * @return line content or null if not present or if line number is above the expected * @since 7.7 */ + @Override public String getLine(int line, int offset) { Field54A cp = newInstance(this); return getLine(cp, line, null, offset); @@ -355,6 +356,7 @@ public String getLine(int line, int offset) { * @return lines content or empty list if field's value is empty * @since 7.7 */ + @Override public List getLines() { return SwiftParseUtils.getLines(getValue()); } @@ -367,6 +369,7 @@ public List getLines() { * @return found lines or empty list if lines are not present or the offset is invalid * @since 7.7 */ + @Override public List getLines(int offset) { Field54A cp = newInstance(this); return SwiftParseUtils.getLines(getLine(cp, null, null, offset)); @@ -381,6 +384,7 @@ public List getLines(int offset) { * @return found lines or empty list if value is empty * @since 7.7 */ + @Override public List getLinesBetween(int start, int end) { return getLinesBetween(start, end, 0); } @@ -395,6 +399,7 @@ public List getLinesBetween(int start, int end) { * @return found lines or empty list if lines are not present or the offset is invalid * @since 7.7 */ + @Override public List getLinesBetween(int start, int end, int offset) { Field54A cp = newInstance(this); return SwiftParseUtils.getLines(getLine(cp, start, end, offset)); diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field54B.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field54B.java index 0abc36438..af5a096d6 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field54B.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field54B.java @@ -30,12 +30,9 @@ import com.prowidesoftware.swift.model.field.MultiLineField; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -280,7 +277,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field54B(f)); } @@ -296,6 +293,7 @@ public static List getAll(final SwiftTagListBlock block) { * @return line content or null if not present or if line number is above the expected * @since 7.7 */ + @Override public String getLine(int line) { return getLine(line, 0); } @@ -309,6 +307,7 @@ public String getLine(int line) { * @return line content or null if not present or if line number is above the expected * @since 7.7 */ + @Override public String getLine(int line, int offset) { Field54B cp = newInstance(this); return getLine(cp, line, null, offset); @@ -321,6 +320,7 @@ public String getLine(int line, int offset) { * @return lines content or empty list if field's value is empty * @since 7.7 */ + @Override public List getLines() { return SwiftParseUtils.getLines(getValue()); } @@ -333,6 +333,7 @@ public List getLines() { * @return found lines or empty list if lines are not present or the offset is invalid * @since 7.7 */ + @Override public List getLines(int offset) { Field54B cp = newInstance(this); return SwiftParseUtils.getLines(getLine(cp, null, null, offset)); @@ -347,6 +348,7 @@ public List getLines(int offset) { * @return found lines or empty list if value is empty * @since 7.7 */ + @Override public List getLinesBetween(int start, int end) { return getLinesBetween(start, end, 0); } @@ -361,6 +363,7 @@ public List getLinesBetween(int start, int end) { * @return found lines or empty list if lines are not present or the offset is invalid * @since 7.7 */ + @Override public List getLinesBetween(int start, int end, int offset) { Field54B cp = newInstance(this); return SwiftParseUtils.getLines(getLine(cp, start, end, offset)); diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field54D.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field54D.java index 3afe08a98..f00dfcd20 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field54D.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field54D.java @@ -30,12 +30,9 @@ import com.prowidesoftware.swift.model.field.MultiLineField; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -358,7 +355,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field54D(f)); } @@ -374,6 +371,7 @@ public static List getAll(final SwiftTagListBlock block) { * @return line content or null if not present or if line number is above the expected * @since 7.7 */ + @Override public String getLine(int line) { return getLine(line, 0); } @@ -387,6 +385,7 @@ public String getLine(int line) { * @return line content or null if not present or if line number is above the expected * @since 7.7 */ + @Override public String getLine(int line, int offset) { Field54D cp = newInstance(this); return getLine(cp, line, null, offset); @@ -399,6 +398,7 @@ public String getLine(int line, int offset) { * @return lines content or empty list if field's value is empty * @since 7.7 */ + @Override public List getLines() { return SwiftParseUtils.getLines(getValue()); } @@ -411,6 +411,7 @@ public List getLines() { * @return found lines or empty list if lines are not present or the offset is invalid * @since 7.7 */ + @Override public List getLines(int offset) { Field54D cp = newInstance(this); return SwiftParseUtils.getLines(getLine(cp, null, null, offset)); @@ -425,6 +426,7 @@ public List getLines(int offset) { * @return found lines or empty list if value is empty * @since 7.7 */ + @Override public List getLinesBetween(int start, int end) { return getLinesBetween(start, end, 0); } @@ -439,6 +441,7 @@ public List getLinesBetween(int start, int end) { * @return found lines or empty list if lines are not present or the offset is invalid * @since 7.7 */ + @Override public List getLinesBetween(int start, int end, int offset) { Field54D cp = newInstance(this); return SwiftParseUtils.getLines(getLine(cp, start, end, offset)); diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field55A.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field55A.java index c276354df..0e7fd2bef 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field55A.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field55A.java @@ -33,12 +33,9 @@ import com.prowidesoftware.swift.model.field.BICContainer; import com.prowidesoftware.swift.model.field.BICResolver; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -242,10 +239,12 @@ public Field55A setIdentifierCode(com.prowidesoftware.swift.model.BIC component3 } + @Override public List bics() { return BICResolver.bics(this); } + @Override public List bicStrings () { return BICResolver.bicStrings(this); } @@ -314,7 +313,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field55A(f)); } @@ -330,6 +329,7 @@ public static List getAll(final SwiftTagListBlock block) { * @return line content or null if not present or if line number is above the expected * @since 7.7 */ + @Override public String getLine(int line) { return getLine(line, 0); } @@ -343,6 +343,7 @@ public String getLine(int line) { * @return line content or null if not present or if line number is above the expected * @since 7.7 */ + @Override public String getLine(int line, int offset) { Field55A cp = newInstance(this); return getLine(cp, line, null, offset); @@ -355,6 +356,7 @@ public String getLine(int line, int offset) { * @return lines content or empty list if field's value is empty * @since 7.7 */ + @Override public List getLines() { return SwiftParseUtils.getLines(getValue()); } @@ -367,6 +369,7 @@ public List getLines() { * @return found lines or empty list if lines are not present or the offset is invalid * @since 7.7 */ + @Override public List getLines(int offset) { Field55A cp = newInstance(this); return SwiftParseUtils.getLines(getLine(cp, null, null, offset)); @@ -381,6 +384,7 @@ public List getLines(int offset) { * @return found lines or empty list if value is empty * @since 7.7 */ + @Override public List getLinesBetween(int start, int end) { return getLinesBetween(start, end, 0); } @@ -395,6 +399,7 @@ public List getLinesBetween(int start, int end) { * @return found lines or empty list if lines are not present or the offset is invalid * @since 7.7 */ + @Override public List getLinesBetween(int start, int end, int offset) { Field55A cp = newInstance(this); return SwiftParseUtils.getLines(getLine(cp, start, end, offset)); diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field55B.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field55B.java index 5669f6e49..a1fef7c7d 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field55B.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field55B.java @@ -30,12 +30,9 @@ import com.prowidesoftware.swift.model.field.MultiLineField; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -280,7 +277,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field55B(f)); } @@ -296,6 +293,7 @@ public static List getAll(final SwiftTagListBlock block) { * @return line content or null if not present or if line number is above the expected * @since 7.7 */ + @Override public String getLine(int line) { return getLine(line, 0); } @@ -309,6 +307,7 @@ public String getLine(int line) { * @return line content or null if not present or if line number is above the expected * @since 7.7 */ + @Override public String getLine(int line, int offset) { Field55B cp = newInstance(this); return getLine(cp, line, null, offset); @@ -321,6 +320,7 @@ public String getLine(int line, int offset) { * @return lines content or empty list if field's value is empty * @since 7.7 */ + @Override public List getLines() { return SwiftParseUtils.getLines(getValue()); } @@ -333,6 +333,7 @@ public List getLines() { * @return found lines or empty list if lines are not present or the offset is invalid * @since 7.7 */ + @Override public List getLines(int offset) { Field55B cp = newInstance(this); return SwiftParseUtils.getLines(getLine(cp, null, null, offset)); @@ -347,6 +348,7 @@ public List getLines(int offset) { * @return found lines or empty list if value is empty * @since 7.7 */ + @Override public List getLinesBetween(int start, int end) { return getLinesBetween(start, end, 0); } @@ -361,6 +363,7 @@ public List getLinesBetween(int start, int end) { * @return found lines or empty list if lines are not present or the offset is invalid * @since 7.7 */ + @Override public List getLinesBetween(int start, int end, int offset) { Field55B cp = newInstance(this); return SwiftParseUtils.getLines(getLine(cp, start, end, offset)); diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field55D.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field55D.java index 735cc6742..93c1137f6 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field55D.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field55D.java @@ -30,12 +30,9 @@ import com.prowidesoftware.swift.model.field.MultiLineField; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -358,7 +355,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field55D(f)); } @@ -374,6 +371,7 @@ public static List getAll(final SwiftTagListBlock block) { * @return line content or null if not present or if line number is above the expected * @since 7.7 */ + @Override public String getLine(int line) { return getLine(line, 0); } @@ -387,6 +385,7 @@ public String getLine(int line) { * @return line content or null if not present or if line number is above the expected * @since 7.7 */ + @Override public String getLine(int line, int offset) { Field55D cp = newInstance(this); return getLine(cp, line, null, offset); @@ -399,6 +398,7 @@ public String getLine(int line, int offset) { * @return lines content or empty list if field's value is empty * @since 7.7 */ + @Override public List getLines() { return SwiftParseUtils.getLines(getValue()); } @@ -411,6 +411,7 @@ public List getLines() { * @return found lines or empty list if lines are not present or the offset is invalid * @since 7.7 */ + @Override public List getLines(int offset) { Field55D cp = newInstance(this); return SwiftParseUtils.getLines(getLine(cp, null, null, offset)); @@ -425,6 +426,7 @@ public List getLines(int offset) { * @return found lines or empty list if value is empty * @since 7.7 */ + @Override public List getLinesBetween(int start, int end) { return getLinesBetween(start, end, 0); } @@ -439,6 +441,7 @@ public List getLinesBetween(int start, int end) { * @return found lines or empty list if lines are not present or the offset is invalid * @since 7.7 */ + @Override public List getLinesBetween(int start, int end, int offset) { Field55D cp = newInstance(this); return SwiftParseUtils.getLines(getLine(cp, start, end, offset)); diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field56A.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field56A.java index f2edd3193..47786c979 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field56A.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field56A.java @@ -33,12 +33,9 @@ import com.prowidesoftware.swift.model.field.BICContainer; import com.prowidesoftware.swift.model.field.BICResolver; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -242,10 +239,12 @@ public Field56A setIdentifierCode(com.prowidesoftware.swift.model.BIC component3 } + @Override public List bics() { return BICResolver.bics(this); } + @Override public List bicStrings () { return BICResolver.bicStrings(this); } @@ -314,7 +313,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field56A(f)); } @@ -330,6 +329,7 @@ public static List getAll(final SwiftTagListBlock block) { * @return line content or null if not present or if line number is above the expected * @since 7.7 */ + @Override public String getLine(int line) { return getLine(line, 0); } @@ -343,6 +343,7 @@ public String getLine(int line) { * @return line content or null if not present or if line number is above the expected * @since 7.7 */ + @Override public String getLine(int line, int offset) { Field56A cp = newInstance(this); return getLine(cp, line, null, offset); @@ -355,6 +356,7 @@ public String getLine(int line, int offset) { * @return lines content or empty list if field's value is empty * @since 7.7 */ + @Override public List getLines() { return SwiftParseUtils.getLines(getValue()); } @@ -367,6 +369,7 @@ public List getLines() { * @return found lines or empty list if lines are not present or the offset is invalid * @since 7.7 */ + @Override public List getLines(int offset) { Field56A cp = newInstance(this); return SwiftParseUtils.getLines(getLine(cp, null, null, offset)); @@ -381,6 +384,7 @@ public List getLines(int offset) { * @return found lines or empty list if value is empty * @since 7.7 */ + @Override public List getLinesBetween(int start, int end) { return getLinesBetween(start, end, 0); } @@ -395,6 +399,7 @@ public List getLinesBetween(int start, int end) { * @return found lines or empty list if lines are not present or the offset is invalid * @since 7.7 */ + @Override public List getLinesBetween(int start, int end, int offset) { Field56A cp = newInstance(this); return SwiftParseUtils.getLines(getLine(cp, start, end, offset)); diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field56B.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field56B.java index 712460232..75df61599 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field56B.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field56B.java @@ -30,12 +30,9 @@ import com.prowidesoftware.swift.model.field.MultiLineField; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -280,7 +277,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field56B(f)); } @@ -296,6 +293,7 @@ public static List getAll(final SwiftTagListBlock block) { * @return line content or null if not present or if line number is above the expected * @since 7.7 */ + @Override public String getLine(int line) { return getLine(line, 0); } @@ -309,6 +307,7 @@ public String getLine(int line) { * @return line content or null if not present or if line number is above the expected * @since 7.7 */ + @Override public String getLine(int line, int offset) { Field56B cp = newInstance(this); return getLine(cp, line, null, offset); @@ -321,6 +320,7 @@ public String getLine(int line, int offset) { * @return lines content or empty list if field's value is empty * @since 7.7 */ + @Override public List getLines() { return SwiftParseUtils.getLines(getValue()); } @@ -333,6 +333,7 @@ public List getLines() { * @return found lines or empty list if lines are not present or the offset is invalid * @since 7.7 */ + @Override public List getLines(int offset) { Field56B cp = newInstance(this); return SwiftParseUtils.getLines(getLine(cp, null, null, offset)); @@ -347,6 +348,7 @@ public List getLines(int offset) { * @return found lines or empty list if value is empty * @since 7.7 */ + @Override public List getLinesBetween(int start, int end) { return getLinesBetween(start, end, 0); } @@ -361,6 +363,7 @@ public List getLinesBetween(int start, int end) { * @return found lines or empty list if lines are not present or the offset is invalid * @since 7.7 */ + @Override public List getLinesBetween(int start, int end, int offset) { Field56B cp = newInstance(this); return SwiftParseUtils.getLines(getLine(cp, start, end, offset)); diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field56C.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field56C.java index a84209f30..740d0592a 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field56C.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field56C.java @@ -29,12 +29,9 @@ -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -235,7 +232,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field56C(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field56D.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field56D.java index 2a1d98cf1..eae02f95e 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field56D.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field56D.java @@ -30,12 +30,9 @@ import com.prowidesoftware.swift.model.field.MultiLineField; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -358,7 +355,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field56D(f)); } @@ -374,6 +371,7 @@ public static List getAll(final SwiftTagListBlock block) { * @return line content or null if not present or if line number is above the expected * @since 7.7 */ + @Override public String getLine(int line) { return getLine(line, 0); } @@ -387,6 +385,7 @@ public String getLine(int line) { * @return line content or null if not present or if line number is above the expected * @since 7.7 */ + @Override public String getLine(int line, int offset) { Field56D cp = newInstance(this); return getLine(cp, line, null, offset); @@ -399,6 +398,7 @@ public String getLine(int line, int offset) { * @return lines content or empty list if field's value is empty * @since 7.7 */ + @Override public List getLines() { return SwiftParseUtils.getLines(getValue()); } @@ -411,6 +411,7 @@ public List getLines() { * @return found lines or empty list if lines are not present or the offset is invalid * @since 7.7 */ + @Override public List getLines(int offset) { Field56D cp = newInstance(this); return SwiftParseUtils.getLines(getLine(cp, null, null, offset)); @@ -425,6 +426,7 @@ public List getLines(int offset) { * @return found lines or empty list if value is empty * @since 7.7 */ + @Override public List getLinesBetween(int start, int end) { return getLinesBetween(start, end, 0); } @@ -439,6 +441,7 @@ public List getLinesBetween(int start, int end) { * @return found lines or empty list if lines are not present or the offset is invalid * @since 7.7 */ + @Override public List getLinesBetween(int start, int end, int offset) { Field56D cp = newInstance(this); return SwiftParseUtils.getLines(getLine(cp, start, end, offset)); diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field56J.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field56J.java index c07e30d92..fe2558317 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field56J.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field56J.java @@ -29,12 +29,9 @@ -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -235,7 +232,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field56J(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field57A.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field57A.java index 1e042e511..b0460111a 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field57A.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field57A.java @@ -33,12 +33,9 @@ import com.prowidesoftware.swift.model.field.BICContainer; import com.prowidesoftware.swift.model.field.BICResolver; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -242,10 +239,12 @@ public Field57A setIdentifierCode(com.prowidesoftware.swift.model.BIC component3 } + @Override public List bics() { return BICResolver.bics(this); } + @Override public List bicStrings () { return BICResolver.bicStrings(this); } @@ -314,7 +313,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field57A(f)); } @@ -330,6 +329,7 @@ public static List getAll(final SwiftTagListBlock block) { * @return line content or null if not present or if line number is above the expected * @since 7.7 */ + @Override public String getLine(int line) { return getLine(line, 0); } @@ -343,6 +343,7 @@ public String getLine(int line) { * @return line content or null if not present or if line number is above the expected * @since 7.7 */ + @Override public String getLine(int line, int offset) { Field57A cp = newInstance(this); return getLine(cp, line, null, offset); @@ -355,6 +356,7 @@ public String getLine(int line, int offset) { * @return lines content or empty list if field's value is empty * @since 7.7 */ + @Override public List getLines() { return SwiftParseUtils.getLines(getValue()); } @@ -367,6 +369,7 @@ public List getLines() { * @return found lines or empty list if lines are not present or the offset is invalid * @since 7.7 */ + @Override public List getLines(int offset) { Field57A cp = newInstance(this); return SwiftParseUtils.getLines(getLine(cp, null, null, offset)); @@ -381,6 +384,7 @@ public List getLines(int offset) { * @return found lines or empty list if value is empty * @since 7.7 */ + @Override public List getLinesBetween(int start, int end) { return getLinesBetween(start, end, 0); } @@ -395,6 +399,7 @@ public List getLinesBetween(int start, int end) { * @return found lines or empty list if lines are not present or the offset is invalid * @since 7.7 */ + @Override public List getLinesBetween(int start, int end, int offset) { Field57A cp = newInstance(this); return SwiftParseUtils.getLines(getLine(cp, start, end, offset)); diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field57B.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field57B.java index ad6835bca..041f8da16 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field57B.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field57B.java @@ -30,12 +30,9 @@ import com.prowidesoftware.swift.model.field.MultiLineField; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -280,7 +277,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field57B(f)); } @@ -296,6 +293,7 @@ public static List getAll(final SwiftTagListBlock block) { * @return line content or null if not present or if line number is above the expected * @since 7.7 */ + @Override public String getLine(int line) { return getLine(line, 0); } @@ -309,6 +307,7 @@ public String getLine(int line) { * @return line content or null if not present or if line number is above the expected * @since 7.7 */ + @Override public String getLine(int line, int offset) { Field57B cp = newInstance(this); return getLine(cp, line, null, offset); @@ -321,6 +320,7 @@ public String getLine(int line, int offset) { * @return lines content or empty list if field's value is empty * @since 7.7 */ + @Override public List getLines() { return SwiftParseUtils.getLines(getValue()); } @@ -333,6 +333,7 @@ public List getLines() { * @return found lines or empty list if lines are not present or the offset is invalid * @since 7.7 */ + @Override public List getLines(int offset) { Field57B cp = newInstance(this); return SwiftParseUtils.getLines(getLine(cp, null, null, offset)); @@ -347,6 +348,7 @@ public List getLines(int offset) { * @return found lines or empty list if value is empty * @since 7.7 */ + @Override public List getLinesBetween(int start, int end) { return getLinesBetween(start, end, 0); } @@ -361,6 +363,7 @@ public List getLinesBetween(int start, int end) { * @return found lines or empty list if lines are not present or the offset is invalid * @since 7.7 */ + @Override public List getLinesBetween(int start, int end, int offset) { Field57B cp = newInstance(this); return SwiftParseUtils.getLines(getLine(cp, start, end, offset)); diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field57C.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field57C.java index ec45df575..4cde87a94 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field57C.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field57C.java @@ -29,12 +29,9 @@ -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -235,7 +232,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field57C(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field57D.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field57D.java index 748609df3..b72069e44 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field57D.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field57D.java @@ -30,12 +30,9 @@ import com.prowidesoftware.swift.model.field.MultiLineField; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -358,7 +355,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field57D(f)); } @@ -374,6 +371,7 @@ public static List getAll(final SwiftTagListBlock block) { * @return line content or null if not present or if line number is above the expected * @since 7.7 */ + @Override public String getLine(int line) { return getLine(line, 0); } @@ -387,6 +385,7 @@ public String getLine(int line) { * @return line content or null if not present or if line number is above the expected * @since 7.7 */ + @Override public String getLine(int line, int offset) { Field57D cp = newInstance(this); return getLine(cp, line, null, offset); @@ -399,6 +398,7 @@ public String getLine(int line, int offset) { * @return lines content or empty list if field's value is empty * @since 7.7 */ + @Override public List getLines() { return SwiftParseUtils.getLines(getValue()); } @@ -411,6 +411,7 @@ public List getLines() { * @return found lines or empty list if lines are not present or the offset is invalid * @since 7.7 */ + @Override public List getLines(int offset) { Field57D cp = newInstance(this); return SwiftParseUtils.getLines(getLine(cp, null, null, offset)); @@ -425,6 +426,7 @@ public List getLines(int offset) { * @return found lines or empty list if value is empty * @since 7.7 */ + @Override public List getLinesBetween(int start, int end) { return getLinesBetween(start, end, 0); } @@ -439,6 +441,7 @@ public List getLinesBetween(int start, int end) { * @return found lines or empty list if lines are not present or the offset is invalid * @since 7.7 */ + @Override public List getLinesBetween(int start, int end, int offset) { Field57D cp = newInstance(this); return SwiftParseUtils.getLines(getLine(cp, start, end, offset)); diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field57J.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field57J.java index fc28cf758..c4a974153 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field57J.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field57J.java @@ -29,12 +29,9 @@ -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -235,7 +232,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field57J(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field58A.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field58A.java index 7d1d0fbfd..0e9d38ee9 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field58A.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field58A.java @@ -33,12 +33,9 @@ import com.prowidesoftware.swift.model.field.BICContainer; import com.prowidesoftware.swift.model.field.BICResolver; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -242,10 +239,12 @@ public Field58A setIdentifierCode(com.prowidesoftware.swift.model.BIC component3 } + @Override public List bics() { return BICResolver.bics(this); } + @Override public List bicStrings () { return BICResolver.bicStrings(this); } @@ -314,7 +313,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field58A(f)); } @@ -330,6 +329,7 @@ public static List getAll(final SwiftTagListBlock block) { * @return line content or null if not present or if line number is above the expected * @since 7.7 */ + @Override public String getLine(int line) { return getLine(line, 0); } @@ -343,6 +343,7 @@ public String getLine(int line) { * @return line content or null if not present or if line number is above the expected * @since 7.7 */ + @Override public String getLine(int line, int offset) { Field58A cp = newInstance(this); return getLine(cp, line, null, offset); @@ -355,6 +356,7 @@ public String getLine(int line, int offset) { * @return lines content or empty list if field's value is empty * @since 7.7 */ + @Override public List getLines() { return SwiftParseUtils.getLines(getValue()); } @@ -367,6 +369,7 @@ public List getLines() { * @return found lines or empty list if lines are not present or the offset is invalid * @since 7.7 */ + @Override public List getLines(int offset) { Field58A cp = newInstance(this); return SwiftParseUtils.getLines(getLine(cp, null, null, offset)); @@ -381,6 +384,7 @@ public List getLines(int offset) { * @return found lines or empty list if value is empty * @since 7.7 */ + @Override public List getLinesBetween(int start, int end) { return getLinesBetween(start, end, 0); } @@ -395,6 +399,7 @@ public List getLinesBetween(int start, int end) { * @return found lines or empty list if lines are not present or the offset is invalid * @since 7.7 */ + @Override public List getLinesBetween(int start, int end, int offset) { Field58A cp = newInstance(this); return SwiftParseUtils.getLines(getLine(cp, start, end, offset)); diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field58B.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field58B.java index 09aa1a835..145e7e573 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field58B.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field58B.java @@ -30,12 +30,9 @@ import com.prowidesoftware.swift.model.field.MultiLineField; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -280,7 +277,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field58B(f)); } @@ -296,6 +293,7 @@ public static List getAll(final SwiftTagListBlock block) { * @return line content or null if not present or if line number is above the expected * @since 7.7 */ + @Override public String getLine(int line) { return getLine(line, 0); } @@ -309,6 +307,7 @@ public String getLine(int line) { * @return line content or null if not present or if line number is above the expected * @since 7.7 */ + @Override public String getLine(int line, int offset) { Field58B cp = newInstance(this); return getLine(cp, line, null, offset); @@ -321,6 +320,7 @@ public String getLine(int line, int offset) { * @return lines content or empty list if field's value is empty * @since 7.7 */ + @Override public List getLines() { return SwiftParseUtils.getLines(getValue()); } @@ -333,6 +333,7 @@ public List getLines() { * @return found lines or empty list if lines are not present or the offset is invalid * @since 7.7 */ + @Override public List getLines(int offset) { Field58B cp = newInstance(this); return SwiftParseUtils.getLines(getLine(cp, null, null, offset)); @@ -347,6 +348,7 @@ public List getLines(int offset) { * @return found lines or empty list if value is empty * @since 7.7 */ + @Override public List getLinesBetween(int start, int end) { return getLinesBetween(start, end, 0); } @@ -361,6 +363,7 @@ public List getLinesBetween(int start, int end) { * @return found lines or empty list if lines are not present or the offset is invalid * @since 7.7 */ + @Override public List getLinesBetween(int start, int end, int offset) { Field58B cp = newInstance(this); return SwiftParseUtils.getLines(getLine(cp, start, end, offset)); diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field58D.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field58D.java index f7dd7e374..d80b8e2e7 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field58D.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field58D.java @@ -30,12 +30,9 @@ import com.prowidesoftware.swift.model.field.MultiLineField; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -358,7 +355,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field58D(f)); } @@ -374,6 +371,7 @@ public static List getAll(final SwiftTagListBlock block) { * @return line content or null if not present or if line number is above the expected * @since 7.7 */ + @Override public String getLine(int line) { return getLine(line, 0); } @@ -387,6 +385,7 @@ public String getLine(int line) { * @return line content or null if not present or if line number is above the expected * @since 7.7 */ + @Override public String getLine(int line, int offset) { Field58D cp = newInstance(this); return getLine(cp, line, null, offset); @@ -399,6 +398,7 @@ public String getLine(int line, int offset) { * @return lines content or empty list if field's value is empty * @since 7.7 */ + @Override public List getLines() { return SwiftParseUtils.getLines(getValue()); } @@ -411,6 +411,7 @@ public List getLines() { * @return found lines or empty list if lines are not present or the offset is invalid * @since 7.7 */ + @Override public List getLines(int offset) { Field58D cp = newInstance(this); return SwiftParseUtils.getLines(getLine(cp, null, null, offset)); @@ -425,6 +426,7 @@ public List getLines(int offset) { * @return found lines or empty list if value is empty * @since 7.7 */ + @Override public List getLinesBetween(int start, int end) { return getLinesBetween(start, end, 0); } @@ -439,6 +441,7 @@ public List getLinesBetween(int start, int end) { * @return found lines or empty list if lines are not present or the offset is invalid * @since 7.7 */ + @Override public List getLinesBetween(int start, int end, int offset) { Field58D cp = newInstance(this); return SwiftParseUtils.getLines(getLine(cp, start, end, offset)); diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field58J.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field58J.java index 7e0923f75..20cb21389 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field58J.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field58J.java @@ -29,12 +29,9 @@ -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -235,7 +232,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field58J(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field59.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field59.java index 5a09a11e7..2a00bb92d 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field59.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field59.java @@ -30,12 +30,9 @@ import com.prowidesoftware.swift.model.field.MultiLineField; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -223,16 +220,14 @@ public String getValueDisplay(int component, Locale locale) { //default format (as is) return getComponent(4); } - if (component == 5) { - //default format (as is) - return getComponent(5); - } - return null; + // This is the last component, return directly without `if` + //default format (as is) + return getComponent(5); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -656,7 +651,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field59(f)); } @@ -672,6 +667,7 @@ public static List getAll(final SwiftTagListBlock block) { * @return line content or null if not present or if line number is above the expected * @since 7.7 */ + @Override public String getLine(int line) { return getLine(line, 0); } @@ -685,6 +681,7 @@ public String getLine(int line) { * @return line content or null if not present or if line number is above the expected * @since 7.7 */ + @Override public String getLine(int line, int offset) { Field59 cp = newInstance(this); return getLine(cp, line, null, offset); @@ -697,6 +694,7 @@ public String getLine(int line, int offset) { * @return lines content or empty list if field's value is empty * @since 7.7 */ + @Override public List getLines() { return SwiftParseUtils.getLines(getValue()); } @@ -709,6 +707,7 @@ public List getLines() { * @return found lines or empty list if lines are not present or the offset is invalid * @since 7.7 */ + @Override public List getLines(int offset) { Field59 cp = newInstance(this); return SwiftParseUtils.getLines(getLine(cp, null, null, offset)); @@ -723,6 +722,7 @@ public List getLines(int offset) { * @return found lines or empty list if value is empty * @since 7.7 */ + @Override public List getLinesBetween(int start, int end) { return getLinesBetween(start, end, 0); } @@ -737,6 +737,7 @@ public List getLinesBetween(int start, int end) { * @return found lines or empty list if lines are not present or the offset is invalid * @since 7.7 */ + @Override public List getLinesBetween(int start, int end, int offset) { Field59 cp = newInstance(this); return SwiftParseUtils.getLines(getLine(cp, start, end, offset)); diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field59A.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field59A.java index 3221ffe0b..6c515c814 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field59A.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field59A.java @@ -33,12 +33,9 @@ import com.prowidesoftware.swift.model.field.BICContainer; import com.prowidesoftware.swift.model.field.BICResolver; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -212,16 +209,14 @@ public String getValueDisplay(int component, Locale locale) { //default format (as is) return getComponent(1); } - if (component == 2) { - //default format (as is) - return getComponent(2); - } - return null; + // This is the last component, return directly without `if` + //default format (as is) + return getComponent(2); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -455,10 +450,12 @@ public Field59A setIdentifierCode(com.prowidesoftware.swift.model.BIC component2 } + @Override public List bics() { return BICResolver.bics(this); } + @Override public List bicStrings () { return BICResolver.bicStrings(this); } @@ -527,7 +524,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field59A(f)); } @@ -543,6 +540,7 @@ public static List getAll(final SwiftTagListBlock block) { * @return line content or null if not present or if line number is above the expected * @since 7.7 */ + @Override public String getLine(int line) { return getLine(line, 0); } @@ -556,6 +554,7 @@ public String getLine(int line) { * @return line content or null if not present or if line number is above the expected * @since 7.7 */ + @Override public String getLine(int line, int offset) { Field59A cp = newInstance(this); return getLine(cp, line, null, offset); @@ -568,6 +567,7 @@ public String getLine(int line, int offset) { * @return lines content or empty list if field's value is empty * @since 7.7 */ + @Override public List getLines() { return SwiftParseUtils.getLines(getValue()); } @@ -580,6 +580,7 @@ public List getLines() { * @return found lines or empty list if lines are not present or the offset is invalid * @since 7.7 */ + @Override public List getLines(int offset) { Field59A cp = newInstance(this); return SwiftParseUtils.getLines(getLine(cp, null, null, offset)); @@ -594,6 +595,7 @@ public List getLines(int offset) { * @return found lines or empty list if value is empty * @since 7.7 */ + @Override public List getLinesBetween(int start, int end) { return getLinesBetween(start, end, 0); } @@ -608,6 +610,7 @@ public List getLinesBetween(int start, int end) { * @return found lines or empty list if lines are not present or the offset is invalid * @since 7.7 */ + @Override public List getLinesBetween(int start, int end, int offset) { Field59A cp = newInstance(this); return SwiftParseUtils.getLines(getLine(cp, start, end, offset)); diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field59F.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field59F.java index 3e8251e8d..073a93697 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field59F.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field59F.java @@ -32,12 +32,9 @@ import com.prowidesoftware.swift.model.field.MultiLineField; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -291,16 +288,14 @@ public String getValueDisplay(int component, Locale locale) { //default format (as is) return getComponent(8); } - if (component == 9) { - //default format (as is) - return getComponent(9); - } - return null; + // This is the last component, return directly without `if` + //default format (as is) + return getComponent(9); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -707,32 +702,14 @@ public Field59F setComponent2(String component2) { return this; } - /** - * Set the component2 from a Long object. - *
- * If the component being set is a fixed length number, the argument will not be - * padded. It is recommended for these cases to use the setComponent2(String) - * method. - * - * @see #setComponent2(String) - * @since 9.2.7 - * - * @param component2 the Long with the Number 1 content to set - * @return the field object to enable build pattern - */ - public Field59F setComponent2(java.lang.Long component2) { - setComponent(2, SwiftFormatUtils.getLong(component2)); - return this; - } /** * Alternative method setter for field's Number 1 (component 2) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10 becomes an Integer) * * @param component2 the Number with the Number 1 content to set * @return the field object to enable build pattern - * @see #setNumber1(java.lang.Long) */ public Field59F setComponent2(java.lang.Number component2) { @@ -762,27 +739,13 @@ public Field59F setNumber1(String component2) { return setComponent2(component2); } - /** - * Set the Number 1 (component 2) from a Long object. - * - * @see #setComponent2(java.lang.Long) - * - * @param component2 Long with the Number 1 content to set - * @return the field object to enable build pattern - * @since 9.2.7 - */ - public Field59F setNumber1(java.lang.Long component2) { - return setComponent2(component2); - } - /** * Alternative method setter for field's Number 1 (component 2) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10 becomes an Integer) * * @param component2 the Number with the Number 1 content to set * @return the field object to enable build pattern - * @see #setNumber1(java.lang.Long) */ public Field59F setNumber1(java.lang.Number component2) { return setComponent2(component2); @@ -820,32 +783,14 @@ public Field59F setComponent4(String component4) { return this; } - /** - * Set the component4 from a Long object. - *
- * If the component being set is a fixed length number, the argument will not be - * padded. It is recommended for these cases to use the setComponent4(String) - * method. - * - * @see #setComponent4(String) - * @since 9.2.7 - * - * @param component4 the Long with the Number 2 content to set - * @return the field object to enable build pattern - */ - public Field59F setComponent4(java.lang.Long component4) { - setComponent(4, SwiftFormatUtils.getLong(component4)); - return this; - } /** * Alternative method setter for field's Number 2 (component 4) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10 becomes an Integer) * * @param component4 the Number with the Number 2 content to set * @return the field object to enable build pattern - * @see #setNumber2(java.lang.Long) */ public Field59F setComponent4(java.lang.Number component4) { @@ -875,27 +820,13 @@ public Field59F setNumber2(String component4) { return setComponent4(component4); } - /** - * Set the Number 2 (component 4) from a Long object. - * - * @see #setComponent4(java.lang.Long) - * - * @param component4 Long with the Number 2 content to set - * @return the field object to enable build pattern - * @since 9.2.7 - */ - public Field59F setNumber2(java.lang.Long component4) { - return setComponent4(component4); - } - /** * Alternative method setter for field's Number 2 (component 4) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10 becomes an Integer) * * @param component4 the Number with the Number 2 content to set * @return the field object to enable build pattern - * @see #setNumber2(java.lang.Long) */ public Field59F setNumber2(java.lang.Number component4) { return setComponent4(component4); @@ -933,32 +864,14 @@ public Field59F setComponent6(String component6) { return this; } - /** - * Set the component6 from a Long object. - *
- * If the component being set is a fixed length number, the argument will not be - * padded. It is recommended for these cases to use the setComponent6(String) - * method. - * - * @see #setComponent6(String) - * @since 9.2.7 - * - * @param component6 the Long with the Number 3 content to set - * @return the field object to enable build pattern - */ - public Field59F setComponent6(java.lang.Long component6) { - setComponent(6, SwiftFormatUtils.getLong(component6)); - return this; - } /** * Alternative method setter for field's Number 3 (component 6) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10 becomes an Integer) * * @param component6 the Number with the Number 3 content to set * @return the field object to enable build pattern - * @see #setNumber3(java.lang.Long) */ public Field59F setComponent6(java.lang.Number component6) { @@ -988,27 +901,13 @@ public Field59F setNumber3(String component6) { return setComponent6(component6); } - /** - * Set the Number 3 (component 6) from a Long object. - * - * @see #setComponent6(java.lang.Long) - * - * @param component6 Long with the Number 3 content to set - * @return the field object to enable build pattern - * @since 9.2.7 - */ - public Field59F setNumber3(java.lang.Long component6) { - return setComponent6(component6); - } - /** * Alternative method setter for field's Number 3 (component 6) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10 becomes an Integer) * * @param component6 the Number with the Number 3 content to set * @return the field object to enable build pattern - * @see #setNumber3(java.lang.Long) */ public Field59F setNumber3(java.lang.Number component6) { return setComponent6(component6); @@ -1046,32 +945,14 @@ public Field59F setComponent8(String component8) { return this; } - /** - * Set the component8 from a Long object. - *
- * If the component being set is a fixed length number, the argument will not be - * padded. It is recommended for these cases to use the setComponent8(String) - * method. - * - * @see #setComponent8(String) - * @since 9.2.7 - * - * @param component8 the Long with the Number 4 content to set - * @return the field object to enable build pattern - */ - public Field59F setComponent8(java.lang.Long component8) { - setComponent(8, SwiftFormatUtils.getLong(component8)); - return this; - } /** * Alternative method setter for field's Number 4 (component 8) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10 becomes an Integer) * * @param component8 the Number with the Number 4 content to set * @return the field object to enable build pattern - * @see #setNumber4(java.lang.Long) */ public Field59F setComponent8(java.lang.Number component8) { @@ -1101,27 +982,13 @@ public Field59F setNumber4(String component8) { return setComponent8(component8); } - /** - * Set the Number 4 (component 8) from a Long object. - * - * @see #setComponent8(java.lang.Long) - * - * @param component8 Long with the Number 4 content to set - * @return the field object to enable build pattern - * @since 9.2.7 - */ - public Field59F setNumber4(java.lang.Long component8) { - return setComponent8(component8); - } - /** * Alternative method setter for field's Number 4 (component 8) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10 becomes an Integer) * * @param component8 the Number with the Number 4 content to set * @return the field object to enable build pattern - * @see #setNumber4(java.lang.Long) */ public Field59F setNumber4(java.lang.Number component8) { return setComponent8(component8); @@ -1213,7 +1080,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field59F(f)); } @@ -1229,6 +1096,7 @@ public static List getAll(final SwiftTagListBlock block) { * @return line content or null if not present or if line number is above the expected * @since 7.7 */ + @Override public String getLine(int line) { return getLine(line, 0); } @@ -1242,6 +1110,7 @@ public String getLine(int line) { * @return line content or null if not present or if line number is above the expected * @since 7.7 */ + @Override public String getLine(int line, int offset) { Field59F cp = newInstance(this); return getLine(cp, line, null, offset); @@ -1254,6 +1123,7 @@ public String getLine(int line, int offset) { * @return lines content or empty list if field's value is empty * @since 7.7 */ + @Override public List getLines() { return SwiftParseUtils.getLines(getValue()); } @@ -1266,6 +1136,7 @@ public List getLines() { * @return found lines or empty list if lines are not present or the offset is invalid * @since 7.7 */ + @Override public List getLines(int offset) { Field59F cp = newInstance(this); return SwiftParseUtils.getLines(getLine(cp, null, null, offset)); @@ -1280,6 +1151,7 @@ public List getLines(int offset) { * @return found lines or empty list if value is empty * @since 7.7 */ + @Override public List getLinesBetween(int start, int end) { return getLinesBetween(start, end, 0); } @@ -1294,6 +1166,7 @@ public List getLinesBetween(int start, int end) { * @return found lines or empty list if lines are not present or the offset is invalid * @since 7.7 */ + @Override public List getLinesBetween(int start, int end, int offset) { Field59F cp = newInstance(this); return SwiftParseUtils.getLines(getLine(cp, start, end, offset)); @@ -1435,14 +1308,18 @@ public String getComponentLabel(final int number) { */ public String getLabelForLineNumber(String lineIdentifier) { if (StringUtils.isNumeric(StringUtils.trimToNull(lineIdentifier))) { - int number = Integer.valueOf(lineIdentifier.trim()); - if (number == 1) { - return "Name of Beneficiary Customer"; - } else if (number == 2) { - return "Address Line"; - } else if (number == 3) { - return "Country and Town"; - } + try { + int number = Integer.valueOf(lineIdentifier.trim()); + if (number == 1) { + return "Name of Beneficiary Customer"; + } else if (number == 2) { + return "Address Line"; + } else if (number == 3) { + return "Country and Town"; + } + } catch (NumberFormatException e) { + // ignore + } } return null; } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field60F.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field60F.java index 94ef1cbfb..7caca5f4c 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field60F.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field60F.java @@ -37,12 +37,9 @@ import com.prowidesoftware.swift.model.field.DateContainer; import com.prowidesoftware.swift.model.field.DateResolver; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -239,21 +236,20 @@ public String getValueDisplay(int component, Locale locale) { //default format (as is) return getComponent(3); } - if (component == 4) { - //amount, rate - java.text.NumberFormat f = java.text.NumberFormat.getNumberInstance(notNull(locale)); - f.setMaximumFractionDigits(13); - BigDecimal n = getComponent4AsBigDecimal(); - if (n != null) { - return f.format(n); - } + // This is the last component, return directly without `if` + //amount, rate + java.text.NumberFormat f = java.text.NumberFormat.getNumberInstance(notNull(locale)); + f.setMaximumFractionDigits(13); + BigDecimal n = getComponent4AsBigDecimal(); + if (n != null) { + return f.format(n); } return null; } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -625,32 +621,13 @@ public Field60F setComponent4(String component4) { return this; } - /** - * Set the component4 from a BigDecimal object. - *
- * Parses the BigDecimal into a SWIFT amount with truncated zero decimals and mandatory decimal separator. - *

- * @since 9.2.7 - * - * @param component4 the BigDecimal with the Amount content to set - * @return the field object to enable build pattern - */ - public Field60F setComponent4(java.math.BigDecimal component4) { - setComponent(4, SwiftFormatUtils.getBigDecimal(component4)); - return this; - } /** * Alternative method setter for field's Amount (component 4) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10.0 becomes an Float) * * @param component4 the Number with the Amount content to set * @return the field object to enable build pattern - * @see #setAmount(java.math.BigDecimal) */ public Field60F setComponent4(java.lang.Number component4) { @@ -682,53 +659,45 @@ public Field60F setAmount(String component4) { return setComponent4(component4); } - /** - * Set the Amount (component 4) from a BigDecimal object. - * - * @see #setComponent4(java.math.BigDecimal) - * - * @param component4 BigDecimal with the Amount content to set - * @return the field object to enable build pattern - * @since 9.2.7 - */ - public Field60F setAmount(java.math.BigDecimal component4) { - return setComponent4(component4); - } - /** * Alternative method setter for field's Amount (component 4) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10 becomes an Integer) * * @param component4 the Number with the Amount content to set * @return the field object to enable build pattern - * @see #setAmount(java.math.BigDecimal) */ public Field60F setAmount(java.lang.Number component4) { return setComponent4(component4); } + @Override public List currencyStrings() { return MonetaryAmountResolver.currencyStrings(this); } + @Override public List currencies() { return MonetaryAmountResolver.currencies(this); } + @Override public Currency currency() { return MonetaryAmountResolver.resolveCurrency(this); } + @Override public String currencyString() { return MonetaryAmountResolver.resolveCurrencyString(this); } + @Override public void initializeCurrencies(String cur) { MonetaryAmountResolver.resolveSetCurrency(this, cur); } + @Override public void initializeCurrencies(Currency cur) { MonetaryAmountResolver.resolveSetCurrency(this, cur); } @@ -749,6 +718,7 @@ public List amounts() { * @return the first amount as BigDecimal value. Can be null * @see MonetaryAmountResolver#amount(Field) */ + @Override public BigDecimal amount() { return MonetaryAmountResolver.amount(this); } @@ -758,6 +728,7 @@ public BigDecimal amount() { * * @return the list of converted components (a Calendar object or null) */ + @Override public List dates() { return DateResolver.dates(this); } @@ -835,7 +806,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field60F(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field60M.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field60M.java index 61030b164..f6bc5244c 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field60M.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field60M.java @@ -37,12 +37,9 @@ import com.prowidesoftware.swift.model.field.DateContainer; import com.prowidesoftware.swift.model.field.DateResolver; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -239,21 +236,20 @@ public String getValueDisplay(int component, Locale locale) { //default format (as is) return getComponent(3); } - if (component == 4) { - //amount, rate - java.text.NumberFormat f = java.text.NumberFormat.getNumberInstance(notNull(locale)); - f.setMaximumFractionDigits(13); - BigDecimal n = getComponent4AsBigDecimal(); - if (n != null) { - return f.format(n); - } + // This is the last component, return directly without `if` + //amount, rate + java.text.NumberFormat f = java.text.NumberFormat.getNumberInstance(notNull(locale)); + f.setMaximumFractionDigits(13); + BigDecimal n = getComponent4AsBigDecimal(); + if (n != null) { + return f.format(n); } return null; } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -625,32 +621,13 @@ public Field60M setComponent4(String component4) { return this; } - /** - * Set the component4 from a BigDecimal object. - *
- * Parses the BigDecimal into a SWIFT amount with truncated zero decimals and mandatory decimal separator. - *

- * @since 9.2.7 - * - * @param component4 the BigDecimal with the Amount content to set - * @return the field object to enable build pattern - */ - public Field60M setComponent4(java.math.BigDecimal component4) { - setComponent(4, SwiftFormatUtils.getBigDecimal(component4)); - return this; - } /** * Alternative method setter for field's Amount (component 4) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10.0 becomes an Float) * * @param component4 the Number with the Amount content to set * @return the field object to enable build pattern - * @see #setAmount(java.math.BigDecimal) */ public Field60M setComponent4(java.lang.Number component4) { @@ -682,53 +659,45 @@ public Field60M setAmount(String component4) { return setComponent4(component4); } - /** - * Set the Amount (component 4) from a BigDecimal object. - * - * @see #setComponent4(java.math.BigDecimal) - * - * @param component4 BigDecimal with the Amount content to set - * @return the field object to enable build pattern - * @since 9.2.7 - */ - public Field60M setAmount(java.math.BigDecimal component4) { - return setComponent4(component4); - } - /** * Alternative method setter for field's Amount (component 4) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10 becomes an Integer) * * @param component4 the Number with the Amount content to set * @return the field object to enable build pattern - * @see #setAmount(java.math.BigDecimal) */ public Field60M setAmount(java.lang.Number component4) { return setComponent4(component4); } + @Override public List currencyStrings() { return MonetaryAmountResolver.currencyStrings(this); } + @Override public List currencies() { return MonetaryAmountResolver.currencies(this); } + @Override public Currency currency() { return MonetaryAmountResolver.resolveCurrency(this); } + @Override public String currencyString() { return MonetaryAmountResolver.resolveCurrencyString(this); } + @Override public void initializeCurrencies(String cur) { MonetaryAmountResolver.resolveSetCurrency(this, cur); } + @Override public void initializeCurrencies(Currency cur) { MonetaryAmountResolver.resolveSetCurrency(this, cur); } @@ -749,6 +718,7 @@ public List amounts() { * @return the first amount as BigDecimal value. Can be null * @see MonetaryAmountResolver#amount(Field) */ + @Override public BigDecimal amount() { return MonetaryAmountResolver.amount(this); } @@ -758,6 +728,7 @@ public BigDecimal amount() { * * @return the list of converted components (a Calendar object or null) */ + @Override public List dates() { return DateResolver.dates(this); } @@ -835,7 +806,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field60M(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field61.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field61.java index 9030973fa..37e5c085e 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field61.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field61.java @@ -37,12 +37,9 @@ import com.prowidesoftware.swift.model.field.DateContainer; import com.prowidesoftware.swift.model.field.DateResolver; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -321,16 +318,14 @@ public String getValueDisplay(int component, Locale locale) { //default format (as is) return getComponent(9); } - if (component == 10) { - //default format (as is) - return getComponent(10); - } - return null; + // This is the last component, return directly without `if` + //default format (as is) + return getComponent(10); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -852,32 +847,13 @@ public Field61 setComponent5(String component5) { return this; } - /** - * Set the component5 from a BigDecimal object. - *
- * Parses the BigDecimal into a SWIFT amount with truncated zero decimals and mandatory decimal separator. - *

- * @since 9.2.7 - * - * @param component5 the BigDecimal with the Amount content to set - * @return the field object to enable build pattern - */ - public Field61 setComponent5(java.math.BigDecimal component5) { - setComponent(5, SwiftFormatUtils.getBigDecimal(component5)); - return this; - } /** * Alternative method setter for field's Amount (component 5) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10.0 becomes an Float) * * @param component5 the Number with the Amount content to set * @return the field object to enable build pattern - * @see #setAmount(java.math.BigDecimal) */ public Field61 setComponent5(java.lang.Number component5) { @@ -909,27 +885,13 @@ public Field61 setAmount(String component5) { return setComponent5(component5); } - /** - * Set the Amount (component 5) from a BigDecimal object. - * - * @see #setComponent5(java.math.BigDecimal) - * - * @param component5 BigDecimal with the Amount content to set - * @return the field object to enable build pattern - * @since 9.2.7 - */ - public Field61 setAmount(java.math.BigDecimal component5) { - return setComponent5(component5); - } - /** * Alternative method setter for field's Amount (component 5) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10 becomes an Integer) * * @param component5 the Number with the Amount content to set * @return the field object to enable build pattern - * @see #setAmount(java.math.BigDecimal) */ public Field61 setAmount(java.lang.Number component5) { return setComponent5(component5); @@ -1057,6 +1019,7 @@ public List amounts() { * @return the first amount as BigDecimal value. Can be null * @see AmountResolver#amount(Field) */ + @Override public BigDecimal amount() { return AmountResolver.amount(this); } @@ -1067,6 +1030,7 @@ public BigDecimal amount() { * @return the list of converted components (a Calendar object or null) * @since 9.2.7 */ + @Override public List dates() { return DateResolver.dates(this); } @@ -1145,7 +1109,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field61(f)); } @@ -1161,6 +1125,7 @@ public static List getAll(final SwiftTagListBlock block) { * @return line content or null if not present or if line number is above the expected * @since 7.7 */ + @Override public String getLine(int line) { return getLine(line, 0); } @@ -1174,6 +1139,7 @@ public String getLine(int line) { * @return line content or null if not present or if line number is above the expected * @since 7.7 */ + @Override public String getLine(int line, int offset) { Field61 cp = newInstance(this); return getLine(cp, line, null, offset); @@ -1186,6 +1152,7 @@ public String getLine(int line, int offset) { * @return lines content or empty list if field's value is empty * @since 7.7 */ + @Override public List getLines() { return SwiftParseUtils.getLines(getValue()); } @@ -1198,6 +1165,7 @@ public List getLines() { * @return found lines or empty list if lines are not present or the offset is invalid * @since 7.7 */ + @Override public List getLines(int offset) { Field61 cp = newInstance(this); return SwiftParseUtils.getLines(getLine(cp, null, null, offset)); @@ -1212,6 +1180,7 @@ public List getLines(int offset) { * @return found lines or empty list if value is empty * @since 7.7 */ + @Override public List getLinesBetween(int start, int end) { return getLinesBetween(start, end, 0); } @@ -1226,6 +1195,7 @@ public List getLinesBetween(int start, int end) { * @return found lines or empty list if lines are not present or the offset is invalid * @since 7.7 */ + @Override public List getLinesBetween(int start, int end, int offset) { Field61 cp = newInstance(this); return SwiftParseUtils.getLines(getLine(cp, start, end, offset)); diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field619.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field619.java index 5fa5abe6c..375cc7fb6 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field619.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field619.java @@ -29,12 +29,9 @@ -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -183,19 +180,16 @@ public String getValue() { */ @Override public String getValueDisplay(int component, Locale locale) { - if (component < 1 || component > 1) { + if (component != 1) { throw new IllegalArgumentException("invalid component number " + component + " for field 619"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -398,7 +392,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field619(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field62F.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field62F.java index 4892a5405..bd7510d7f 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field62F.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field62F.java @@ -36,12 +36,9 @@ import com.prowidesoftware.swift.model.field.DateContainer; import com.prowidesoftware.swift.model.field.DateResolver; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -238,21 +235,20 @@ public String getValueDisplay(int component, Locale locale) { //default format (as is) return getComponent(3); } - if (component == 4) { - //amount, rate - java.text.NumberFormat f = java.text.NumberFormat.getNumberInstance(notNull(locale)); - f.setMaximumFractionDigits(13); - BigDecimal n = getComponent4AsBigDecimal(); - if (n != null) { - return f.format(n); - } + // This is the last component, return directly without `if` + //amount, rate + java.text.NumberFormat f = java.text.NumberFormat.getNumberInstance(notNull(locale)); + f.setMaximumFractionDigits(13); + BigDecimal n = getComponent4AsBigDecimal(); + if (n != null) { + return f.format(n); } return null; } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -573,32 +569,13 @@ public Field62F setComponent4(String component4) { return this; } - /** - * Set the component4 from a BigDecimal object. - *
- * Parses the BigDecimal into a SWIFT amount with truncated zero decimals and mandatory decimal separator. - *

- * @since 9.2.7 - * - * @param component4 the BigDecimal with the Amount content to set - * @return the field object to enable build pattern - */ - public Field62F setComponent4(java.math.BigDecimal component4) { - setComponent(4, SwiftFormatUtils.getBigDecimal(component4)); - return this; - } /** * Alternative method setter for field's Amount (component 4) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10.0 becomes an Float) * * @param component4 the Number with the Amount content to set * @return the field object to enable build pattern - * @see #setAmount(java.math.BigDecimal) */ public Field62F setComponent4(java.lang.Number component4) { @@ -630,27 +607,13 @@ public Field62F setAmount(String component4) { return setComponent4(component4); } - /** - * Set the Amount (component 4) from a BigDecimal object. - * - * @see #setComponent4(java.math.BigDecimal) - * - * @param component4 BigDecimal with the Amount content to set - * @return the field object to enable build pattern - * @since 9.2.7 - */ - public Field62F setAmount(java.math.BigDecimal component4) { - return setComponent4(component4); - } - /** * Alternative method setter for field's Amount (component 4) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10 becomes an Integer) * * @param component4 the Number with the Amount content to set * @return the field object to enable build pattern - * @see #setAmount(java.math.BigDecimal) */ public Field62F setAmount(java.lang.Number component4) { return setComponent4(component4); @@ -673,6 +636,7 @@ public List amounts() { * @return the first amount as BigDecimal value. Can be null * @see AmountResolver#amount(Field) */ + @Override public BigDecimal amount() { return AmountResolver.amount(this); } @@ -682,6 +646,7 @@ public BigDecimal amount() { * * @return the list of converted components (a Calendar object or null) */ + @Override public List dates() { return DateResolver.dates(this); } @@ -759,7 +724,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field62F(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field62M.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field62M.java index c8e10cb3f..1981bb411 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field62M.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field62M.java @@ -36,12 +36,9 @@ import com.prowidesoftware.swift.model.field.DateContainer; import com.prowidesoftware.swift.model.field.DateResolver; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -238,21 +235,20 @@ public String getValueDisplay(int component, Locale locale) { //default format (as is) return getComponent(3); } - if (component == 4) { - //amount, rate - java.text.NumberFormat f = java.text.NumberFormat.getNumberInstance(notNull(locale)); - f.setMaximumFractionDigits(13); - BigDecimal n = getComponent4AsBigDecimal(); - if (n != null) { - return f.format(n); - } + // This is the last component, return directly without `if` + //amount, rate + java.text.NumberFormat f = java.text.NumberFormat.getNumberInstance(notNull(locale)); + f.setMaximumFractionDigits(13); + BigDecimal n = getComponent4AsBigDecimal(); + if (n != null) { + return f.format(n); } return null; } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -573,32 +569,13 @@ public Field62M setComponent4(String component4) { return this; } - /** - * Set the component4 from a BigDecimal object. - *
- * Parses the BigDecimal into a SWIFT amount with truncated zero decimals and mandatory decimal separator. - *

- * @since 9.2.7 - * - * @param component4 the BigDecimal with the Amount content to set - * @return the field object to enable build pattern - */ - public Field62M setComponent4(java.math.BigDecimal component4) { - setComponent(4, SwiftFormatUtils.getBigDecimal(component4)); - return this; - } /** * Alternative method setter for field's Amount (component 4) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10.0 becomes an Float) * * @param component4 the Number with the Amount content to set * @return the field object to enable build pattern - * @see #setAmount(java.math.BigDecimal) */ public Field62M setComponent4(java.lang.Number component4) { @@ -630,27 +607,13 @@ public Field62M setAmount(String component4) { return setComponent4(component4); } - /** - * Set the Amount (component 4) from a BigDecimal object. - * - * @see #setComponent4(java.math.BigDecimal) - * - * @param component4 BigDecimal with the Amount content to set - * @return the field object to enable build pattern - * @since 9.2.7 - */ - public Field62M setAmount(java.math.BigDecimal component4) { - return setComponent4(component4); - } - /** * Alternative method setter for field's Amount (component 4) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10 becomes an Integer) * * @param component4 the Number with the Amount content to set * @return the field object to enable build pattern - * @see #setAmount(java.math.BigDecimal) */ public Field62M setAmount(java.lang.Number component4) { return setComponent4(component4); @@ -673,6 +636,7 @@ public List amounts() { * @return the first amount as BigDecimal value. Can be null * @see AmountResolver#amount(Field) */ + @Override public BigDecimal amount() { return AmountResolver.amount(this); } @@ -682,6 +646,7 @@ public BigDecimal amount() { * * @return the list of converted components (a Calendar object or null) */ + @Override public List dates() { return DateResolver.dates(this); } @@ -759,7 +724,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field62M(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field64.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field64.java index c35934c96..e4b23c293 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field64.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field64.java @@ -36,12 +36,9 @@ import com.prowidesoftware.swift.model.field.DateContainer; import com.prowidesoftware.swift.model.field.DateResolver; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -238,21 +235,20 @@ public String getValueDisplay(int component, Locale locale) { //default format (as is) return getComponent(3); } - if (component == 4) { - //amount, rate - java.text.NumberFormat f = java.text.NumberFormat.getNumberInstance(notNull(locale)); - f.setMaximumFractionDigits(13); - BigDecimal n = getComponent4AsBigDecimal(); - if (n != null) { - return f.format(n); - } + // This is the last component, return directly without `if` + //amount, rate + java.text.NumberFormat f = java.text.NumberFormat.getNumberInstance(notNull(locale)); + f.setMaximumFractionDigits(13); + BigDecimal n = getComponent4AsBigDecimal(); + if (n != null) { + return f.format(n); } return null; } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -573,32 +569,13 @@ public Field64 setComponent4(String component4) { return this; } - /** - * Set the component4 from a BigDecimal object. - *
- * Parses the BigDecimal into a SWIFT amount with truncated zero decimals and mandatory decimal separator. - *

- * @since 9.2.7 - * - * @param component4 the BigDecimal with the Amount content to set - * @return the field object to enable build pattern - */ - public Field64 setComponent4(java.math.BigDecimal component4) { - setComponent(4, SwiftFormatUtils.getBigDecimal(component4)); - return this; - } /** * Alternative method setter for field's Amount (component 4) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10.0 becomes an Float) * * @param component4 the Number with the Amount content to set * @return the field object to enable build pattern - * @see #setAmount(java.math.BigDecimal) */ public Field64 setComponent4(java.lang.Number component4) { @@ -630,27 +607,13 @@ public Field64 setAmount(String component4) { return setComponent4(component4); } - /** - * Set the Amount (component 4) from a BigDecimal object. - * - * @see #setComponent4(java.math.BigDecimal) - * - * @param component4 BigDecimal with the Amount content to set - * @return the field object to enable build pattern - * @since 9.2.7 - */ - public Field64 setAmount(java.math.BigDecimal component4) { - return setComponent4(component4); - } - /** * Alternative method setter for field's Amount (component 4) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10 becomes an Integer) * * @param component4 the Number with the Amount content to set * @return the field object to enable build pattern - * @see #setAmount(java.math.BigDecimal) */ public Field64 setAmount(java.lang.Number component4) { return setComponent4(component4); @@ -673,6 +636,7 @@ public List amounts() { * @return the first amount as BigDecimal value. Can be null * @see AmountResolver#amount(Field) */ + @Override public BigDecimal amount() { return AmountResolver.amount(this); } @@ -682,6 +646,7 @@ public BigDecimal amount() { * * @return the list of converted components (a Calendar object or null) */ + @Override public List dates() { return DateResolver.dates(this); } @@ -759,7 +724,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field64(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field65.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field65.java index 687720ee1..9b3428bb9 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field65.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field65.java @@ -36,12 +36,9 @@ import com.prowidesoftware.swift.model.field.DateContainer; import com.prowidesoftware.swift.model.field.DateResolver; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -238,21 +235,20 @@ public String getValueDisplay(int component, Locale locale) { //default format (as is) return getComponent(3); } - if (component == 4) { - //amount, rate - java.text.NumberFormat f = java.text.NumberFormat.getNumberInstance(notNull(locale)); - f.setMaximumFractionDigits(13); - BigDecimal n = getComponent4AsBigDecimal(); - if (n != null) { - return f.format(n); - } + // This is the last component, return directly without `if` + //amount, rate + java.text.NumberFormat f = java.text.NumberFormat.getNumberInstance(notNull(locale)); + f.setMaximumFractionDigits(13); + BigDecimal n = getComponent4AsBigDecimal(); + if (n != null) { + return f.format(n); } return null; } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -573,32 +569,13 @@ public Field65 setComponent4(String component4) { return this; } - /** - * Set the component4 from a BigDecimal object. - *
- * Parses the BigDecimal into a SWIFT amount with truncated zero decimals and mandatory decimal separator. - *

- * @since 9.2.7 - * - * @param component4 the BigDecimal with the Amount content to set - * @return the field object to enable build pattern - */ - public Field65 setComponent4(java.math.BigDecimal component4) { - setComponent(4, SwiftFormatUtils.getBigDecimal(component4)); - return this; - } /** * Alternative method setter for field's Amount (component 4) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10.0 becomes an Float) * * @param component4 the Number with the Amount content to set * @return the field object to enable build pattern - * @see #setAmount(java.math.BigDecimal) */ public Field65 setComponent4(java.lang.Number component4) { @@ -630,27 +607,13 @@ public Field65 setAmount(String component4) { return setComponent4(component4); } - /** - * Set the Amount (component 4) from a BigDecimal object. - * - * @see #setComponent4(java.math.BigDecimal) - * - * @param component4 BigDecimal with the Amount content to set - * @return the field object to enable build pattern - * @since 9.2.7 - */ - public Field65 setAmount(java.math.BigDecimal component4) { - return setComponent4(component4); - } - /** * Alternative method setter for field's Amount (component 4) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10 becomes an Integer) * * @param component4 the Number with the Amount content to set * @return the field object to enable build pattern - * @see #setAmount(java.math.BigDecimal) */ public Field65 setAmount(java.lang.Number component4) { return setComponent4(component4); @@ -673,6 +636,7 @@ public List amounts() { * @return the first amount as BigDecimal value. Can be null * @see AmountResolver#amount(Field) */ + @Override public BigDecimal amount() { return AmountResolver.amount(this); } @@ -682,6 +646,7 @@ public BigDecimal amount() { * * @return the list of converted components (a Calendar object or null) */ + @Override public List dates() { return DateResolver.dates(this); } @@ -759,7 +724,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field65(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field68A.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field68A.java index 43e56e1fd..616b2f42a 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field68A.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field68A.java @@ -34,12 +34,9 @@ import com.prowidesoftware.swift.model.field.MonetaryAmountContainer; import com.prowidesoftware.swift.model.field.MonetaryAmountResolver; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -264,16 +261,14 @@ public String getValueDisplay(int component, Locale locale) { return f.format(n); } } - if (component == 6) { - //default format (as is) - return getComponent(6); - } - return null; + // This is the last component, return directly without `if` + //default format (as is) + return getComponent(6); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -595,32 +590,14 @@ public Field68A setComponent1(String component1) { return this; } - /** - * Set the component1 from a Long object. - *
- * If the component being set is a fixed length number, the argument will not be - * padded. It is recommended for these cases to use the setComponent1(String) - * method. - * - * @see #setComponent1(String) - * @since 9.2.7 - * - * @param component1 the Long with the Number content to set - * @return the field object to enable build pattern - */ - public Field68A setComponent1(java.lang.Long component1) { - setComponent(1, SwiftFormatUtils.getLong(component1)); - return this; - } /** * Alternative method setter for field's Number (component 1) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10 becomes an Integer) * * @param component1 the Number with the Number content to set * @return the field object to enable build pattern - * @see #setNumber(java.lang.Long) */ public Field68A setComponent1(java.lang.Number component1) { @@ -650,27 +627,13 @@ public Field68A setNumber(String component1) { return setComponent1(component1); } - /** - * Set the Number (component 1) from a Long object. - * - * @see #setComponent1(java.lang.Long) - * - * @param component1 Long with the Number content to set - * @return the field object to enable build pattern - * @since 9.2.7 - */ - public Field68A setNumber(java.lang.Long component1) { - return setComponent1(component1); - } - /** * Alternative method setter for field's Number (component 1) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10 becomes an Integer) * * @param component1 the Number with the Number content to set * @return the field object to enable build pattern - * @see #setNumber(java.lang.Long) */ public Field68A setNumber(java.lang.Number component1) { return setComponent1(component1); @@ -731,32 +694,14 @@ public Field68A setComponent3(String component3) { return this; } - /** - * Set the component3 from a Long object. - *
- * If the component being set is a fixed length number, the argument will not be - * padded. It is recommended for these cases to use the setComponent3(String) - * method. - * - * @see #setComponent3(String) - * @since 9.2.7 - * - * @param component3 the Long with the Denomination content to set - * @return the field object to enable build pattern - */ - public Field68A setComponent3(java.lang.Long component3) { - setComponent(3, SwiftFormatUtils.getLong(component3)); - return this; - } /** * Alternative method setter for field's Denomination (component 3) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10 becomes an Integer) * * @param component3 the Number with the Denomination content to set * @return the field object to enable build pattern - * @see #setDenomination(java.lang.Long) */ public Field68A setComponent3(java.lang.Number component3) { @@ -786,27 +731,13 @@ public Field68A setDenomination(String component3) { return setComponent3(component3); } - /** - * Set the Denomination (component 3) from a Long object. - * - * @see #setComponent3(java.lang.Long) - * - * @param component3 Long with the Denomination content to set - * @return the field object to enable build pattern - * @since 9.2.7 - */ - public Field68A setDenomination(java.lang.Long component3) { - return setComponent3(component3); - } - /** * Alternative method setter for field's Denomination (component 3) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10 becomes an Integer) * * @param component3 the Number with the Denomination content to set * @return the field object to enable build pattern - * @see #setDenomination(java.lang.Long) */ public Field68A setDenomination(java.lang.Number component3) { return setComponent3(component3); @@ -823,32 +754,14 @@ public Field68A setComponent4(String component4) { return this; } - /** - * Set the component4 from a Long object. - *
- * If the component being set is a fixed length number, the argument will not be - * padded. It is recommended for these cases to use the setComponent4(String) - * method. - * - * @see #setComponent4(String) - * @since 9.2.7 - * - * @param component4 the Long with the Mode content to set - * @return the field object to enable build pattern - */ - public Field68A setComponent4(java.lang.Long component4) { - setComponent(4, SwiftFormatUtils.getLong(component4)); - return this; - } /** * Alternative method setter for field's Mode (component 4) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10 becomes an Integer) * * @param component4 the Number with the Mode content to set * @return the field object to enable build pattern - * @see #setMode(java.lang.Long) */ public Field68A setComponent4(java.lang.Number component4) { @@ -878,27 +791,13 @@ public Field68A setMode(String component4) { return setComponent4(component4); } - /** - * Set the Mode (component 4) from a Long object. - * - * @see #setComponent4(java.lang.Long) - * - * @param component4 Long with the Mode content to set - * @return the field object to enable build pattern - * @since 9.2.7 - */ - public Field68A setMode(java.lang.Long component4) { - return setComponent4(component4); - } - /** * Alternative method setter for field's Mode (component 4) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10 becomes an Integer) * * @param component4 the Number with the Mode content to set * @return the field object to enable build pattern - * @see #setMode(java.lang.Long) */ public Field68A setMode(java.lang.Number component4) { return setComponent4(component4); @@ -915,32 +814,13 @@ public Field68A setComponent5(String component5) { return this; } - /** - * Set the component5 from a BigDecimal object. - *
- * Parses the BigDecimal into a SWIFT amount with truncated zero decimals and mandatory decimal separator. - *

- * @since 9.2.7 - * - * @param component5 the BigDecimal with the Amount content to set - * @return the field object to enable build pattern - */ - public Field68A setComponent5(java.math.BigDecimal component5) { - setComponent(5, SwiftFormatUtils.getBigDecimal(component5)); - return this; - } /** * Alternative method setter for field's Amount (component 5) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10.0 becomes an Float) * * @param component5 the Number with the Amount content to set * @return the field object to enable build pattern - * @see #setAmount(java.math.BigDecimal) */ public Field68A setComponent5(java.lang.Number component5) { @@ -972,27 +852,13 @@ public Field68A setAmount(String component5) { return setComponent5(component5); } - /** - * Set the Amount (component 5) from a BigDecimal object. - * - * @see #setComponent5(java.math.BigDecimal) - * - * @param component5 BigDecimal with the Amount content to set - * @return the field object to enable build pattern - * @since 9.2.7 - */ - public Field68A setAmount(java.math.BigDecimal component5) { - return setComponent5(component5); - } - /** * Alternative method setter for field's Amount (component 5) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10 becomes an Integer) * * @param component5 the Number with the Amount content to set * @return the field object to enable build pattern - * @see #setAmount(java.math.BigDecimal) */ public Field68A setAmount(java.lang.Number component5) { return setComponent5(component5); @@ -1020,26 +886,32 @@ public Field68A setProductCode(String component6) { } + @Override public List currencyStrings() { return MonetaryAmountResolver.currencyStrings(this); } + @Override public List currencies() { return MonetaryAmountResolver.currencies(this); } + @Override public Currency currency() { return MonetaryAmountResolver.resolveCurrency(this); } + @Override public String currencyString() { return MonetaryAmountResolver.resolveCurrencyString(this); } + @Override public void initializeCurrencies(String cur) { MonetaryAmountResolver.resolveSetCurrency(this, cur); } + @Override public void initializeCurrencies(Currency cur) { MonetaryAmountResolver.resolveSetCurrency(this, cur); } @@ -1060,6 +932,7 @@ public List amounts() { * @return the first amount as BigDecimal value. Can be null * @see MonetaryAmountResolver#amount(Field) */ + @Override public BigDecimal amount() { return MonetaryAmountResolver.amount(this); } @@ -1128,7 +1001,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field68A(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field69A.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field69A.java index 261c417f7..88f7387db 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field69A.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field69A.java @@ -33,12 +33,9 @@ import com.prowidesoftware.swift.model.field.DateContainer; import com.prowidesoftware.swift.model.field.DateResolver; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -222,20 +219,19 @@ public String getValueDisplay(int component, Locale locale) { return f.format(cal.getTime()); } } - if (component == 3) { - //date: [YY]YYMMDD - java.text.DateFormat f = java.text.DateFormat.getDateInstance(java.text.DateFormat.DEFAULT, notNull(locale)); - java.util.Calendar cal = getComponent3AsCalendar(); - if (cal != null) { - return f.format(cal.getTime()); - } + // This is the last component, return directly without `if` + //date: [YY]YYMMDD + java.text.DateFormat f = java.text.DateFormat.getDateInstance(java.text.DateFormat.DEFAULT, notNull(locale)); + java.util.Calendar cal = getComponent3AsCalendar(); + if (cal != null) { + return f.format(cal.getTime()); } return null; } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -539,6 +535,7 @@ public Field69A setDate2(java.util.Calendar component3) { * * @return the list of converted components (a Calendar object or null) */ + @Override public List dates() { return DateResolver.dates(this); } @@ -559,6 +556,7 @@ public Calendar date() { * * @return DSS component value or null if the DSS is not set or not available for this field. */ + @Override public String getDSS() { return null; } @@ -569,6 +567,7 @@ public String getDSS() { * @see #getDSS() * @return true if DSS is present, false otherwise. */ + @Override public boolean isDSSPresent() { return false; } @@ -583,6 +582,7 @@ public boolean isDSSPresent() { * * @return for generic fields returns the value of the conditional qualifier or null if not set or not applicable for this field. */ + @Override public String getConditionalQualifier() { return getComponent(CONDITIONAL_QUALIFIER); } @@ -650,7 +650,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field69A(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field69B.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field69B.java index a678170e3..f5ccf113e 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field69B.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field69B.java @@ -33,12 +33,9 @@ import com.prowidesoftware.swift.model.field.DateContainer; import com.prowidesoftware.swift.model.field.DateResolver; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -272,20 +269,19 @@ public String getValueDisplay(int component, Locale locale) { return f.format(cal.getTime()); } } - if (component == 5) { - //time with seconds: HHmmss - java.text.DateFormat f = new java.text.SimpleDateFormat("HH:mm:ss", notNull(locale)); - java.util.Calendar cal = getComponent5AsCalendar(); - if (cal != null) { - return f.format(cal.getTime()); - } + // This is the last component, return directly without `if` + //time with seconds: HHmmss + java.text.DateFormat f = new java.text.SimpleDateFormat("HH:mm:ss", notNull(locale)); + java.util.Calendar cal = getComponent5AsCalendar(); + if (cal != null) { + return f.format(cal.getTime()); } return null; } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -761,6 +757,7 @@ public Field69B setTime2(java.util.Calendar component5) { * * @return the list of converted components (a Calendar object or null) */ + @Override public List dates() { return DateResolver.dates(this); } @@ -781,6 +778,7 @@ public Calendar date() { * * @return DSS component value or null if the DSS is not set or not available for this field. */ + @Override public String getDSS() { return null; } @@ -791,6 +789,7 @@ public String getDSS() { * @see #getDSS() * @return true if DSS is present, false otherwise. */ + @Override public boolean isDSSPresent() { return false; } @@ -805,6 +804,7 @@ public boolean isDSSPresent() { * * @return for generic fields returns the value of the conditional qualifier or null if not set or not applicable for this field. */ + @Override public String getConditionalQualifier() { return getComponent(CONDITIONAL_QUALIFIER); } @@ -872,7 +872,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field69B(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field69C.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field69C.java index 626946c52..7446b90f7 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field69C.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field69C.java @@ -33,12 +33,9 @@ import com.prowidesoftware.swift.model.field.DateContainer; import com.prowidesoftware.swift.model.field.DateResolver; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -222,16 +219,14 @@ public String getValueDisplay(int component, Locale locale) { return f.format(cal.getTime()); } } - if (component == 3) { - //default format (as is) - return getComponent(3); - } - return null; + // This is the last component, return directly without `if` + //default format (as is) + return getComponent(3); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -495,6 +490,7 @@ public Field69C setDateCode(String component3) { * * @return the list of converted components (a Calendar object or null) */ + @Override public List dates() { return DateResolver.dates(this); } @@ -515,6 +511,7 @@ public Calendar date() { * * @return DSS component value or null if the DSS is not set or not available for this field. */ + @Override public String getDSS() { return null; } @@ -525,6 +522,7 @@ public String getDSS() { * @see #getDSS() * @return true if DSS is present, false otherwise. */ + @Override public boolean isDSSPresent() { return false; } @@ -539,6 +537,7 @@ public boolean isDSSPresent() { * * @return for generic fields returns the value of the conditional qualifier or null if not set or not applicable for this field. */ + @Override public String getConditionalQualifier() { return getComponent(CONDITIONAL_QUALIFIER); } @@ -606,7 +605,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field69C(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field69D.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field69D.java index 4300ca9f2..a68095fd3 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field69D.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field69D.java @@ -33,12 +33,9 @@ import com.prowidesoftware.swift.model.field.DateContainer; import com.prowidesoftware.swift.model.field.DateResolver; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -245,16 +242,14 @@ public String getValueDisplay(int component, Locale locale) { return f.format(cal.getTime()); } } - if (component == 4) { - //default format (as is) - return getComponent(4); - } - return null; + // This is the last component, return directly without `if` + //default format (as is) + return getComponent(4); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -598,6 +593,7 @@ public Field69D setDateCode(String component4) { * * @return the list of converted components (a Calendar object or null) */ + @Override public List dates() { return DateResolver.dates(this); } @@ -618,6 +614,7 @@ public Calendar date() { * * @return DSS component value or null if the DSS is not set or not available for this field. */ + @Override public String getDSS() { return null; } @@ -628,6 +625,7 @@ public String getDSS() { * @see #getDSS() * @return true if DSS is present, false otherwise. */ + @Override public boolean isDSSPresent() { return false; } @@ -642,6 +640,7 @@ public boolean isDSSPresent() { * * @return for generic fields returns the value of the conditional qualifier or null if not set or not applicable for this field. */ + @Override public String getConditionalQualifier() { return getComponent(CONDITIONAL_QUALIFIER); } @@ -709,7 +708,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field69D(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field69E.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field69E.java index 54225984b..71dfd9519 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field69E.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field69E.java @@ -33,12 +33,9 @@ import com.prowidesoftware.swift.model.field.DateContainer; import com.prowidesoftware.swift.model.field.DateResolver; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -219,20 +216,19 @@ public String getValueDisplay(int component, Locale locale) { //default format (as is) return getComponent(2); } - if (component == 3) { - //date: [YY]YYMMDD - java.text.DateFormat f = java.text.DateFormat.getDateInstance(java.text.DateFormat.DEFAULT, notNull(locale)); - java.util.Calendar cal = getComponent3AsCalendar(); - if (cal != null) { - return f.format(cal.getTime()); - } + // This is the last component, return directly without `if` + //date: [YY]YYMMDD + java.text.DateFormat f = java.text.DateFormat.getDateInstance(java.text.DateFormat.DEFAULT, notNull(locale)); + java.util.Calendar cal = getComponent3AsCalendar(); + if (cal != null) { + return f.format(cal.getTime()); } return null; } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -499,6 +495,7 @@ public Field69E setDate(java.util.Calendar component3) { * * @return the list of converted components (a Calendar object or null) */ + @Override public List dates() { return DateResolver.dates(this); } @@ -519,6 +516,7 @@ public Calendar date() { * * @return DSS component value or null if the DSS is not set or not available for this field. */ + @Override public String getDSS() { return null; } @@ -529,6 +527,7 @@ public String getDSS() { * @see #getDSS() * @return true if DSS is present, false otherwise. */ + @Override public boolean isDSSPresent() { return false; } @@ -543,6 +542,7 @@ public boolean isDSSPresent() { * * @return for generic fields returns the value of the conditional qualifier or null if not set or not applicable for this field. */ + @Override public String getConditionalQualifier() { return getComponent(CONDITIONAL_QUALIFIER); } @@ -610,7 +610,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field69E(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field69F.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field69F.java index a9d6c18d6..fa846100b 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field69F.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field69F.java @@ -33,12 +33,9 @@ import com.prowidesoftware.swift.model.field.DateContainer; import com.prowidesoftware.swift.model.field.DateResolver; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -242,20 +239,19 @@ public String getValueDisplay(int component, Locale locale) { return f.format(cal.getTime()); } } - if (component == 4) { - //time with seconds: HHmmss - java.text.DateFormat f = new java.text.SimpleDateFormat("HH:mm:ss", notNull(locale)); - java.util.Calendar cal = getComponent4AsCalendar(); - if (cal != null) { - return f.format(cal.getTime()); - } + // This is the last component, return directly without `if` + //time with seconds: HHmmss + java.text.DateFormat f = new java.text.SimpleDateFormat("HH:mm:ss", notNull(locale)); + java.util.Calendar cal = getComponent4AsCalendar(); + if (cal != null) { + return f.format(cal.getTime()); } return null; } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -602,6 +598,7 @@ public Field69F setTime(java.util.Calendar component4) { * * @return the list of converted components (a Calendar object or null) */ + @Override public List dates() { return DateResolver.dates(this); } @@ -622,6 +619,7 @@ public Calendar date() { * * @return DSS component value or null if the DSS is not set or not available for this field. */ + @Override public String getDSS() { return null; } @@ -632,6 +630,7 @@ public String getDSS() { * @see #getDSS() * @return true if DSS is present, false otherwise. */ + @Override public boolean isDSSPresent() { return false; } @@ -646,6 +645,7 @@ public boolean isDSSPresent() { * * @return for generic fields returns the value of the conditional qualifier or null if not set or not applicable for this field. */ + @Override public String getConditionalQualifier() { return getComponent(CONDITIONAL_QUALIFIER); } @@ -713,7 +713,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field69F(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field69J.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field69J.java index c511cf41a..a606ba553 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field69J.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field69J.java @@ -30,12 +30,9 @@ import com.prowidesoftware.swift.model.field.GenericField; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -202,16 +199,14 @@ public String getValueDisplay(int component, Locale locale) { //default format (as is) return getComponent(1); } - if (component == 2) { - //default format (as is) - return getComponent(2); - } - return null; + // This is the last component, return directly without `if` + //default format (as is) + return getComponent(2); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -400,6 +395,7 @@ public Field69J setDateCode(String component2) { * * @return DSS component value or null if the DSS is not set or not available for this field. */ + @Override public String getDSS() { return null; } @@ -410,6 +406,7 @@ public String getDSS() { * @see #getDSS() * @return true if DSS is present, false otherwise. */ + @Override public boolean isDSSPresent() { return false; } @@ -424,6 +421,7 @@ public boolean isDSSPresent() { * * @return for generic fields returns the value of the conditional qualifier or null if not set or not applicable for this field. */ + @Override public String getConditionalQualifier() { return getComponent(CONDITIONAL_QUALIFIER); } @@ -491,7 +489,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field69J(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field70.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field70.java index d05abc3ce..a243ce92b 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field70.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field70.java @@ -30,12 +30,9 @@ import com.prowidesoftware.swift.model.field.MultiLineField; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -246,7 +243,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field70(f)); } @@ -262,6 +259,7 @@ public static List getAll(final SwiftTagListBlock block) { * @return line content or null if not present or if line number is above the expected * @since 7.7 */ + @Override public String getLine(int line) { return getLine(line, 0); } @@ -275,6 +273,7 @@ public String getLine(int line) { * @return line content or null if not present or if line number is above the expected * @since 7.7 */ + @Override public String getLine(int line, int offset) { Field70 cp = newInstance(this); return getLine(cp, line, null, offset); @@ -287,6 +286,7 @@ public String getLine(int line, int offset) { * @return lines content or empty list if field's value is empty * @since 7.7 */ + @Override public List getLines() { return SwiftParseUtils.getLines(getValue()); } @@ -299,6 +299,7 @@ public List getLines() { * @return found lines or empty list if lines are not present or the offset is invalid * @since 7.7 */ + @Override public List getLines(int offset) { Field70 cp = newInstance(this); return SwiftParseUtils.getLines(getLine(cp, null, null, offset)); @@ -313,6 +314,7 @@ public List getLines(int offset) { * @return found lines or empty list if value is empty * @since 7.7 */ + @Override public List getLinesBetween(int start, int end) { return getLinesBetween(start, end, 0); } @@ -327,6 +329,7 @@ public List getLinesBetween(int start, int end) { * @return found lines or empty list if lines are not present or the offset is invalid * @since 7.7 */ + @Override public List getLinesBetween(int start, int end, int offset) { Field70 cp = newInstance(this); return SwiftParseUtils.getLines(getLine(cp, start, end, offset)); diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field70C.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field70C.java index 7353e26cd..230091600 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field70C.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field70C.java @@ -31,12 +31,9 @@ import com.prowidesoftware.swift.model.field.GenericField; import com.prowidesoftware.swift.model.field.MultiLineField; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -222,16 +219,14 @@ public String getValueDisplay(int component, Locale locale) { //default format (as is) return getComponent(4); } - if (component == 5) { - //default format (as is) - return getComponent(5); - } - return null; + // This is the last component, return directly without `if` + //default format (as is) + return getComponent(5); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -586,6 +581,7 @@ public Field70C setNarrativeLine4(String component5) { * * @return DSS component value or null if the DSS is not set or not available for this field. */ + @Override public String getDSS() { return null; } @@ -596,6 +592,7 @@ public String getDSS() { * @see #getDSS() * @return true if DSS is present, false otherwise. */ + @Override public boolean isDSSPresent() { return false; } @@ -610,6 +607,7 @@ public boolean isDSSPresent() { * * @return for generic fields returns the value of the conditional qualifier or null if not set or not applicable for this field. */ + @Override public String getConditionalQualifier() { return getComponent(CONDITIONAL_QUALIFIER); } @@ -677,7 +675,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field70C(f)); } @@ -693,6 +691,7 @@ public static List getAll(final SwiftTagListBlock block) { * @return line content or null if not present or if line number is above the expected * @since 7.7 */ + @Override public String getLine(int line) { return getLine(line, 0); } @@ -706,6 +705,7 @@ public String getLine(int line) { * @return line content or null if not present or if line number is above the expected * @since 7.7 */ + @Override public String getLine(int line, int offset) { Field70C cp = newInstance(this); return getLine(cp, line, null, offset); @@ -718,6 +718,7 @@ public String getLine(int line, int offset) { * @return lines content or empty list if field's value is empty * @since 7.7 */ + @Override public List getLines() { return SwiftParseUtils.getLines(getValue()); } @@ -730,6 +731,7 @@ public List getLines() { * @return found lines or empty list if lines are not present or the offset is invalid * @since 7.7 */ + @Override public List getLines(int offset) { Field70C cp = newInstance(this); return SwiftParseUtils.getLines(getLine(cp, null, null, offset)); @@ -744,6 +746,7 @@ public List getLines(int offset) { * @return found lines or empty list if value is empty * @since 7.7 */ + @Override public List getLinesBetween(int start, int end) { return getLinesBetween(start, end, 0); } @@ -758,6 +761,7 @@ public List getLinesBetween(int start, int end) { * @return found lines or empty list if lines are not present or the offset is invalid * @since 7.7 */ + @Override public List getLinesBetween(int start, int end, int offset) { Field70C cp = newInstance(this); return SwiftParseUtils.getLines(getLine(cp, start, end, offset)); diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field70D.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field70D.java index ac80a8470..d63a61fff 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field70D.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field70D.java @@ -31,12 +31,9 @@ import com.prowidesoftware.swift.model.field.GenericField; import com.prowidesoftware.swift.model.field.MultiLineField; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -232,16 +229,14 @@ public String getValueDisplay(int component, Locale locale) { //default format (as is) return getComponent(6); } - if (component == 7) { - //default format (as is) - return getComponent(7); - } - return null; + // This is the last component, return directly without `if` + //default format (as is) + return getComponent(7); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -682,6 +677,7 @@ public Field70D setNarrativeLine6(String component7) { * * @return DSS component value or null if the DSS is not set or not available for this field. */ + @Override public String getDSS() { return null; } @@ -692,6 +688,7 @@ public String getDSS() { * @see #getDSS() * @return true if DSS is present, false otherwise. */ + @Override public boolean isDSSPresent() { return false; } @@ -706,6 +703,7 @@ public boolean isDSSPresent() { * * @return for generic fields returns the value of the conditional qualifier or null if not set or not applicable for this field. */ + @Override public String getConditionalQualifier() { return getComponent(CONDITIONAL_QUALIFIER); } @@ -773,7 +771,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field70D(f)); } @@ -789,6 +787,7 @@ public static List getAll(final SwiftTagListBlock block) { * @return line content or null if not present or if line number is above the expected * @since 7.7 */ + @Override public String getLine(int line) { return getLine(line, 0); } @@ -802,6 +801,7 @@ public String getLine(int line) { * @return line content or null if not present or if line number is above the expected * @since 7.7 */ + @Override public String getLine(int line, int offset) { Field70D cp = newInstance(this); return getLine(cp, line, null, offset); @@ -814,6 +814,7 @@ public String getLine(int line, int offset) { * @return lines content or empty list if field's value is empty * @since 7.7 */ + @Override public List getLines() { return SwiftParseUtils.getLines(getValue()); } @@ -826,6 +827,7 @@ public List getLines() { * @return found lines or empty list if lines are not present or the offset is invalid * @since 7.7 */ + @Override public List getLines(int offset) { Field70D cp = newInstance(this); return SwiftParseUtils.getLines(getLine(cp, null, null, offset)); @@ -840,6 +842,7 @@ public List getLines(int offset) { * @return found lines or empty list if value is empty * @since 7.7 */ + @Override public List getLinesBetween(int start, int end) { return getLinesBetween(start, end, 0); } @@ -854,6 +857,7 @@ public List getLinesBetween(int start, int end) { * @return found lines or empty list if lines are not present or the offset is invalid * @since 7.7 */ + @Override public List getLinesBetween(int start, int end, int offset) { Field70D cp = newInstance(this); return SwiftParseUtils.getLines(getLine(cp, start, end, offset)); diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field70E.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field70E.java index 009e25e29..e2a1504df 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field70E.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field70E.java @@ -31,12 +31,9 @@ import com.prowidesoftware.swift.model.field.GenericField; import com.prowidesoftware.swift.model.field.MultiLineField; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -252,16 +249,14 @@ public String getValueDisplay(int component, Locale locale) { //default format (as is) return getComponent(10); } - if (component == 11) { - //default format (as is) - return getComponent(11); - } - return null; + // This is the last component, return directly without `if` + //default format (as is) + return getComponent(11); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -874,6 +869,7 @@ public Field70E setNarrativeLine10(String component11) { * * @return DSS component value or null if the DSS is not set or not available for this field. */ + @Override public String getDSS() { return null; } @@ -884,6 +880,7 @@ public String getDSS() { * @see #getDSS() * @return true if DSS is present, false otherwise. */ + @Override public boolean isDSSPresent() { return false; } @@ -898,6 +895,7 @@ public boolean isDSSPresent() { * * @return for generic fields returns the value of the conditional qualifier or null if not set or not applicable for this field. */ + @Override public String getConditionalQualifier() { return getComponent(CONDITIONAL_QUALIFIER); } @@ -965,7 +963,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field70E(f)); } @@ -981,6 +979,7 @@ public static List getAll(final SwiftTagListBlock block) { * @return line content or null if not present or if line number is above the expected * @since 7.7 */ + @Override public String getLine(int line) { return getLine(line, 0); } @@ -994,6 +993,7 @@ public String getLine(int line) { * @return line content or null if not present or if line number is above the expected * @since 7.7 */ + @Override public String getLine(int line, int offset) { Field70E cp = newInstance(this); return getLine(cp, line, null, offset); @@ -1006,6 +1006,7 @@ public String getLine(int line, int offset) { * @return lines content or empty list if field's value is empty * @since 7.7 */ + @Override public List getLines() { return SwiftParseUtils.getLines(getValue()); } @@ -1018,6 +1019,7 @@ public List getLines() { * @return found lines or empty list if lines are not present or the offset is invalid * @since 7.7 */ + @Override public List getLines(int offset) { Field70E cp = newInstance(this); return SwiftParseUtils.getLines(getLine(cp, null, null, offset)); @@ -1032,6 +1034,7 @@ public List getLines(int offset) { * @return found lines or empty list if value is empty * @since 7.7 */ + @Override public List getLinesBetween(int start, int end) { return getLinesBetween(start, end, 0); } @@ -1046,6 +1049,7 @@ public List getLinesBetween(int start, int end) { * @return found lines or empty list if lines are not present or the offset is invalid * @since 7.7 */ + @Override public List getLinesBetween(int start, int end, int offset) { Field70E cp = newInstance(this); return SwiftParseUtils.getLines(getLine(cp, start, end, offset)); diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field70F.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field70F.java index 9b279ae2b..d49266244 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field70F.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field70F.java @@ -31,12 +31,9 @@ import com.prowidesoftware.swift.model.field.GenericField; import com.prowidesoftware.swift.model.field.MultiLineField; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -202,16 +199,14 @@ public String getValueDisplay(int component, Locale locale) { //default format (as is) return getComponent(1); } - if (component == 2) { - //default format (as is) - return getComponent(2); - } - return null; + // This is the last component, return directly without `if` + //default format (as is) + return getComponent(2); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -397,6 +392,7 @@ public Field70F setNarrative(String component2) { * * @return DSS component value or null if the DSS is not set or not available for this field. */ + @Override public String getDSS() { return null; } @@ -407,6 +403,7 @@ public String getDSS() { * @see #getDSS() * @return true if DSS is present, false otherwise. */ + @Override public boolean isDSSPresent() { return false; } @@ -421,6 +418,7 @@ public boolean isDSSPresent() { * * @return for generic fields returns the value of the conditional qualifier or null if not set or not applicable for this field. */ + @Override public String getConditionalQualifier() { return getComponent(CONDITIONAL_QUALIFIER); } @@ -488,7 +486,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field70F(f)); } @@ -504,6 +502,7 @@ public static List getAll(final SwiftTagListBlock block) { * @return line content or null if not present or if line number is above the expected * @since 7.7 */ + @Override public String getLine(int line) { return getLine(line, 0); } @@ -517,6 +516,7 @@ public String getLine(int line) { * @return line content or null if not present or if line number is above the expected * @since 7.7 */ + @Override public String getLine(int line, int offset) { Field70F cp = newInstance(this); return getLine(cp, line, null, offset); @@ -529,6 +529,7 @@ public String getLine(int line, int offset) { * @return lines content or empty list if field's value is empty * @since 7.7 */ + @Override public List getLines() { return SwiftParseUtils.getLines(getValue()); } @@ -541,6 +542,7 @@ public List getLines() { * @return found lines or empty list if lines are not present or the offset is invalid * @since 7.7 */ + @Override public List getLines(int offset) { Field70F cp = newInstance(this); return SwiftParseUtils.getLines(getLine(cp, null, null, offset)); @@ -555,6 +557,7 @@ public List getLines(int offset) { * @return found lines or empty list if value is empty * @since 7.7 */ + @Override public List getLinesBetween(int start, int end) { return getLinesBetween(start, end, 0); } @@ -569,6 +572,7 @@ public List getLinesBetween(int start, int end) { * @return found lines or empty list if lines are not present or the offset is invalid * @since 7.7 */ + @Override public List getLinesBetween(int start, int end, int offset) { Field70F cp = newInstance(this); return SwiftParseUtils.getLines(getLine(cp, start, end, offset)); diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field70G.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field70G.java index a6ed1864e..4b5b310c6 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field70G.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field70G.java @@ -31,12 +31,9 @@ import com.prowidesoftware.swift.model.field.GenericField; import com.prowidesoftware.swift.model.field.MultiLineField; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -252,16 +249,14 @@ public String getValueDisplay(int component, Locale locale) { //default format (as is) return getComponent(10); } - if (component == 11) { - //default format (as is) - return getComponent(11); - } - return null; + // This is the last component, return directly without `if` + //default format (as is) + return getComponent(11); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -874,6 +869,7 @@ public Field70G setNarrativeLine10(String component11) { * * @return DSS component value or null if the DSS is not set or not available for this field. */ + @Override public String getDSS() { return null; } @@ -884,6 +880,7 @@ public String getDSS() { * @see #getDSS() * @return true if DSS is present, false otherwise. */ + @Override public boolean isDSSPresent() { return false; } @@ -898,6 +895,7 @@ public boolean isDSSPresent() { * * @return for generic fields returns the value of the conditional qualifier or null if not set or not applicable for this field. */ + @Override public String getConditionalQualifier() { return getComponent(CONDITIONAL_QUALIFIER); } @@ -965,7 +963,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field70G(f)); } @@ -981,6 +979,7 @@ public static List getAll(final SwiftTagListBlock block) { * @return line content or null if not present or if line number is above the expected * @since 7.7 */ + @Override public String getLine(int line) { return getLine(line, 0); } @@ -994,6 +993,7 @@ public String getLine(int line) { * @return line content or null if not present or if line number is above the expected * @since 7.7 */ + @Override public String getLine(int line, int offset) { Field70G cp = newInstance(this); return getLine(cp, line, null, offset); @@ -1006,6 +1006,7 @@ public String getLine(int line, int offset) { * @return lines content or empty list if field's value is empty * @since 7.7 */ + @Override public List getLines() { return SwiftParseUtils.getLines(getValue()); } @@ -1018,6 +1019,7 @@ public List getLines() { * @return found lines or empty list if lines are not present or the offset is invalid * @since 7.7 */ + @Override public List getLines(int offset) { Field70G cp = newInstance(this); return SwiftParseUtils.getLines(getLine(cp, null, null, offset)); @@ -1032,6 +1034,7 @@ public List getLines(int offset) { * @return found lines or empty list if value is empty * @since 7.7 */ + @Override public List getLinesBetween(int start, int end) { return getLinesBetween(start, end, 0); } @@ -1046,6 +1049,7 @@ public List getLinesBetween(int start, int end) { * @return found lines or empty list if lines are not present or the offset is invalid * @since 7.7 */ + @Override public List getLinesBetween(int start, int end, int offset) { Field70G cp = newInstance(this); return SwiftParseUtils.getLines(getLine(cp, start, end, offset)); diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field70H.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field70H.java index e468a991d..17a241f85 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field70H.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field70H.java @@ -30,12 +30,9 @@ import com.prowidesoftware.swift.model.field.GenericField; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -201,16 +198,14 @@ public String getValueDisplay(int component, Locale locale) { //default format (as is) return getComponent(1); } - if (component == 2) { - //default format (as is) - return getComponent(2); - } - return null; + // This is the last component, return directly without `if` + //default format (as is) + return getComponent(2); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -396,6 +391,7 @@ public Field70H setNarrative(String component2) { * * @return DSS component value or null if the DSS is not set or not available for this field. */ + @Override public String getDSS() { return null; } @@ -406,6 +402,7 @@ public String getDSS() { * @see #getDSS() * @return true if DSS is present, false otherwise. */ + @Override public boolean isDSSPresent() { return false; } @@ -420,6 +417,7 @@ public boolean isDSSPresent() { * * @return for generic fields returns the value of the conditional qualifier or null if not set or not applicable for this field. */ + @Override public String getConditionalQualifier() { return getComponent(CONDITIONAL_QUALIFIER); } @@ -487,7 +485,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field70H(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field71A.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field71A.java index 43ad05cb8..8d9bbd8d7 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field71A.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field71A.java @@ -29,12 +29,9 @@ -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -183,19 +180,16 @@ public String getValue() { */ @Override public String getValueDisplay(int component, Locale locale) { - if (component < 1 || component > 1) { + if (component != 1) { throw new IllegalArgumentException("invalid component number " + component + " for field 71A"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -398,7 +392,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field71A(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field71B.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field71B.java index 059857213..386439e6c 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field71B.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field71B.java @@ -30,12 +30,9 @@ import com.prowidesoftware.swift.model.field.MultiLineField; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -246,7 +243,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field71B(f)); } @@ -262,6 +259,7 @@ public static List getAll(final SwiftTagListBlock block) { * @return line content or null if not present or if line number is above the expected * @since 7.7 */ + @Override public String getLine(int line) { return getLine(line, 0); } @@ -275,6 +273,7 @@ public String getLine(int line) { * @return line content or null if not present or if line number is above the expected * @since 7.7 */ + @Override public String getLine(int line, int offset) { Field71B cp = newInstance(this); return getLine(cp, line, null, offset); @@ -287,6 +286,7 @@ public String getLine(int line, int offset) { * @return lines content or empty list if field's value is empty * @since 7.7 */ + @Override public List getLines() { return SwiftParseUtils.getLines(getValue()); } @@ -299,6 +299,7 @@ public List getLines() { * @return found lines or empty list if lines are not present or the offset is invalid * @since 7.7 */ + @Override public List getLines(int offset) { Field71B cp = newInstance(this); return SwiftParseUtils.getLines(getLine(cp, null, null, offset)); @@ -313,6 +314,7 @@ public List getLines(int offset) { * @return found lines or empty list if value is empty * @since 7.7 */ + @Override public List getLinesBetween(int start, int end) { return getLinesBetween(start, end, 0); } @@ -327,6 +329,7 @@ public List getLinesBetween(int start, int end) { * @return found lines or empty list if lines are not present or the offset is invalid * @since 7.7 */ + @Override public List getLinesBetween(int start, int end, int offset) { Field71B cp = newInstance(this); return SwiftParseUtils.getLines(getLine(cp, start, end, offset)); diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field71C.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field71C.java index aae9e0f5e..570a76962 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field71C.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field71C.java @@ -30,12 +30,9 @@ import com.prowidesoftware.swift.model.field.MultiLineField; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -213,16 +210,14 @@ public String getValueDisplay(int component, Locale locale) { //default format (as is) return getComponent(5); } - if (component == 6) { - //default format (as is) - return getComponent(6); - } - return null; + // This is the last component, return directly without `if` + //default format (as is) + return getComponent(6); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -680,7 +675,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field71C(f)); } @@ -696,6 +691,7 @@ public static List getAll(final SwiftTagListBlock block) { * @return line content or null if not present or if line number is above the expected * @since 7.7 */ + @Override public String getLine(int line) { return getLine(line, 0); } @@ -709,6 +705,7 @@ public String getLine(int line) { * @return line content or null if not present or if line number is above the expected * @since 7.7 */ + @Override public String getLine(int line, int offset) { Field71C cp = newInstance(this); return getLine(cp, line, null, offset); @@ -721,6 +718,7 @@ public String getLine(int line, int offset) { * @return lines content or empty list if field's value is empty * @since 7.7 */ + @Override public List getLines() { return SwiftParseUtils.getLines(getValue()); } @@ -733,6 +731,7 @@ public List getLines() { * @return found lines or empty list if lines are not present or the offset is invalid * @since 7.7 */ + @Override public List getLines(int offset) { Field71C cp = newInstance(this); return SwiftParseUtils.getLines(getLine(cp, null, null, offset)); @@ -747,6 +746,7 @@ public List getLines(int offset) { * @return found lines or empty list if value is empty * @since 7.7 */ + @Override public List getLinesBetween(int start, int end) { return getLinesBetween(start, end, 0); } @@ -761,6 +761,7 @@ public List getLinesBetween(int start, int end) { * @return found lines or empty list if lines are not present or the offset is invalid * @since 7.7 */ + @Override public List getLinesBetween(int start, int end, int offset) { Field71C cp = newInstance(this); return SwiftParseUtils.getLines(getLine(cp, start, end, offset)); diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field71D.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field71D.java index 64c801f52..120af9caf 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field71D.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field71D.java @@ -30,12 +30,9 @@ import com.prowidesoftware.swift.model.field.MultiLineField; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -246,7 +243,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field71D(f)); } @@ -262,6 +259,7 @@ public static List getAll(final SwiftTagListBlock block) { * @return line content or null if not present or if line number is above the expected * @since 7.7 */ + @Override public String getLine(int line) { return getLine(line, 0); } @@ -275,6 +273,7 @@ public String getLine(int line) { * @return line content or null if not present or if line number is above the expected * @since 7.7 */ + @Override public String getLine(int line, int offset) { Field71D cp = newInstance(this); return getLine(cp, line, null, offset); @@ -287,6 +286,7 @@ public String getLine(int line, int offset) { * @return lines content or empty list if field's value is empty * @since 7.7 */ + @Override public List getLines() { return SwiftParseUtils.getLines(getValue()); } @@ -299,6 +299,7 @@ public List getLines() { * @return found lines or empty list if lines are not present or the offset is invalid * @since 7.7 */ + @Override public List getLines(int offset) { Field71D cp = newInstance(this); return SwiftParseUtils.getLines(getLine(cp, null, null, offset)); @@ -313,6 +314,7 @@ public List getLines(int offset) { * @return found lines or empty list if value is empty * @since 7.7 */ + @Override public List getLinesBetween(int start, int end) { return getLinesBetween(start, end, 0); } @@ -327,6 +329,7 @@ public List getLinesBetween(int start, int end) { * @return found lines or empty list if lines are not present or the offset is invalid * @since 7.7 */ + @Override public List getLinesBetween(int start, int end, int offset) { Field71D cp = newInstance(this); return SwiftParseUtils.getLines(getLine(cp, start, end, offset)); diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field71F.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field71F.java index e5ecdb673..d2705b1a3 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field71F.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field71F.java @@ -34,12 +34,9 @@ import com.prowidesoftware.swift.model.field.MonetaryAmountContainer; import com.prowidesoftware.swift.model.field.MonetaryAmountResolver; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -202,21 +199,20 @@ public String getValueDisplay(int component, Locale locale) { //default format (as is) return getComponent(1); } - if (component == 2) { - //amount, rate - java.text.NumberFormat f = java.text.NumberFormat.getNumberInstance(notNull(locale)); - f.setMaximumFractionDigits(13); - BigDecimal n = getComponent2AsBigDecimal(); - if (n != null) { - return f.format(n); - } + // This is the last component, return directly without `if` + //amount, rate + java.text.NumberFormat f = java.text.NumberFormat.getNumberInstance(notNull(locale)); + f.setMaximumFractionDigits(13); + BigDecimal n = getComponent2AsBigDecimal(); + if (n != null) { + return f.format(n); } return null; } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -443,32 +439,13 @@ public Field71F setComponent2(String component2) { return this; } - /** - * Set the component2 from a BigDecimal object. - *
- * Parses the BigDecimal into a SWIFT amount with truncated zero decimals and mandatory decimal separator. - *

- * @since 9.2.7 - * - * @param component2 the BigDecimal with the Amount content to set - * @return the field object to enable build pattern - */ - public Field71F setComponent2(java.math.BigDecimal component2) { - setComponent(2, SwiftFormatUtils.getBigDecimal(component2)); - return this; - } /** * Alternative method setter for field's Amount (component 2) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10.0 becomes an Float) * * @param component2 the Number with the Amount content to set * @return the field object to enable build pattern - * @see #setAmount(java.math.BigDecimal) */ public Field71F setComponent2(java.lang.Number component2) { @@ -500,53 +477,45 @@ public Field71F setAmount(String component2) { return setComponent2(component2); } - /** - * Set the Amount (component 2) from a BigDecimal object. - * - * @see #setComponent2(java.math.BigDecimal) - * - * @param component2 BigDecimal with the Amount content to set - * @return the field object to enable build pattern - * @since 9.2.7 - */ - public Field71F setAmount(java.math.BigDecimal component2) { - return setComponent2(component2); - } - /** * Alternative method setter for field's Amount (component 2) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10 becomes an Integer) * * @param component2 the Number with the Amount content to set * @return the field object to enable build pattern - * @see #setAmount(java.math.BigDecimal) */ public Field71F setAmount(java.lang.Number component2) { return setComponent2(component2); } + @Override public List currencyStrings() { return MonetaryAmountResolver.currencyStrings(this); } + @Override public List currencies() { return MonetaryAmountResolver.currencies(this); } + @Override public Currency currency() { return MonetaryAmountResolver.resolveCurrency(this); } + @Override public String currencyString() { return MonetaryAmountResolver.resolveCurrencyString(this); } + @Override public void initializeCurrencies(String cur) { MonetaryAmountResolver.resolveSetCurrency(this, cur); } + @Override public void initializeCurrencies(Currency cur) { MonetaryAmountResolver.resolveSetCurrency(this, cur); } @@ -567,6 +536,7 @@ public List amounts() { * @return the first amount as BigDecimal value. Can be null * @see MonetaryAmountResolver#amount(Field) */ + @Override public BigDecimal amount() { return MonetaryAmountResolver.amount(this); } @@ -635,7 +605,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field71F(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field71G.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field71G.java index af23bc9a0..0bce405e8 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field71G.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field71G.java @@ -34,12 +34,9 @@ import com.prowidesoftware.swift.model.field.MonetaryAmountContainer; import com.prowidesoftware.swift.model.field.MonetaryAmountResolver; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -202,21 +199,20 @@ public String getValueDisplay(int component, Locale locale) { //default format (as is) return getComponent(1); } - if (component == 2) { - //amount, rate - java.text.NumberFormat f = java.text.NumberFormat.getNumberInstance(notNull(locale)); - f.setMaximumFractionDigits(13); - BigDecimal n = getComponent2AsBigDecimal(); - if (n != null) { - return f.format(n); - } + // This is the last component, return directly without `if` + //amount, rate + java.text.NumberFormat f = java.text.NumberFormat.getNumberInstance(notNull(locale)); + f.setMaximumFractionDigits(13); + BigDecimal n = getComponent2AsBigDecimal(); + if (n != null) { + return f.format(n); } return null; } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -443,32 +439,13 @@ public Field71G setComponent2(String component2) { return this; } - /** - * Set the component2 from a BigDecimal object. - *
- * Parses the BigDecimal into a SWIFT amount with truncated zero decimals and mandatory decimal separator. - *

- * @since 9.2.7 - * - * @param component2 the BigDecimal with the Amount content to set - * @return the field object to enable build pattern - */ - public Field71G setComponent2(java.math.BigDecimal component2) { - setComponent(2, SwiftFormatUtils.getBigDecimal(component2)); - return this; - } /** * Alternative method setter for field's Amount (component 2) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10.0 becomes an Float) * * @param component2 the Number with the Amount content to set * @return the field object to enable build pattern - * @see #setAmount(java.math.BigDecimal) */ public Field71G setComponent2(java.lang.Number component2) { @@ -500,53 +477,45 @@ public Field71G setAmount(String component2) { return setComponent2(component2); } - /** - * Set the Amount (component 2) from a BigDecimal object. - * - * @see #setComponent2(java.math.BigDecimal) - * - * @param component2 BigDecimal with the Amount content to set - * @return the field object to enable build pattern - * @since 9.2.7 - */ - public Field71G setAmount(java.math.BigDecimal component2) { - return setComponent2(component2); - } - /** * Alternative method setter for field's Amount (component 2) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10 becomes an Integer) * * @param component2 the Number with the Amount content to set * @return the field object to enable build pattern - * @see #setAmount(java.math.BigDecimal) */ public Field71G setAmount(java.lang.Number component2) { return setComponent2(component2); } + @Override public List currencyStrings() { return MonetaryAmountResolver.currencyStrings(this); } + @Override public List currencies() { return MonetaryAmountResolver.currencies(this); } + @Override public Currency currency() { return MonetaryAmountResolver.resolveCurrency(this); } + @Override public String currencyString() { return MonetaryAmountResolver.resolveCurrencyString(this); } + @Override public void initializeCurrencies(String cur) { MonetaryAmountResolver.resolveSetCurrency(this, cur); } + @Override public void initializeCurrencies(Currency cur) { MonetaryAmountResolver.resolveSetCurrency(this, cur); } @@ -567,6 +536,7 @@ public List amounts() { * @return the first amount as BigDecimal value. Can be null * @see MonetaryAmountResolver#amount(Field) */ + @Override public BigDecimal amount() { return MonetaryAmountResolver.amount(this); } @@ -635,7 +605,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field71G(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field71N.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field71N.java index c99a1dbe1..024c21331 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field71N.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field71N.java @@ -30,12 +30,9 @@ import com.prowidesoftware.swift.model.field.MultiLineField; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -223,16 +220,14 @@ public String getValueDisplay(int component, Locale locale) { //default format (as is) return getComponent(6); } - if (component == 7) { - //default format (as is) - return getComponent(7); - } - return null; + // This is the last component, return directly without `if` + //default format (as is) + return getComponent(7); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -733,7 +728,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field71N(f)); } @@ -749,6 +744,7 @@ public static List getAll(final SwiftTagListBlock block) { * @return line content or null if not present or if line number is above the expected * @since 7.7 */ + @Override public String getLine(int line) { return getLine(line, 0); } @@ -762,6 +758,7 @@ public String getLine(int line) { * @return line content or null if not present or if line number is above the expected * @since 7.7 */ + @Override public String getLine(int line, int offset) { Field71N cp = newInstance(this); return getLine(cp, line, null, offset); @@ -774,6 +771,7 @@ public String getLine(int line, int offset) { * @return lines content or empty list if field's value is empty * @since 7.7 */ + @Override public List getLines() { return SwiftParseUtils.getLines(getValue()); } @@ -786,6 +784,7 @@ public List getLines() { * @return found lines or empty list if lines are not present or the offset is invalid * @since 7.7 */ + @Override public List getLines(int offset) { Field71N cp = newInstance(this); return SwiftParseUtils.getLines(getLine(cp, null, null, offset)); @@ -800,6 +799,7 @@ public List getLines(int offset) { * @return found lines or empty list if value is empty * @since 7.7 */ + @Override public List getLinesBetween(int start, int end) { return getLinesBetween(start, end, 0); } @@ -814,6 +814,7 @@ public List getLinesBetween(int start, int end) { * @return found lines or empty list if lines are not present or the offset is invalid * @since 7.7 */ + @Override public List getLinesBetween(int start, int end, int offset) { Field71N cp = newInstance(this); return SwiftParseUtils.getLines(getLine(cp, start, end, offset)); diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field72.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field72.java index ce50f6998..eb8dc7bcc 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field72.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field72.java @@ -30,12 +30,9 @@ import com.prowidesoftware.swift.model.field.MultiLineField; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -246,7 +243,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field72(f)); } @@ -262,6 +259,7 @@ public static List getAll(final SwiftTagListBlock block) { * @return line content or null if not present or if line number is above the expected * @since 7.7 */ + @Override public String getLine(int line) { return getLine(line, 0); } @@ -275,6 +273,7 @@ public String getLine(int line) { * @return line content or null if not present or if line number is above the expected * @since 7.7 */ + @Override public String getLine(int line, int offset) { Field72 cp = newInstance(this); return getLine(cp, line, null, offset); @@ -287,6 +286,7 @@ public String getLine(int line, int offset) { * @return lines content or empty list if field's value is empty * @since 7.7 */ + @Override public List getLines() { return SwiftParseUtils.getLines(getValue()); } @@ -299,6 +299,7 @@ public List getLines() { * @return found lines or empty list if lines are not present or the offset is invalid * @since 7.7 */ + @Override public List getLines(int offset) { Field72 cp = newInstance(this); return SwiftParseUtils.getLines(getLine(cp, null, null, offset)); @@ -313,6 +314,7 @@ public List getLines(int offset) { * @return found lines or empty list if value is empty * @since 7.7 */ + @Override public List getLinesBetween(int start, int end) { return getLinesBetween(start, end, 0); } @@ -327,6 +329,7 @@ public List getLinesBetween(int start, int end) { * @return found lines or empty list if lines are not present or the offset is invalid * @since 7.7 */ + @Override public List getLinesBetween(int start, int end, int offset) { Field72 cp = newInstance(this); return SwiftParseUtils.getLines(getLine(cp, start, end, offset)); diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field72Z.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field72Z.java index 5816226bc..f43b24c38 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field72Z.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field72Z.java @@ -30,12 +30,9 @@ import com.prowidesoftware.swift.model.field.MultiLineField; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -246,7 +243,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field72Z(f)); } @@ -262,6 +259,7 @@ public static List getAll(final SwiftTagListBlock block) { * @return line content or null if not present or if line number is above the expected * @since 7.7 */ + @Override public String getLine(int line) { return getLine(line, 0); } @@ -275,6 +273,7 @@ public String getLine(int line) { * @return line content or null if not present or if line number is above the expected * @since 7.7 */ + @Override public String getLine(int line, int offset) { Field72Z cp = newInstance(this); return getLine(cp, line, null, offset); @@ -287,6 +286,7 @@ public String getLine(int line, int offset) { * @return lines content or empty list if field's value is empty * @since 7.7 */ + @Override public List getLines() { return SwiftParseUtils.getLines(getValue()); } @@ -299,6 +299,7 @@ public List getLines() { * @return found lines or empty list if lines are not present or the offset is invalid * @since 7.7 */ + @Override public List getLines(int offset) { Field72Z cp = newInstance(this); return SwiftParseUtils.getLines(getLine(cp, null, null, offset)); @@ -313,6 +314,7 @@ public List getLines(int offset) { * @return found lines or empty list if value is empty * @since 7.7 */ + @Override public List getLinesBetween(int start, int end) { return getLinesBetween(start, end, 0); } @@ -327,6 +329,7 @@ public List getLinesBetween(int start, int end) { * @return found lines or empty list if lines are not present or the offset is invalid * @since 7.7 */ + @Override public List getLinesBetween(int start, int end, int offset) { Field72Z cp = newInstance(this); return SwiftParseUtils.getLines(getLine(cp, start, end, offset)); diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field73.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field73.java index a635d6bc9..1336fb465 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field73.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field73.java @@ -30,12 +30,9 @@ import com.prowidesoftware.swift.model.field.MultiLineField; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -246,7 +243,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field73(f)); } @@ -262,6 +259,7 @@ public static List getAll(final SwiftTagListBlock block) { * @return line content or null if not present or if line number is above the expected * @since 7.7 */ + @Override public String getLine(int line) { return getLine(line, 0); } @@ -275,6 +273,7 @@ public String getLine(int line) { * @return line content or null if not present or if line number is above the expected * @since 7.7 */ + @Override public String getLine(int line, int offset) { Field73 cp = newInstance(this); return getLine(cp, line, null, offset); @@ -287,6 +286,7 @@ public String getLine(int line, int offset) { * @return lines content or empty list if field's value is empty * @since 7.7 */ + @Override public List getLines() { return SwiftParseUtils.getLines(getValue()); } @@ -299,6 +299,7 @@ public List getLines() { * @return found lines or empty list if lines are not present or the offset is invalid * @since 7.7 */ + @Override public List getLines(int offset) { Field73 cp = newInstance(this); return SwiftParseUtils.getLines(getLine(cp, null, null, offset)); @@ -313,6 +314,7 @@ public List getLines(int offset) { * @return found lines or empty list if value is empty * @since 7.7 */ + @Override public List getLinesBetween(int start, int end) { return getLinesBetween(start, end, 0); } @@ -327,6 +329,7 @@ public List getLinesBetween(int start, int end) { * @return found lines or empty list if lines are not present or the offset is invalid * @since 7.7 */ + @Override public List getLinesBetween(int start, int end, int offset) { Field73 cp = newInstance(this); return SwiftParseUtils.getLines(getLine(cp, start, end, offset)); diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field73A.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field73A.java index 12b572c0c..0d647b0ca 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field73A.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field73A.java @@ -30,12 +30,9 @@ import com.prowidesoftware.swift.model.field.MultiLineField; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -246,7 +243,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field73A(f)); } @@ -262,6 +259,7 @@ public static List getAll(final SwiftTagListBlock block) { * @return line content or null if not present or if line number is above the expected * @since 7.7 */ + @Override public String getLine(int line) { return getLine(line, 0); } @@ -275,6 +273,7 @@ public String getLine(int line) { * @return line content or null if not present or if line number is above the expected * @since 7.7 */ + @Override public String getLine(int line, int offset) { Field73A cp = newInstance(this); return getLine(cp, line, null, offset); @@ -287,6 +286,7 @@ public String getLine(int line, int offset) { * @return lines content or empty list if field's value is empty * @since 7.7 */ + @Override public List getLines() { return SwiftParseUtils.getLines(getValue()); } @@ -299,6 +299,7 @@ public List getLines() { * @return found lines or empty list if lines are not present or the offset is invalid * @since 7.7 */ + @Override public List getLines(int offset) { Field73A cp = newInstance(this); return SwiftParseUtils.getLines(getLine(cp, null, null, offset)); @@ -313,6 +314,7 @@ public List getLines(int offset) { * @return found lines or empty list if value is empty * @since 7.7 */ + @Override public List getLinesBetween(int start, int end) { return getLinesBetween(start, end, 0); } @@ -327,6 +329,7 @@ public List getLinesBetween(int start, int end) { * @return found lines or empty list if lines are not present or the offset is invalid * @since 7.7 */ + @Override public List getLinesBetween(int start, int end, int offset) { Field73A cp = newInstance(this); return SwiftParseUtils.getLines(getLine(cp, start, end, offset)); diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field73R.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field73R.java index 2482bb9d1..df44b3357 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field73R.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field73R.java @@ -29,12 +29,9 @@ -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -200,16 +197,14 @@ public String getValueDisplay(int component, Locale locale) { //default format (as is) return getComponent(1); } - if (component == 2) { - //default format (as is) - return getComponent(2); - } - return null; + // This is the last component, return directly without `if` + //default format (as is) + return getComponent(2); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -455,7 +450,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field73R(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field73S.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field73S.java index 815ad79da..bd7b075dc 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field73S.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field73S.java @@ -29,12 +29,9 @@ -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -200,16 +197,14 @@ public String getValueDisplay(int component, Locale locale) { //default format (as is) return getComponent(1); } - if (component == 2) { - //default format (as is) - return getComponent(2); - } - return null; + // This is the last component, return directly without `if` + //default format (as is) + return getComponent(2); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -455,7 +450,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field73S(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field74.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field74.java index d084b647b..2f2e267d6 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field74.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field74.java @@ -30,12 +30,9 @@ import com.prowidesoftware.swift.model.field.MultiLineField; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -246,7 +243,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field74(f)); } @@ -262,6 +259,7 @@ public static List getAll(final SwiftTagListBlock block) { * @return line content or null if not present or if line number is above the expected * @since 7.7 */ + @Override public String getLine(int line) { return getLine(line, 0); } @@ -275,6 +273,7 @@ public String getLine(int line) { * @return line content or null if not present or if line number is above the expected * @since 7.7 */ + @Override public String getLine(int line, int offset) { Field74 cp = newInstance(this); return getLine(cp, line, null, offset); @@ -287,6 +286,7 @@ public String getLine(int line, int offset) { * @return lines content or empty list if field's value is empty * @since 7.7 */ + @Override public List getLines() { return SwiftParseUtils.getLines(getValue()); } @@ -299,6 +299,7 @@ public List getLines() { * @return found lines or empty list if lines are not present or the offset is invalid * @since 7.7 */ + @Override public List getLines(int offset) { Field74 cp = newInstance(this); return SwiftParseUtils.getLines(getLine(cp, null, null, offset)); @@ -313,6 +314,7 @@ public List getLines(int offset) { * @return found lines or empty list if value is empty * @since 7.7 */ + @Override public List getLinesBetween(int start, int end) { return getLinesBetween(start, end, 0); } @@ -327,6 +329,7 @@ public List getLinesBetween(int start, int end) { * @return found lines or empty list if lines are not present or the offset is invalid * @since 7.7 */ + @Override public List getLinesBetween(int start, int end, int offset) { Field74 cp = newInstance(this); return SwiftParseUtils.getLines(getLine(cp, start, end, offset)); diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field75.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field75.java index 8af2155b4..74501f5d9 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field75.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field75.java @@ -30,12 +30,9 @@ import com.prowidesoftware.swift.model.field.MultiLineField; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -246,7 +243,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field75(f)); } @@ -262,6 +259,7 @@ public static List getAll(final SwiftTagListBlock block) { * @return line content or null if not present or if line number is above the expected * @since 7.7 */ + @Override public String getLine(int line) { return getLine(line, 0); } @@ -275,6 +273,7 @@ public String getLine(int line) { * @return line content or null if not present or if line number is above the expected * @since 7.7 */ + @Override public String getLine(int line, int offset) { Field75 cp = newInstance(this); return getLine(cp, line, null, offset); @@ -287,6 +286,7 @@ public String getLine(int line, int offset) { * @return lines content or empty list if field's value is empty * @since 7.7 */ + @Override public List getLines() { return SwiftParseUtils.getLines(getValue()); } @@ -299,6 +299,7 @@ public List getLines() { * @return found lines or empty list if lines are not present or the offset is invalid * @since 7.7 */ + @Override public List getLines(int offset) { Field75 cp = newInstance(this); return SwiftParseUtils.getLines(getLine(cp, null, null, offset)); @@ -313,6 +314,7 @@ public List getLines(int offset) { * @return found lines or empty list if value is empty * @since 7.7 */ + @Override public List getLinesBetween(int start, int end) { return getLinesBetween(start, end, 0); } @@ -327,6 +329,7 @@ public List getLinesBetween(int start, int end) { * @return found lines or empty list if lines are not present or the offset is invalid * @since 7.7 */ + @Override public List getLinesBetween(int start, int end, int offset) { Field75 cp = newInstance(this); return SwiftParseUtils.getLines(getLine(cp, start, end, offset)); diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field76.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field76.java index b32888b1f..5abf6009f 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field76.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field76.java @@ -30,12 +30,9 @@ import com.prowidesoftware.swift.model.field.MultiLineField; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -246,7 +243,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field76(f)); } @@ -262,6 +259,7 @@ public static List getAll(final SwiftTagListBlock block) { * @return line content or null if not present or if line number is above the expected * @since 7.7 */ + @Override public String getLine(int line) { return getLine(line, 0); } @@ -275,6 +273,7 @@ public String getLine(int line) { * @return line content or null if not present or if line number is above the expected * @since 7.7 */ + @Override public String getLine(int line, int offset) { Field76 cp = newInstance(this); return getLine(cp, line, null, offset); @@ -287,6 +286,7 @@ public String getLine(int line, int offset) { * @return lines content or empty list if field's value is empty * @since 7.7 */ + @Override public List getLines() { return SwiftParseUtils.getLines(getValue()); } @@ -299,6 +299,7 @@ public List getLines() { * @return found lines or empty list if lines are not present or the offset is invalid * @since 7.7 */ + @Override public List getLines(int offset) { Field76 cp = newInstance(this); return SwiftParseUtils.getLines(getLine(cp, null, null, offset)); @@ -313,6 +314,7 @@ public List getLines(int offset) { * @return found lines or empty list if value is empty * @since 7.7 */ + @Override public List getLinesBetween(int start, int end) { return getLinesBetween(start, end, 0); } @@ -327,6 +329,7 @@ public List getLinesBetween(int start, int end) { * @return found lines or empty list if lines are not present or the offset is invalid * @since 7.7 */ + @Override public List getLinesBetween(int start, int end, int offset) { Field76 cp = newInstance(this); return SwiftParseUtils.getLines(getLine(cp, start, end, offset)); diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field77.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field77.java index d18f0e9b8..e39824fcd 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field77.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field77.java @@ -30,12 +30,9 @@ import com.prowidesoftware.swift.model.field.MultiLineField; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -246,7 +243,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field77(f)); } @@ -262,6 +259,7 @@ public static List getAll(final SwiftTagListBlock block) { * @return line content or null if not present or if line number is above the expected * @since 7.7 */ + @Override public String getLine(int line) { return getLine(line, 0); } @@ -275,6 +273,7 @@ public String getLine(int line) { * @return line content or null if not present or if line number is above the expected * @since 7.7 */ + @Override public String getLine(int line, int offset) { Field77 cp = newInstance(this); return getLine(cp, line, null, offset); @@ -287,6 +286,7 @@ public String getLine(int line, int offset) { * @return lines content or empty list if field's value is empty * @since 7.7 */ + @Override public List getLines() { return SwiftParseUtils.getLines(getValue()); } @@ -299,6 +299,7 @@ public List getLines() { * @return found lines or empty list if lines are not present or the offset is invalid * @since 7.7 */ + @Override public List getLines(int offset) { Field77 cp = newInstance(this); return SwiftParseUtils.getLines(getLine(cp, null, null, offset)); @@ -313,6 +314,7 @@ public List getLines(int offset) { * @return found lines or empty list if value is empty * @since 7.7 */ + @Override public List getLinesBetween(int start, int end) { return getLinesBetween(start, end, 0); } @@ -327,6 +329,7 @@ public List getLinesBetween(int start, int end) { * @return found lines or empty list if lines are not present or the offset is invalid * @since 7.7 */ + @Override public List getLinesBetween(int start, int end, int offset) { Field77 cp = newInstance(this); return SwiftParseUtils.getLines(getLine(cp, start, end, offset)); diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field77A.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field77A.java index c50155383..c373d1b3c 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field77A.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field77A.java @@ -30,12 +30,9 @@ import com.prowidesoftware.swift.model.field.MultiLineField; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -246,7 +243,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field77A(f)); } @@ -262,6 +259,7 @@ public static List getAll(final SwiftTagListBlock block) { * @return line content or null if not present or if line number is above the expected * @since 7.7 */ + @Override public String getLine(int line) { return getLine(line, 0); } @@ -275,6 +273,7 @@ public String getLine(int line) { * @return line content or null if not present or if line number is above the expected * @since 7.7 */ + @Override public String getLine(int line, int offset) { Field77A cp = newInstance(this); return getLine(cp, line, null, offset); @@ -287,6 +286,7 @@ public String getLine(int line, int offset) { * @return lines content or empty list if field's value is empty * @since 7.7 */ + @Override public List getLines() { return SwiftParseUtils.getLines(getValue()); } @@ -299,6 +299,7 @@ public List getLines() { * @return found lines or empty list if lines are not present or the offset is invalid * @since 7.7 */ + @Override public List getLines(int offset) { Field77A cp = newInstance(this); return SwiftParseUtils.getLines(getLine(cp, null, null, offset)); @@ -313,6 +314,7 @@ public List getLines(int offset) { * @return found lines or empty list if value is empty * @since 7.7 */ + @Override public List getLinesBetween(int start, int end) { return getLinesBetween(start, end, 0); } @@ -327,6 +329,7 @@ public List getLinesBetween(int start, int end) { * @return found lines or empty list if lines are not present or the offset is invalid * @since 7.7 */ + @Override public List getLinesBetween(int start, int end, int offset) { Field77A cp = newInstance(this); return SwiftParseUtils.getLines(getLine(cp, start, end, offset)); diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field77B.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field77B.java index 7df543922..60cff23c2 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field77B.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field77B.java @@ -30,12 +30,9 @@ import com.prowidesoftware.swift.model.field.MultiLineField; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -246,7 +243,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field77B(f)); } @@ -262,6 +259,7 @@ public static List getAll(final SwiftTagListBlock block) { * @return line content or null if not present or if line number is above the expected * @since 7.7 */ + @Override public String getLine(int line) { return getLine(line, 0); } @@ -275,6 +273,7 @@ public String getLine(int line) { * @return line content or null if not present or if line number is above the expected * @since 7.7 */ + @Override public String getLine(int line, int offset) { Field77B cp = newInstance(this); return getLine(cp, line, null, offset); @@ -287,6 +286,7 @@ public String getLine(int line, int offset) { * @return lines content or empty list if field's value is empty * @since 7.7 */ + @Override public List getLines() { return SwiftParseUtils.getLines(getValue()); } @@ -299,6 +299,7 @@ public List getLines() { * @return found lines or empty list if lines are not present or the offset is invalid * @since 7.7 */ + @Override public List getLines(int offset) { Field77B cp = newInstance(this); return SwiftParseUtils.getLines(getLine(cp, null, null, offset)); @@ -313,6 +314,7 @@ public List getLines(int offset) { * @return found lines or empty list if value is empty * @since 7.7 */ + @Override public List getLinesBetween(int start, int end) { return getLinesBetween(start, end, 0); } @@ -327,6 +329,7 @@ public List getLinesBetween(int start, int end) { * @return found lines or empty list if lines are not present or the offset is invalid * @since 7.7 */ + @Override public List getLinesBetween(int start, int end, int offset) { Field77B cp = newInstance(this); return SwiftParseUtils.getLines(getLine(cp, start, end, offset)); diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field77C.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field77C.java index ce1e856dc..1d7b25c2b 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field77C.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field77C.java @@ -30,12 +30,9 @@ import com.prowidesoftware.swift.model.field.MultiLineField; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -184,19 +181,16 @@ public String getValue() { */ @Override public String getValueDisplay(int component, Locale locale) { - if (component < 1 || component > 1) { + if (component != 1) { throw new IllegalArgumentException("invalid component number " + component + " for field 77C"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -399,7 +393,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field77C(f)); } @@ -415,6 +409,7 @@ public static List getAll(final SwiftTagListBlock block) { * @return line content or null if not present or if line number is above the expected * @since 7.7 */ + @Override public String getLine(int line) { return getLine(line, 0); } @@ -428,6 +423,7 @@ public String getLine(int line) { * @return line content or null if not present or if line number is above the expected * @since 7.7 */ + @Override public String getLine(int line, int offset) { Field77C cp = newInstance(this); return getLine(cp, line, null, offset); @@ -440,6 +436,7 @@ public String getLine(int line, int offset) { * @return lines content or empty list if field's value is empty * @since 7.7 */ + @Override public List getLines() { return SwiftParseUtils.getLines(getValue()); } @@ -452,6 +449,7 @@ public List getLines() { * @return found lines or empty list if lines are not present or the offset is invalid * @since 7.7 */ + @Override public List getLines(int offset) { Field77C cp = newInstance(this); return SwiftParseUtils.getLines(getLine(cp, null, null, offset)); @@ -466,6 +464,7 @@ public List getLines(int offset) { * @return found lines or empty list if value is empty * @since 7.7 */ + @Override public List getLinesBetween(int start, int end) { return getLinesBetween(start, end, 0); } @@ -480,6 +479,7 @@ public List getLinesBetween(int start, int end) { * @return found lines or empty list if lines are not present or the offset is invalid * @since 7.7 */ + @Override public List getLinesBetween(int start, int end, int offset) { Field77C cp = newInstance(this); return SwiftParseUtils.getLines(getLine(cp, start, end, offset)); diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field77D.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field77D.java index 122c2484e..e5c429e27 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field77D.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field77D.java @@ -30,12 +30,9 @@ import com.prowidesoftware.swift.model.field.MultiLineField; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -246,7 +243,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field77D(f)); } @@ -262,6 +259,7 @@ public static List getAll(final SwiftTagListBlock block) { * @return line content or null if not present or if line number is above the expected * @since 7.7 */ + @Override public String getLine(int line) { return getLine(line, 0); } @@ -275,6 +273,7 @@ public String getLine(int line) { * @return line content or null if not present or if line number is above the expected * @since 7.7 */ + @Override public String getLine(int line, int offset) { Field77D cp = newInstance(this); return getLine(cp, line, null, offset); @@ -287,6 +286,7 @@ public String getLine(int line, int offset) { * @return lines content or empty list if field's value is empty * @since 7.7 */ + @Override public List getLines() { return SwiftParseUtils.getLines(getValue()); } @@ -299,6 +299,7 @@ public List getLines() { * @return found lines or empty list if lines are not present or the offset is invalid * @since 7.7 */ + @Override public List getLines(int offset) { Field77D cp = newInstance(this); return SwiftParseUtils.getLines(getLine(cp, null, null, offset)); @@ -313,6 +314,7 @@ public List getLines(int offset) { * @return found lines or empty list if value is empty * @since 7.7 */ + @Override public List getLinesBetween(int start, int end) { return getLinesBetween(start, end, 0); } @@ -327,6 +329,7 @@ public List getLinesBetween(int start, int end) { * @return found lines or empty list if lines are not present or the offset is invalid * @since 7.7 */ + @Override public List getLinesBetween(int start, int end, int offset) { Field77D cp = newInstance(this); return SwiftParseUtils.getLines(getLine(cp, start, end, offset)); diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field77E.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field77E.java index 03f4580f3..febcd50eb 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field77E.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field77E.java @@ -30,12 +30,9 @@ import com.prowidesoftware.swift.model.field.MultiLineField; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -184,19 +181,16 @@ public String getValue() { */ @Override public String getValueDisplay(int component, Locale locale) { - if (component < 1 || component > 1) { + if (component != 1) { throw new IllegalArgumentException("invalid component number " + component + " for field 77E"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -399,7 +393,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field77E(f)); } @@ -415,6 +409,7 @@ public static List getAll(final SwiftTagListBlock block) { * @return line content or null if not present or if line number is above the expected * @since 7.7 */ + @Override public String getLine(int line) { return getLine(line, 0); } @@ -428,6 +423,7 @@ public String getLine(int line) { * @return line content or null if not present or if line number is above the expected * @since 7.7 */ + @Override public String getLine(int line, int offset) { Field77E cp = newInstance(this); return getLine(cp, line, null, offset); @@ -440,6 +436,7 @@ public String getLine(int line, int offset) { * @return lines content or empty list if field's value is empty * @since 7.7 */ + @Override public List getLines() { return SwiftParseUtils.getLines(getValue()); } @@ -452,6 +449,7 @@ public List getLines() { * @return found lines or empty list if lines are not present or the offset is invalid * @since 7.7 */ + @Override public List getLines(int offset) { Field77E cp = newInstance(this); return SwiftParseUtils.getLines(getLine(cp, null, null, offset)); @@ -466,6 +464,7 @@ public List getLines(int offset) { * @return found lines or empty list if value is empty * @since 7.7 */ + @Override public List getLinesBetween(int start, int end) { return getLinesBetween(start, end, 0); } @@ -480,6 +479,7 @@ public List getLinesBetween(int start, int end) { * @return found lines or empty list if lines are not present or the offset is invalid * @since 7.7 */ + @Override public List getLinesBetween(int start, int end, int offset) { Field77E cp = newInstance(this); return SwiftParseUtils.getLines(getLine(cp, start, end, offset)); diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field77F.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field77F.java index dfbc6acf5..fab9eb1be 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field77F.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field77F.java @@ -30,12 +30,9 @@ import com.prowidesoftware.swift.model.field.MultiLineField; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -185,19 +182,16 @@ public String getValue() { */ @Override public String getValueDisplay(int component, Locale locale) { - if (component < 1 || component > 1) { + if (component != 1) { throw new IllegalArgumentException("invalid component number " + component + " for field 77F"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -403,7 +397,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field77F(f)); } @@ -419,6 +413,7 @@ public static List getAll(final SwiftTagListBlock block) { * @return line content or null if not present or if line number is above the expected * @since 7.7 */ + @Override public String getLine(int line) { return getLine(line, 0); } @@ -432,6 +427,7 @@ public String getLine(int line) { * @return line content or null if not present or if line number is above the expected * @since 7.7 */ + @Override public String getLine(int line, int offset) { Field77F cp = newInstance(this); return getLine(cp, line, null, offset); @@ -444,6 +440,7 @@ public String getLine(int line, int offset) { * @return lines content or empty list if field's value is empty * @since 7.7 */ + @Override public List getLines() { return SwiftParseUtils.getLines(getValue()); } @@ -456,6 +453,7 @@ public List getLines() { * @return found lines or empty list if lines are not present or the offset is invalid * @since 7.7 */ + @Override public List getLines(int offset) { Field77F cp = newInstance(this); return SwiftParseUtils.getLines(getLine(cp, null, null, offset)); @@ -470,6 +468,7 @@ public List getLines(int offset) { * @return found lines or empty list if value is empty * @since 7.7 */ + @Override public List getLinesBetween(int start, int end) { return getLinesBetween(start, end, 0); } @@ -484,6 +483,7 @@ public List getLinesBetween(int start, int end) { * @return found lines or empty list if lines are not present or the offset is invalid * @since 7.7 */ + @Override public List getLinesBetween(int start, int end, int offset) { Field77F cp = newInstance(this); return SwiftParseUtils.getLines(getLine(cp, start, end, offset)); diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field77H.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field77H.java index 58dd33aa7..e47292f7a 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field77H.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field77H.java @@ -32,12 +32,9 @@ import com.prowidesoftware.swift.model.field.DateContainer; import com.prowidesoftware.swift.model.field.DateResolver; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -228,16 +225,14 @@ public String getValueDisplay(int component, Locale locale) { return f.format(cal.getTime()); } } - if (component == 3) { - //default format (as is) - return getComponent(3); - } - return null; + // This is the last component, return directly without `if` + //default format (as is) + return getComponent(3); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -562,6 +557,7 @@ public Field77H setVersion(java.util.Calendar component3) { * @return the list of converted components (a Calendar object or null) * @since 9.2.7 */ + @Override public List dates() { return DateResolver.dates(this); } @@ -640,7 +636,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field77H(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field77J.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field77J.java index 1e2268646..549307aa5 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field77J.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field77J.java @@ -30,12 +30,9 @@ import com.prowidesoftware.swift.model.field.MultiLineField; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -246,7 +243,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field77J(f)); } @@ -262,6 +259,7 @@ public static List getAll(final SwiftTagListBlock block) { * @return line content or null if not present or if line number is above the expected * @since 7.7 */ + @Override public String getLine(int line) { return getLine(line, 0); } @@ -275,6 +273,7 @@ public String getLine(int line) { * @return line content or null if not present or if line number is above the expected * @since 7.7 */ + @Override public String getLine(int line, int offset) { Field77J cp = newInstance(this); return getLine(cp, line, null, offset); @@ -287,6 +286,7 @@ public String getLine(int line, int offset) { * @return lines content or empty list if field's value is empty * @since 7.7 */ + @Override public List getLines() { return SwiftParseUtils.getLines(getValue()); } @@ -299,6 +299,7 @@ public List getLines() { * @return found lines or empty list if lines are not present or the offset is invalid * @since 7.7 */ + @Override public List getLines(int offset) { Field77J cp = newInstance(this); return SwiftParseUtils.getLines(getLine(cp, null, null, offset)); @@ -313,6 +314,7 @@ public List getLines(int offset) { * @return found lines or empty list if value is empty * @since 7.7 */ + @Override public List getLinesBetween(int start, int end) { return getLinesBetween(start, end, 0); } @@ -327,6 +329,7 @@ public List getLinesBetween(int start, int end) { * @return found lines or empty list if lines are not present or the offset is invalid * @since 7.7 */ + @Override public List getLinesBetween(int start, int end, int offset) { Field77J cp = newInstance(this); return SwiftParseUtils.getLines(getLine(cp, start, end, offset)); diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field77L.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field77L.java index ef5fd162c..13251cdaf 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field77L.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field77L.java @@ -30,12 +30,9 @@ import com.prowidesoftware.swift.model.field.MultiLineField; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -185,19 +182,16 @@ public String getValue() { */ @Override public String getValueDisplay(int component, Locale locale) { - if (component < 1 || component > 1) { + if (component != 1) { throw new IllegalArgumentException("invalid component number " + component + " for field 77L"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -403,7 +397,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field77L(f)); } @@ -419,6 +413,7 @@ public static List getAll(final SwiftTagListBlock block) { * @return line content or null if not present or if line number is above the expected * @since 7.7 */ + @Override public String getLine(int line) { return getLine(line, 0); } @@ -432,6 +427,7 @@ public String getLine(int line) { * @return line content or null if not present or if line number is above the expected * @since 7.7 */ + @Override public String getLine(int line, int offset) { Field77L cp = newInstance(this); return getLine(cp, line, null, offset); @@ -444,6 +440,7 @@ public String getLine(int line, int offset) { * @return lines content or empty list if field's value is empty * @since 7.7 */ + @Override public List getLines() { return SwiftParseUtils.getLines(getValue()); } @@ -456,6 +453,7 @@ public List getLines() { * @return found lines or empty list if lines are not present or the offset is invalid * @since 7.7 */ + @Override public List getLines(int offset) { Field77L cp = newInstance(this); return SwiftParseUtils.getLines(getLine(cp, null, null, offset)); @@ -470,6 +468,7 @@ public List getLines(int offset) { * @return found lines or empty list if value is empty * @since 7.7 */ + @Override public List getLinesBetween(int start, int end) { return getLinesBetween(start, end, 0); } @@ -484,6 +483,7 @@ public List getLinesBetween(int start, int end) { * @return found lines or empty list if lines are not present or the offset is invalid * @since 7.7 */ + @Override public List getLinesBetween(int start, int end, int offset) { Field77L cp = newInstance(this); return SwiftParseUtils.getLines(getLine(cp, start, end, offset)); diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field77T.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field77T.java index 4ede0e5cc..8bc13dceb 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field77T.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field77T.java @@ -30,12 +30,9 @@ import com.prowidesoftware.swift.model.field.MultiLineField; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -184,19 +181,16 @@ public String getValue() { */ @Override public String getValueDisplay(int component, Locale locale) { - if (component < 1 || component > 1) { + if (component != 1) { throw new IllegalArgumentException("invalid component number " + component + " for field 77T"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -399,7 +393,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field77T(f)); } @@ -415,6 +409,7 @@ public static List getAll(final SwiftTagListBlock block) { * @return line content or null if not present or if line number is above the expected * @since 7.7 */ + @Override public String getLine(int line) { return getLine(line, 0); } @@ -428,6 +423,7 @@ public String getLine(int line) { * @return line content or null if not present or if line number is above the expected * @since 7.7 */ + @Override public String getLine(int line, int offset) { Field77T cp = newInstance(this); return getLine(cp, line, null, offset); @@ -440,6 +436,7 @@ public String getLine(int line, int offset) { * @return lines content or empty list if field's value is empty * @since 7.7 */ + @Override public List getLines() { return SwiftParseUtils.getLines(getValue()); } @@ -452,6 +449,7 @@ public List getLines() { * @return found lines or empty list if lines are not present or the offset is invalid * @since 7.7 */ + @Override public List getLines(int offset) { Field77T cp = newInstance(this); return SwiftParseUtils.getLines(getLine(cp, null, null, offset)); @@ -466,6 +464,7 @@ public List getLines(int offset) { * @return found lines or empty list if value is empty * @since 7.7 */ + @Override public List getLinesBetween(int start, int end) { return getLinesBetween(start, end, 0); } @@ -480,6 +479,7 @@ public List getLinesBetween(int start, int end) { * @return found lines or empty list if lines are not present or the offset is invalid * @since 7.7 */ + @Override public List getLinesBetween(int start, int end, int offset) { Field77T cp = newInstance(this); return SwiftParseUtils.getLines(getLine(cp, start, end, offset)); diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field77U.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field77U.java index 5483e2aa2..8f9325670 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field77U.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field77U.java @@ -30,12 +30,9 @@ import com.prowidesoftware.swift.model.field.MultiLineField; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -184,19 +181,16 @@ public String getValue() { */ @Override public String getValueDisplay(int component, Locale locale) { - if (component < 1 || component > 1) { + if (component != 1) { throw new IllegalArgumentException("invalid component number " + component + " for field 77U"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -399,7 +393,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field77U(f)); } @@ -415,6 +409,7 @@ public static List getAll(final SwiftTagListBlock block) { * @return line content or null if not present or if line number is above the expected * @since 7.7 */ + @Override public String getLine(int line) { return getLine(line, 0); } @@ -428,6 +423,7 @@ public String getLine(int line) { * @return line content or null if not present or if line number is above the expected * @since 7.7 */ + @Override public String getLine(int line, int offset) { Field77U cp = newInstance(this); return getLine(cp, line, null, offset); @@ -440,6 +436,7 @@ public String getLine(int line, int offset) { * @return lines content or empty list if field's value is empty * @since 7.7 */ + @Override public List getLines() { return SwiftParseUtils.getLines(getValue()); } @@ -452,6 +449,7 @@ public List getLines() { * @return found lines or empty list if lines are not present or the offset is invalid * @since 7.7 */ + @Override public List getLines(int offset) { Field77U cp = newInstance(this); return SwiftParseUtils.getLines(getLine(cp, null, null, offset)); @@ -466,6 +464,7 @@ public List getLines(int offset) { * @return found lines or empty list if value is empty * @since 7.7 */ + @Override public List getLinesBetween(int start, int end) { return getLinesBetween(start, end, 0); } @@ -480,6 +479,7 @@ public List getLinesBetween(int start, int end) { * @return found lines or empty list if lines are not present or the offset is invalid * @since 7.7 */ + @Override public List getLinesBetween(int start, int end, int offset) { Field77U cp = newInstance(this); return SwiftParseUtils.getLines(getLine(cp, start, end, offset)); diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field78.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field78.java index 318cad1b8..ddafde49a 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field78.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field78.java @@ -30,12 +30,9 @@ import com.prowidesoftware.swift.model.field.MultiLineField; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -243,16 +240,14 @@ public String getValueDisplay(int component, Locale locale) { //default format (as is) return getComponent(11); } - if (component == 12) { - //default format (as is) - return getComponent(12); - } - return null; + // This is the last component, return directly without `if` + //default format (as is) + return getComponent(12); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -968,7 +963,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field78(f)); } @@ -984,6 +979,7 @@ public static List getAll(final SwiftTagListBlock block) { * @return line content or null if not present or if line number is above the expected * @since 7.7 */ + @Override public String getLine(int line) { return getLine(line, 0); } @@ -997,6 +993,7 @@ public String getLine(int line) { * @return line content or null if not present or if line number is above the expected * @since 7.7 */ + @Override public String getLine(int line, int offset) { Field78 cp = newInstance(this); return getLine(cp, line, null, offset); @@ -1009,6 +1006,7 @@ public String getLine(int line, int offset) { * @return lines content or empty list if field's value is empty * @since 7.7 */ + @Override public List getLines() { return SwiftParseUtils.getLines(getValue()); } @@ -1021,6 +1019,7 @@ public List getLines() { * @return found lines or empty list if lines are not present or the offset is invalid * @since 7.7 */ + @Override public List getLines(int offset) { Field78 cp = newInstance(this); return SwiftParseUtils.getLines(getLine(cp, null, null, offset)); @@ -1035,6 +1034,7 @@ public List getLines(int offset) { * @return found lines or empty list if value is empty * @since 7.7 */ + @Override public List getLinesBetween(int start, int end) { return getLinesBetween(start, end, 0); } @@ -1049,6 +1049,7 @@ public List getLinesBetween(int start, int end) { * @return found lines or empty list if lines are not present or the offset is invalid * @since 7.7 */ + @Override public List getLinesBetween(int start, int end, int offset) { Field78 cp = newInstance(this); return SwiftParseUtils.getLines(getLine(cp, start, end, offset)); diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field78D.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field78D.java index c96f8b5a7..52a1bc23a 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field78D.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field78D.java @@ -30,12 +30,9 @@ import com.prowidesoftware.swift.model.field.MultiLineField; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -243,16 +240,14 @@ public String getValueDisplay(int component, Locale locale) { //default format (as is) return getComponent(11); } - if (component == 12) { - //default format (as is) - return getComponent(12); - } - return null; + // This is the last component, return directly without `if` + //default format (as is) + return getComponent(12); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -968,7 +963,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field78D(f)); } @@ -984,6 +979,7 @@ public static List getAll(final SwiftTagListBlock block) { * @return line content or null if not present or if line number is above the expected * @since 7.7 */ + @Override public String getLine(int line) { return getLine(line, 0); } @@ -997,6 +993,7 @@ public String getLine(int line) { * @return line content or null if not present or if line number is above the expected * @since 7.7 */ + @Override public String getLine(int line, int offset) { Field78D cp = newInstance(this); return getLine(cp, line, null, offset); @@ -1009,6 +1006,7 @@ public String getLine(int line, int offset) { * @return lines content or empty list if field's value is empty * @since 7.7 */ + @Override public List getLines() { return SwiftParseUtils.getLines(getValue()); } @@ -1021,6 +1019,7 @@ public List getLines() { * @return found lines or empty list if lines are not present or the offset is invalid * @since 7.7 */ + @Override public List getLines(int offset) { Field78D cp = newInstance(this); return SwiftParseUtils.getLines(getLine(cp, null, null, offset)); @@ -1035,6 +1034,7 @@ public List getLines(int offset) { * @return found lines or empty list if value is empty * @since 7.7 */ + @Override public List getLinesBetween(int start, int end) { return getLinesBetween(start, end, 0); } @@ -1049,6 +1049,7 @@ public List getLinesBetween(int start, int end) { * @return found lines or empty list if lines are not present or the offset is invalid * @since 7.7 */ + @Override public List getLinesBetween(int start, int end, int offset) { Field78D cp = newInstance(this); return SwiftParseUtils.getLines(getLine(cp, start, end, offset)); diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field79.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field79.java index 2cd1b98b1..74db17caf 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field79.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field79.java @@ -30,12 +30,9 @@ import com.prowidesoftware.swift.model.field.MultiLineField; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -358,16 +355,14 @@ public String getValueDisplay(int component, Locale locale) { //default format (as is) return getComponent(34); } - if (component == 35) { - //default format (as is) - return getComponent(35); - } - return null; + // This is the last component, return directly without `if` + //default format (as is) + return getComponent(35); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -2072,7 +2067,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field79(f)); } @@ -2088,6 +2083,7 @@ public static List getAll(final SwiftTagListBlock block) { * @return line content or null if not present or if line number is above the expected * @since 7.7 */ + @Override public String getLine(int line) { return getLine(line, 0); } @@ -2101,6 +2097,7 @@ public String getLine(int line) { * @return line content or null if not present or if line number is above the expected * @since 7.7 */ + @Override public String getLine(int line, int offset) { Field79 cp = newInstance(this); return getLine(cp, line, null, offset); @@ -2113,6 +2110,7 @@ public String getLine(int line, int offset) { * @return lines content or empty list if field's value is empty * @since 7.7 */ + @Override public List getLines() { return SwiftParseUtils.getLines(getValue()); } @@ -2125,6 +2123,7 @@ public List getLines() { * @return found lines or empty list if lines are not present or the offset is invalid * @since 7.7 */ + @Override public List getLines(int offset) { Field79 cp = newInstance(this); return SwiftParseUtils.getLines(getLine(cp, null, null, offset)); @@ -2139,6 +2138,7 @@ public List getLines(int offset) { * @return found lines or empty list if value is empty * @since 7.7 */ + @Override public List getLinesBetween(int start, int end) { return getLinesBetween(start, end, 0); } @@ -2153,6 +2153,7 @@ public List getLinesBetween(int start, int end) { * @return found lines or empty list if lines are not present or the offset is invalid * @since 7.7 */ + @Override public List getLinesBetween(int start, int end, int offset) { Field79 cp = newInstance(this); return SwiftParseUtils.getLines(getLine(cp, start, end, offset)); diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field79Z.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field79Z.java index 8c5cba0e0..412f72b48 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field79Z.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field79Z.java @@ -30,12 +30,9 @@ import com.prowidesoftware.swift.model.field.MultiLineField; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -358,16 +355,14 @@ public String getValueDisplay(int component, Locale locale) { //default format (as is) return getComponent(34); } - if (component == 35) { - //default format (as is) - return getComponent(35); - } - return null; + // This is the last component, return directly without `if` + //default format (as is) + return getComponent(35); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -2072,7 +2067,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field79Z(f)); } @@ -2088,6 +2083,7 @@ public static List getAll(final SwiftTagListBlock block) { * @return line content or null if not present or if line number is above the expected * @since 7.7 */ + @Override public String getLine(int line) { return getLine(line, 0); } @@ -2101,6 +2097,7 @@ public String getLine(int line) { * @return line content or null if not present or if line number is above the expected * @since 7.7 */ + @Override public String getLine(int line, int offset) { Field79Z cp = newInstance(this); return getLine(cp, line, null, offset); @@ -2113,6 +2110,7 @@ public String getLine(int line, int offset) { * @return lines content or empty list if field's value is empty * @since 7.7 */ + @Override public List getLines() { return SwiftParseUtils.getLines(getValue()); } @@ -2125,6 +2123,7 @@ public List getLines() { * @return found lines or empty list if lines are not present or the offset is invalid * @since 7.7 */ + @Override public List getLines(int offset) { Field79Z cp = newInstance(this); return SwiftParseUtils.getLines(getLine(cp, null, null, offset)); @@ -2139,6 +2138,7 @@ public List getLines(int offset) { * @return found lines or empty list if value is empty * @since 7.7 */ + @Override public List getLinesBetween(int start, int end) { return getLinesBetween(start, end, 0); } @@ -2153,6 +2153,7 @@ public List getLinesBetween(int start, int end) { * @return found lines or empty list if lines are not present or the offset is invalid * @since 7.7 */ + @Override public List getLinesBetween(int start, int end, int offset) { Field79Z cp = newInstance(this); return SwiftParseUtils.getLines(getLine(cp, start, end, offset)); diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field80C.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field80C.java index 206d5deb6..1f6df65c1 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field80C.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field80C.java @@ -30,12 +30,9 @@ import com.prowidesoftware.swift.model.field.MultiLineField; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -213,16 +210,14 @@ public String getValueDisplay(int component, Locale locale) { //default format (as is) return getComponent(5); } - if (component == 6) { - //default format (as is) - return getComponent(6); - } - return null; + // This is the last component, return directly without `if` + //default format (as is) + return getComponent(6); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -680,7 +675,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field80C(f)); } @@ -696,6 +691,7 @@ public static List getAll(final SwiftTagListBlock block) { * @return line content or null if not present or if line number is above the expected * @since 7.7 */ + @Override public String getLine(int line) { return getLine(line, 0); } @@ -709,6 +705,7 @@ public String getLine(int line) { * @return line content or null if not present or if line number is above the expected * @since 7.7 */ + @Override public String getLine(int line, int offset) { Field80C cp = newInstance(this); return getLine(cp, line, null, offset); @@ -721,6 +718,7 @@ public String getLine(int line, int offset) { * @return lines content or empty list if field's value is empty * @since 7.7 */ + @Override public List getLines() { return SwiftParseUtils.getLines(getValue()); } @@ -733,6 +731,7 @@ public List getLines() { * @return found lines or empty list if lines are not present or the offset is invalid * @since 7.7 */ + @Override public List getLines(int offset) { Field80C cp = newInstance(this); return SwiftParseUtils.getLines(getLine(cp, null, null, offset)); @@ -747,6 +746,7 @@ public List getLines(int offset) { * @return found lines or empty list if value is empty * @since 7.7 */ + @Override public List getLinesBetween(int start, int end) { return getLinesBetween(start, end, 0); } @@ -761,6 +761,7 @@ public List getLinesBetween(int start, int end) { * @return found lines or empty list if lines are not present or the offset is invalid * @since 7.7 */ + @Override public List getLinesBetween(int start, int end, int offset) { Field80C cp = newInstance(this); return SwiftParseUtils.getLines(getLine(cp, start, end, offset)); diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field81A.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field81A.java index f367b2172..ea296fb0f 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field81A.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field81A.java @@ -33,12 +33,9 @@ import com.prowidesoftware.swift.model.field.BICContainer; import com.prowidesoftware.swift.model.field.BICResolver; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -242,10 +239,12 @@ public Field81A setIdentifierCode(com.prowidesoftware.swift.model.BIC component3 } + @Override public List bics() { return BICResolver.bics(this); } + @Override public List bicStrings () { return BICResolver.bicStrings(this); } @@ -314,7 +313,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field81A(f)); } @@ -330,6 +329,7 @@ public static List getAll(final SwiftTagListBlock block) { * @return line content or null if not present or if line number is above the expected * @since 7.7 */ + @Override public String getLine(int line) { return getLine(line, 0); } @@ -343,6 +343,7 @@ public String getLine(int line) { * @return line content or null if not present or if line number is above the expected * @since 7.7 */ + @Override public String getLine(int line, int offset) { Field81A cp = newInstance(this); return getLine(cp, line, null, offset); @@ -355,6 +356,7 @@ public String getLine(int line, int offset) { * @return lines content or empty list if field's value is empty * @since 7.7 */ + @Override public List getLines() { return SwiftParseUtils.getLines(getValue()); } @@ -367,6 +369,7 @@ public List getLines() { * @return found lines or empty list if lines are not present or the offset is invalid * @since 7.7 */ + @Override public List getLines(int offset) { Field81A cp = newInstance(this); return SwiftParseUtils.getLines(getLine(cp, null, null, offset)); @@ -381,6 +384,7 @@ public List getLines(int offset) { * @return found lines or empty list if value is empty * @since 7.7 */ + @Override public List getLinesBetween(int start, int end) { return getLinesBetween(start, end, 0); } @@ -395,6 +399,7 @@ public List getLinesBetween(int start, int end) { * @return found lines or empty list if lines are not present or the offset is invalid * @since 7.7 */ + @Override public List getLinesBetween(int start, int end, int offset) { Field81A cp = newInstance(this); return SwiftParseUtils.getLines(getLine(cp, start, end, offset)); diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field81D.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field81D.java index c918b925a..b2c99ea08 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field81D.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field81D.java @@ -30,12 +30,9 @@ import com.prowidesoftware.swift.model.field.MultiLineField; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -358,7 +355,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field81D(f)); } @@ -374,6 +371,7 @@ public static List getAll(final SwiftTagListBlock block) { * @return line content or null if not present or if line number is above the expected * @since 7.7 */ + @Override public String getLine(int line) { return getLine(line, 0); } @@ -387,6 +385,7 @@ public String getLine(int line) { * @return line content or null if not present or if line number is above the expected * @since 7.7 */ + @Override public String getLine(int line, int offset) { Field81D cp = newInstance(this); return getLine(cp, line, null, offset); @@ -399,6 +398,7 @@ public String getLine(int line, int offset) { * @return lines content or empty list if field's value is empty * @since 7.7 */ + @Override public List getLines() { return SwiftParseUtils.getLines(getValue()); } @@ -411,6 +411,7 @@ public List getLines() { * @return found lines or empty list if lines are not present or the offset is invalid * @since 7.7 */ + @Override public List getLines(int offset) { Field81D cp = newInstance(this); return SwiftParseUtils.getLines(getLine(cp, null, null, offset)); @@ -425,6 +426,7 @@ public List getLines(int offset) { * @return found lines or empty list if value is empty * @since 7.7 */ + @Override public List getLinesBetween(int start, int end) { return getLinesBetween(start, end, 0); } @@ -439,6 +441,7 @@ public List getLinesBetween(int start, int end) { * @return found lines or empty list if lines are not present or the offset is invalid * @since 7.7 */ + @Override public List getLinesBetween(int start, int end, int offset) { Field81D cp = newInstance(this); return SwiftParseUtils.getLines(getLine(cp, start, end, offset)); diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field81J.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field81J.java index 6348618be..63020512a 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field81J.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field81J.java @@ -29,12 +29,9 @@ -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -235,7 +232,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field81J(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field82A.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field82A.java index 68e5aa61d..849bdc9b0 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field82A.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field82A.java @@ -33,12 +33,9 @@ import com.prowidesoftware.swift.model.field.BICContainer; import com.prowidesoftware.swift.model.field.BICResolver; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -242,10 +239,12 @@ public Field82A setIdentifierCode(com.prowidesoftware.swift.model.BIC component3 } + @Override public List bics() { return BICResolver.bics(this); } + @Override public List bicStrings () { return BICResolver.bicStrings(this); } @@ -314,7 +313,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field82A(f)); } @@ -330,6 +329,7 @@ public static List getAll(final SwiftTagListBlock block) { * @return line content or null if not present or if line number is above the expected * @since 7.7 */ + @Override public String getLine(int line) { return getLine(line, 0); } @@ -343,6 +343,7 @@ public String getLine(int line) { * @return line content or null if not present or if line number is above the expected * @since 7.7 */ + @Override public String getLine(int line, int offset) { Field82A cp = newInstance(this); return getLine(cp, line, null, offset); @@ -355,6 +356,7 @@ public String getLine(int line, int offset) { * @return lines content or empty list if field's value is empty * @since 7.7 */ + @Override public List getLines() { return SwiftParseUtils.getLines(getValue()); } @@ -367,6 +369,7 @@ public List getLines() { * @return found lines or empty list if lines are not present or the offset is invalid * @since 7.7 */ + @Override public List getLines(int offset) { Field82A cp = newInstance(this); return SwiftParseUtils.getLines(getLine(cp, null, null, offset)); @@ -381,6 +384,7 @@ public List getLines(int offset) { * @return found lines or empty list if value is empty * @since 7.7 */ + @Override public List getLinesBetween(int start, int end) { return getLinesBetween(start, end, 0); } @@ -395,6 +399,7 @@ public List getLinesBetween(int start, int end) { * @return found lines or empty list if lines are not present or the offset is invalid * @since 7.7 */ + @Override public List getLinesBetween(int start, int end, int offset) { Field82A cp = newInstance(this); return SwiftParseUtils.getLines(getLine(cp, start, end, offset)); diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field82B.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field82B.java index 8bbea10fb..be6c42813 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field82B.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field82B.java @@ -30,12 +30,9 @@ import com.prowidesoftware.swift.model.field.MultiLineField; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -280,7 +277,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field82B(f)); } @@ -296,6 +293,7 @@ public static List getAll(final SwiftTagListBlock block) { * @return line content or null if not present or if line number is above the expected * @since 7.7 */ + @Override public String getLine(int line) { return getLine(line, 0); } @@ -309,6 +307,7 @@ public String getLine(int line) { * @return line content or null if not present or if line number is above the expected * @since 7.7 */ + @Override public String getLine(int line, int offset) { Field82B cp = newInstance(this); return getLine(cp, line, null, offset); @@ -321,6 +320,7 @@ public String getLine(int line, int offset) { * @return lines content or empty list if field's value is empty * @since 7.7 */ + @Override public List getLines() { return SwiftParseUtils.getLines(getValue()); } @@ -333,6 +333,7 @@ public List getLines() { * @return found lines or empty list if lines are not present or the offset is invalid * @since 7.7 */ + @Override public List getLines(int offset) { Field82B cp = newInstance(this); return SwiftParseUtils.getLines(getLine(cp, null, null, offset)); @@ -347,6 +348,7 @@ public List getLines(int offset) { * @return found lines or empty list if value is empty * @since 7.7 */ + @Override public List getLinesBetween(int start, int end) { return getLinesBetween(start, end, 0); } @@ -361,6 +363,7 @@ public List getLinesBetween(int start, int end) { * @return found lines or empty list if lines are not present or the offset is invalid * @since 7.7 */ + @Override public List getLinesBetween(int start, int end, int offset) { Field82B cp = newInstance(this); return SwiftParseUtils.getLines(getLine(cp, start, end, offset)); diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field82D.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field82D.java index c1f33e8b3..cae1223a6 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field82D.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field82D.java @@ -30,12 +30,9 @@ import com.prowidesoftware.swift.model.field.MultiLineField; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -358,7 +355,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field82D(f)); } @@ -374,6 +371,7 @@ public static List getAll(final SwiftTagListBlock block) { * @return line content or null if not present or if line number is above the expected * @since 7.7 */ + @Override public String getLine(int line) { return getLine(line, 0); } @@ -387,6 +385,7 @@ public String getLine(int line) { * @return line content or null if not present or if line number is above the expected * @since 7.7 */ + @Override public String getLine(int line, int offset) { Field82D cp = newInstance(this); return getLine(cp, line, null, offset); @@ -399,6 +398,7 @@ public String getLine(int line, int offset) { * @return lines content or empty list if field's value is empty * @since 7.7 */ + @Override public List getLines() { return SwiftParseUtils.getLines(getValue()); } @@ -411,6 +411,7 @@ public List getLines() { * @return found lines or empty list if lines are not present or the offset is invalid * @since 7.7 */ + @Override public List getLines(int offset) { Field82D cp = newInstance(this); return SwiftParseUtils.getLines(getLine(cp, null, null, offset)); @@ -425,6 +426,7 @@ public List getLines(int offset) { * @return found lines or empty list if value is empty * @since 7.7 */ + @Override public List getLinesBetween(int start, int end) { return getLinesBetween(start, end, 0); } @@ -439,6 +441,7 @@ public List getLinesBetween(int start, int end) { * @return found lines or empty list if lines are not present or the offset is invalid * @since 7.7 */ + @Override public List getLinesBetween(int start, int end, int offset) { Field82D cp = newInstance(this); return SwiftParseUtils.getLines(getLine(cp, start, end, offset)); diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field82J.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field82J.java index a79dda465..1f79a5ccb 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field82J.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field82J.java @@ -29,12 +29,9 @@ -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -235,7 +232,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field82J(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field83A.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field83A.java index 92fb3f74c..90c8c8111 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field83A.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field83A.java @@ -33,12 +33,9 @@ import com.prowidesoftware.swift.model.field.BICContainer; import com.prowidesoftware.swift.model.field.BICResolver; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -242,10 +239,12 @@ public Field83A setIdentifierCode(com.prowidesoftware.swift.model.BIC component3 } + @Override public List bics() { return BICResolver.bics(this); } + @Override public List bicStrings () { return BICResolver.bicStrings(this); } @@ -314,7 +313,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field83A(f)); } @@ -330,6 +329,7 @@ public static List getAll(final SwiftTagListBlock block) { * @return line content or null if not present or if line number is above the expected * @since 7.7 */ + @Override public String getLine(int line) { return getLine(line, 0); } @@ -343,6 +343,7 @@ public String getLine(int line) { * @return line content or null if not present or if line number is above the expected * @since 7.7 */ + @Override public String getLine(int line, int offset) { Field83A cp = newInstance(this); return getLine(cp, line, null, offset); @@ -355,6 +356,7 @@ public String getLine(int line, int offset) { * @return lines content or empty list if field's value is empty * @since 7.7 */ + @Override public List getLines() { return SwiftParseUtils.getLines(getValue()); } @@ -367,6 +369,7 @@ public List getLines() { * @return found lines or empty list if lines are not present or the offset is invalid * @since 7.7 */ + @Override public List getLines(int offset) { Field83A cp = newInstance(this); return SwiftParseUtils.getLines(getLine(cp, null, null, offset)); @@ -381,6 +384,7 @@ public List getLines(int offset) { * @return found lines or empty list if value is empty * @since 7.7 */ + @Override public List getLinesBetween(int start, int end) { return getLinesBetween(start, end, 0); } @@ -395,6 +399,7 @@ public List getLinesBetween(int start, int end) { * @return found lines or empty list if lines are not present or the offset is invalid * @since 7.7 */ + @Override public List getLinesBetween(int start, int end, int offset) { Field83A cp = newInstance(this); return SwiftParseUtils.getLines(getLine(cp, start, end, offset)); diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field83C.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field83C.java index b4dc4ab5d..6194cb5fd 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field83C.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field83C.java @@ -29,12 +29,9 @@ -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -235,7 +232,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field83C(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field83D.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field83D.java index b27f84b25..12cd8be78 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field83D.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field83D.java @@ -30,12 +30,9 @@ import com.prowidesoftware.swift.model.field.MultiLineField; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -358,7 +355,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field83D(f)); } @@ -374,6 +371,7 @@ public static List getAll(final SwiftTagListBlock block) { * @return line content or null if not present or if line number is above the expected * @since 7.7 */ + @Override public String getLine(int line) { return getLine(line, 0); } @@ -387,6 +385,7 @@ public String getLine(int line) { * @return line content or null if not present or if line number is above the expected * @since 7.7 */ + @Override public String getLine(int line, int offset) { Field83D cp = newInstance(this); return getLine(cp, line, null, offset); @@ -399,6 +398,7 @@ public String getLine(int line, int offset) { * @return lines content or empty list if field's value is empty * @since 7.7 */ + @Override public List getLines() { return SwiftParseUtils.getLines(getValue()); } @@ -411,6 +411,7 @@ public List getLines() { * @return found lines or empty list if lines are not present or the offset is invalid * @since 7.7 */ + @Override public List getLines(int offset) { Field83D cp = newInstance(this); return SwiftParseUtils.getLines(getLine(cp, null, null, offset)); @@ -425,6 +426,7 @@ public List getLines(int offset) { * @return found lines or empty list if value is empty * @since 7.7 */ + @Override public List getLinesBetween(int start, int end) { return getLinesBetween(start, end, 0); } @@ -439,6 +441,7 @@ public List getLinesBetween(int start, int end) { * @return found lines or empty list if lines are not present or the offset is invalid * @since 7.7 */ + @Override public List getLinesBetween(int start, int end, int offset) { Field83D cp = newInstance(this); return SwiftParseUtils.getLines(getLine(cp, start, end, offset)); diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field83J.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field83J.java index 753a72dd7..b336a462a 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field83J.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field83J.java @@ -29,12 +29,9 @@ -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -235,7 +232,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field83J(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field84A.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field84A.java index ea9829c87..1f6c95325 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field84A.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field84A.java @@ -33,12 +33,9 @@ import com.prowidesoftware.swift.model.field.BICContainer; import com.prowidesoftware.swift.model.field.BICResolver; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -242,10 +239,12 @@ public Field84A setIdentifierCode(com.prowidesoftware.swift.model.BIC component3 } + @Override public List bics() { return BICResolver.bics(this); } + @Override public List bicStrings () { return BICResolver.bicStrings(this); } @@ -314,7 +313,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field84A(f)); } @@ -330,6 +329,7 @@ public static List getAll(final SwiftTagListBlock block) { * @return line content or null if not present or if line number is above the expected * @since 7.7 */ + @Override public String getLine(int line) { return getLine(line, 0); } @@ -343,6 +343,7 @@ public String getLine(int line) { * @return line content or null if not present or if line number is above the expected * @since 7.7 */ + @Override public String getLine(int line, int offset) { Field84A cp = newInstance(this); return getLine(cp, line, null, offset); @@ -355,6 +356,7 @@ public String getLine(int line, int offset) { * @return lines content or empty list if field's value is empty * @since 7.7 */ + @Override public List getLines() { return SwiftParseUtils.getLines(getValue()); } @@ -367,6 +369,7 @@ public List getLines() { * @return found lines or empty list if lines are not present or the offset is invalid * @since 7.7 */ + @Override public List getLines(int offset) { Field84A cp = newInstance(this); return SwiftParseUtils.getLines(getLine(cp, null, null, offset)); @@ -381,6 +384,7 @@ public List getLines(int offset) { * @return found lines or empty list if value is empty * @since 7.7 */ + @Override public List getLinesBetween(int start, int end) { return getLinesBetween(start, end, 0); } @@ -395,6 +399,7 @@ public List getLinesBetween(int start, int end) { * @return found lines or empty list if lines are not present or the offset is invalid * @since 7.7 */ + @Override public List getLinesBetween(int start, int end, int offset) { Field84A cp = newInstance(this); return SwiftParseUtils.getLines(getLine(cp, start, end, offset)); diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field84B.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field84B.java index e022061f1..30c2daf57 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field84B.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field84B.java @@ -30,12 +30,9 @@ import com.prowidesoftware.swift.model.field.MultiLineField; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -280,7 +277,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field84B(f)); } @@ -296,6 +293,7 @@ public static List getAll(final SwiftTagListBlock block) { * @return line content or null if not present or if line number is above the expected * @since 7.7 */ + @Override public String getLine(int line) { return getLine(line, 0); } @@ -309,6 +307,7 @@ public String getLine(int line) { * @return line content or null if not present or if line number is above the expected * @since 7.7 */ + @Override public String getLine(int line, int offset) { Field84B cp = newInstance(this); return getLine(cp, line, null, offset); @@ -321,6 +320,7 @@ public String getLine(int line, int offset) { * @return lines content or empty list if field's value is empty * @since 7.7 */ + @Override public List getLines() { return SwiftParseUtils.getLines(getValue()); } @@ -333,6 +333,7 @@ public List getLines() { * @return found lines or empty list if lines are not present or the offset is invalid * @since 7.7 */ + @Override public List getLines(int offset) { Field84B cp = newInstance(this); return SwiftParseUtils.getLines(getLine(cp, null, null, offset)); @@ -347,6 +348,7 @@ public List getLines(int offset) { * @return found lines or empty list if value is empty * @since 7.7 */ + @Override public List getLinesBetween(int start, int end) { return getLinesBetween(start, end, 0); } @@ -361,6 +363,7 @@ public List getLinesBetween(int start, int end) { * @return found lines or empty list if lines are not present or the offset is invalid * @since 7.7 */ + @Override public List getLinesBetween(int start, int end, int offset) { Field84B cp = newInstance(this); return SwiftParseUtils.getLines(getLine(cp, start, end, offset)); diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field84D.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field84D.java index eb2a7d57e..fc1d97aab 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field84D.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field84D.java @@ -30,12 +30,9 @@ import com.prowidesoftware.swift.model.field.MultiLineField; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -358,7 +355,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field84D(f)); } @@ -374,6 +371,7 @@ public static List getAll(final SwiftTagListBlock block) { * @return line content or null if not present or if line number is above the expected * @since 7.7 */ + @Override public String getLine(int line) { return getLine(line, 0); } @@ -387,6 +385,7 @@ public String getLine(int line) { * @return line content or null if not present or if line number is above the expected * @since 7.7 */ + @Override public String getLine(int line, int offset) { Field84D cp = newInstance(this); return getLine(cp, line, null, offset); @@ -399,6 +398,7 @@ public String getLine(int line, int offset) { * @return lines content or empty list if field's value is empty * @since 7.7 */ + @Override public List getLines() { return SwiftParseUtils.getLines(getValue()); } @@ -411,6 +411,7 @@ public List getLines() { * @return found lines or empty list if lines are not present or the offset is invalid * @since 7.7 */ + @Override public List getLines(int offset) { Field84D cp = newInstance(this); return SwiftParseUtils.getLines(getLine(cp, null, null, offset)); @@ -425,6 +426,7 @@ public List getLines(int offset) { * @return found lines or empty list if value is empty * @since 7.7 */ + @Override public List getLinesBetween(int start, int end) { return getLinesBetween(start, end, 0); } @@ -439,6 +441,7 @@ public List getLinesBetween(int start, int end) { * @return found lines or empty list if lines are not present or the offset is invalid * @since 7.7 */ + @Override public List getLinesBetween(int start, int end, int offset) { Field84D cp = newInstance(this); return SwiftParseUtils.getLines(getLine(cp, start, end, offset)); diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field84J.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field84J.java index dfcf6def5..1ab50dab0 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field84J.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field84J.java @@ -29,12 +29,9 @@ -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -235,7 +232,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field84J(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field85A.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field85A.java index 4b7e55832..6102b39ec 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field85A.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field85A.java @@ -33,12 +33,9 @@ import com.prowidesoftware.swift.model.field.BICContainer; import com.prowidesoftware.swift.model.field.BICResolver; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -242,10 +239,12 @@ public Field85A setIdentifierCode(com.prowidesoftware.swift.model.BIC component3 } + @Override public List bics() { return BICResolver.bics(this); } + @Override public List bicStrings () { return BICResolver.bicStrings(this); } @@ -314,7 +313,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field85A(f)); } @@ -330,6 +329,7 @@ public static List getAll(final SwiftTagListBlock block) { * @return line content or null if not present or if line number is above the expected * @since 7.7 */ + @Override public String getLine(int line) { return getLine(line, 0); } @@ -343,6 +343,7 @@ public String getLine(int line) { * @return line content or null if not present or if line number is above the expected * @since 7.7 */ + @Override public String getLine(int line, int offset) { Field85A cp = newInstance(this); return getLine(cp, line, null, offset); @@ -355,6 +356,7 @@ public String getLine(int line, int offset) { * @return lines content or empty list if field's value is empty * @since 7.7 */ + @Override public List getLines() { return SwiftParseUtils.getLines(getValue()); } @@ -367,6 +369,7 @@ public List getLines() { * @return found lines or empty list if lines are not present or the offset is invalid * @since 7.7 */ + @Override public List getLines(int offset) { Field85A cp = newInstance(this); return SwiftParseUtils.getLines(getLine(cp, null, null, offset)); @@ -381,6 +384,7 @@ public List getLines(int offset) { * @return found lines or empty list if value is empty * @since 7.7 */ + @Override public List getLinesBetween(int start, int end) { return getLinesBetween(start, end, 0); } @@ -395,6 +399,7 @@ public List getLinesBetween(int start, int end) { * @return found lines or empty list if lines are not present or the offset is invalid * @since 7.7 */ + @Override public List getLinesBetween(int start, int end, int offset) { Field85A cp = newInstance(this); return SwiftParseUtils.getLines(getLine(cp, start, end, offset)); diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field85B.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field85B.java index eb20de7e6..83b8af880 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field85B.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field85B.java @@ -30,12 +30,9 @@ import com.prowidesoftware.swift.model.field.MultiLineField; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -280,7 +277,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field85B(f)); } @@ -296,6 +293,7 @@ public static List getAll(final SwiftTagListBlock block) { * @return line content or null if not present or if line number is above the expected * @since 7.7 */ + @Override public String getLine(int line) { return getLine(line, 0); } @@ -309,6 +307,7 @@ public String getLine(int line) { * @return line content or null if not present or if line number is above the expected * @since 7.7 */ + @Override public String getLine(int line, int offset) { Field85B cp = newInstance(this); return getLine(cp, line, null, offset); @@ -321,6 +320,7 @@ public String getLine(int line, int offset) { * @return lines content or empty list if field's value is empty * @since 7.7 */ + @Override public List getLines() { return SwiftParseUtils.getLines(getValue()); } @@ -333,6 +333,7 @@ public List getLines() { * @return found lines or empty list if lines are not present or the offset is invalid * @since 7.7 */ + @Override public List getLines(int offset) { Field85B cp = newInstance(this); return SwiftParseUtils.getLines(getLine(cp, null, null, offset)); @@ -347,6 +348,7 @@ public List getLines(int offset) { * @return found lines or empty list if value is empty * @since 7.7 */ + @Override public List getLinesBetween(int start, int end) { return getLinesBetween(start, end, 0); } @@ -361,6 +363,7 @@ public List getLinesBetween(int start, int end) { * @return found lines or empty list if lines are not present or the offset is invalid * @since 7.7 */ + @Override public List getLinesBetween(int start, int end, int offset) { Field85B cp = newInstance(this); return SwiftParseUtils.getLines(getLine(cp, start, end, offset)); diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field85D.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field85D.java index 3c4ca32c0..c89daf0de 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field85D.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field85D.java @@ -30,12 +30,9 @@ import com.prowidesoftware.swift.model.field.MultiLineField; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -358,7 +355,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field85D(f)); } @@ -374,6 +371,7 @@ public static List getAll(final SwiftTagListBlock block) { * @return line content or null if not present or if line number is above the expected * @since 7.7 */ + @Override public String getLine(int line) { return getLine(line, 0); } @@ -387,6 +385,7 @@ public String getLine(int line) { * @return line content or null if not present or if line number is above the expected * @since 7.7 */ + @Override public String getLine(int line, int offset) { Field85D cp = newInstance(this); return getLine(cp, line, null, offset); @@ -399,6 +398,7 @@ public String getLine(int line, int offset) { * @return lines content or empty list if field's value is empty * @since 7.7 */ + @Override public List getLines() { return SwiftParseUtils.getLines(getValue()); } @@ -411,6 +411,7 @@ public List getLines() { * @return found lines or empty list if lines are not present or the offset is invalid * @since 7.7 */ + @Override public List getLines(int offset) { Field85D cp = newInstance(this); return SwiftParseUtils.getLines(getLine(cp, null, null, offset)); @@ -425,6 +426,7 @@ public List getLines(int offset) { * @return found lines or empty list if value is empty * @since 7.7 */ + @Override public List getLinesBetween(int start, int end) { return getLinesBetween(start, end, 0); } @@ -439,6 +441,7 @@ public List getLinesBetween(int start, int end) { * @return found lines or empty list if lines are not present or the offset is invalid * @since 7.7 */ + @Override public List getLinesBetween(int start, int end, int offset) { Field85D cp = newInstance(this); return SwiftParseUtils.getLines(getLine(cp, start, end, offset)); diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field85J.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field85J.java index 05cd0d119..6454db13d 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field85J.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field85J.java @@ -29,12 +29,9 @@ -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -235,7 +232,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field85J(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field86.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field86.java index 33f2922ed..d21d9fbd6 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field86.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field86.java @@ -30,12 +30,9 @@ import com.prowidesoftware.swift.model.field.MultiLineField; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -213,16 +210,14 @@ public String getValueDisplay(int component, Locale locale) { //default format (as is) return getComponent(5); } - if (component == 6) { - //default format (as is) - return getComponent(6); - } - return null; + // This is the last component, return directly without `if` + //default format (as is) + return getComponent(6); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -680,7 +675,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field86(f)); } @@ -696,6 +691,7 @@ public static List getAll(final SwiftTagListBlock block) { * @return line content or null if not present or if line number is above the expected * @since 7.7 */ + @Override public String getLine(int line) { return getLine(line, 0); } @@ -709,6 +705,7 @@ public String getLine(int line) { * @return line content or null if not present or if line number is above the expected * @since 7.7 */ + @Override public String getLine(int line, int offset) { Field86 cp = newInstance(this); return getLine(cp, line, null, offset); @@ -721,6 +718,7 @@ public String getLine(int line, int offset) { * @return lines content or empty list if field's value is empty * @since 7.7 */ + @Override public List getLines() { return SwiftParseUtils.getLines(getValue()); } @@ -733,6 +731,7 @@ public List getLines() { * @return found lines or empty list if lines are not present or the offset is invalid * @since 7.7 */ + @Override public List getLines(int offset) { Field86 cp = newInstance(this); return SwiftParseUtils.getLines(getLine(cp, null, null, offset)); @@ -747,6 +746,7 @@ public List getLines(int offset) { * @return found lines or empty list if value is empty * @since 7.7 */ + @Override public List getLinesBetween(int start, int end) { return getLinesBetween(start, end, 0); } @@ -761,6 +761,7 @@ public List getLinesBetween(int start, int end) { * @return found lines or empty list if lines are not present or the offset is invalid * @since 7.7 */ + @Override public List getLinesBetween(int start, int end, int offset) { Field86 cp = newInstance(this); return SwiftParseUtils.getLines(getLine(cp, start, end, offset)); diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field86A.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field86A.java index 49b950f14..a78a16b10 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field86A.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field86A.java @@ -33,12 +33,9 @@ import com.prowidesoftware.swift.model.field.BICContainer; import com.prowidesoftware.swift.model.field.BICResolver; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -242,10 +239,12 @@ public Field86A setIdentifierCode(com.prowidesoftware.swift.model.BIC component3 } + @Override public List bics() { return BICResolver.bics(this); } + @Override public List bicStrings () { return BICResolver.bicStrings(this); } @@ -314,7 +313,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field86A(f)); } @@ -330,6 +329,7 @@ public static List getAll(final SwiftTagListBlock block) { * @return line content or null if not present or if line number is above the expected * @since 7.7 */ + @Override public String getLine(int line) { return getLine(line, 0); } @@ -343,6 +343,7 @@ public String getLine(int line) { * @return line content or null if not present or if line number is above the expected * @since 7.7 */ + @Override public String getLine(int line, int offset) { Field86A cp = newInstance(this); return getLine(cp, line, null, offset); @@ -355,6 +356,7 @@ public String getLine(int line, int offset) { * @return lines content or empty list if field's value is empty * @since 7.7 */ + @Override public List getLines() { return SwiftParseUtils.getLines(getValue()); } @@ -367,6 +369,7 @@ public List getLines() { * @return found lines or empty list if lines are not present or the offset is invalid * @since 7.7 */ + @Override public List getLines(int offset) { Field86A cp = newInstance(this); return SwiftParseUtils.getLines(getLine(cp, null, null, offset)); @@ -381,6 +384,7 @@ public List getLines(int offset) { * @return found lines or empty list if value is empty * @since 7.7 */ + @Override public List getLinesBetween(int start, int end) { return getLinesBetween(start, end, 0); } @@ -395,6 +399,7 @@ public List getLinesBetween(int start, int end) { * @return found lines or empty list if lines are not present or the offset is invalid * @since 7.7 */ + @Override public List getLinesBetween(int start, int end, int offset) { Field86A cp = newInstance(this); return SwiftParseUtils.getLines(getLine(cp, start, end, offset)); diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field86B.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field86B.java index 6df635a17..12949d59d 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field86B.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field86B.java @@ -30,12 +30,9 @@ import com.prowidesoftware.swift.model.field.MultiLineField; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -280,7 +277,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field86B(f)); } @@ -296,6 +293,7 @@ public static List getAll(final SwiftTagListBlock block) { * @return line content or null if not present or if line number is above the expected * @since 7.7 */ + @Override public String getLine(int line) { return getLine(line, 0); } @@ -309,6 +307,7 @@ public String getLine(int line) { * @return line content or null if not present or if line number is above the expected * @since 7.7 */ + @Override public String getLine(int line, int offset) { Field86B cp = newInstance(this); return getLine(cp, line, null, offset); @@ -321,6 +320,7 @@ public String getLine(int line, int offset) { * @return lines content or empty list if field's value is empty * @since 7.7 */ + @Override public List getLines() { return SwiftParseUtils.getLines(getValue()); } @@ -333,6 +333,7 @@ public List getLines() { * @return found lines or empty list if lines are not present or the offset is invalid * @since 7.7 */ + @Override public List getLines(int offset) { Field86B cp = newInstance(this); return SwiftParseUtils.getLines(getLine(cp, null, null, offset)); @@ -347,6 +348,7 @@ public List getLines(int offset) { * @return found lines or empty list if value is empty * @since 7.7 */ + @Override public List getLinesBetween(int start, int end) { return getLinesBetween(start, end, 0); } @@ -361,6 +363,7 @@ public List getLinesBetween(int start, int end) { * @return found lines or empty list if lines are not present or the offset is invalid * @since 7.7 */ + @Override public List getLinesBetween(int start, int end, int offset) { Field86B cp = newInstance(this); return SwiftParseUtils.getLines(getLine(cp, start, end, offset)); diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field86D.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field86D.java index 23b05c9e0..646e5a51b 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field86D.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field86D.java @@ -30,12 +30,9 @@ import com.prowidesoftware.swift.model.field.MultiLineField; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -358,7 +355,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field86D(f)); } @@ -374,6 +371,7 @@ public static List getAll(final SwiftTagListBlock block) { * @return line content or null if not present or if line number is above the expected * @since 7.7 */ + @Override public String getLine(int line) { return getLine(line, 0); } @@ -387,6 +385,7 @@ public String getLine(int line) { * @return line content or null if not present or if line number is above the expected * @since 7.7 */ + @Override public String getLine(int line, int offset) { Field86D cp = newInstance(this); return getLine(cp, line, null, offset); @@ -399,6 +398,7 @@ public String getLine(int line, int offset) { * @return lines content or empty list if field's value is empty * @since 7.7 */ + @Override public List getLines() { return SwiftParseUtils.getLines(getValue()); } @@ -411,6 +411,7 @@ public List getLines() { * @return found lines or empty list if lines are not present or the offset is invalid * @since 7.7 */ + @Override public List getLines(int offset) { Field86D cp = newInstance(this); return SwiftParseUtils.getLines(getLine(cp, null, null, offset)); @@ -425,6 +426,7 @@ public List getLines(int offset) { * @return found lines or empty list if value is empty * @since 7.7 */ + @Override public List getLinesBetween(int start, int end) { return getLinesBetween(start, end, 0); } @@ -439,6 +441,7 @@ public List getLinesBetween(int start, int end) { * @return found lines or empty list if lines are not present or the offset is invalid * @since 7.7 */ + @Override public List getLinesBetween(int start, int end, int offset) { Field86D cp = newInstance(this); return SwiftParseUtils.getLines(getLine(cp, start, end, offset)); diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field86J.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field86J.java index 1208b9f1c..f9582440f 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field86J.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field86J.java @@ -29,12 +29,9 @@ -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -235,7 +232,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field86J(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field87A.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field87A.java index 64b4cf985..08d913dca 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field87A.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field87A.java @@ -33,12 +33,9 @@ import com.prowidesoftware.swift.model.field.BICContainer; import com.prowidesoftware.swift.model.field.BICResolver; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -242,10 +239,12 @@ public Field87A setIdentifierCode(com.prowidesoftware.swift.model.BIC component3 } + @Override public List bics() { return BICResolver.bics(this); } + @Override public List bicStrings () { return BICResolver.bicStrings(this); } @@ -314,7 +313,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field87A(f)); } @@ -330,6 +329,7 @@ public static List getAll(final SwiftTagListBlock block) { * @return line content or null if not present or if line number is above the expected * @since 7.7 */ + @Override public String getLine(int line) { return getLine(line, 0); } @@ -343,6 +343,7 @@ public String getLine(int line) { * @return line content or null if not present or if line number is above the expected * @since 7.7 */ + @Override public String getLine(int line, int offset) { Field87A cp = newInstance(this); return getLine(cp, line, null, offset); @@ -355,6 +356,7 @@ public String getLine(int line, int offset) { * @return lines content or empty list if field's value is empty * @since 7.7 */ + @Override public List getLines() { return SwiftParseUtils.getLines(getValue()); } @@ -367,6 +369,7 @@ public List getLines() { * @return found lines or empty list if lines are not present or the offset is invalid * @since 7.7 */ + @Override public List getLines(int offset) { Field87A cp = newInstance(this); return SwiftParseUtils.getLines(getLine(cp, null, null, offset)); @@ -381,6 +384,7 @@ public List getLines(int offset) { * @return found lines or empty list if value is empty * @since 7.7 */ + @Override public List getLinesBetween(int start, int end) { return getLinesBetween(start, end, 0); } @@ -395,6 +399,7 @@ public List getLinesBetween(int start, int end) { * @return found lines or empty list if lines are not present or the offset is invalid * @since 7.7 */ + @Override public List getLinesBetween(int start, int end, int offset) { Field87A cp = newInstance(this); return SwiftParseUtils.getLines(getLine(cp, start, end, offset)); diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field87B.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field87B.java index 1b158ab4b..b26d1e991 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field87B.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field87B.java @@ -30,12 +30,9 @@ import com.prowidesoftware.swift.model.field.MultiLineField; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -280,7 +277,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field87B(f)); } @@ -296,6 +293,7 @@ public static List getAll(final SwiftTagListBlock block) { * @return line content or null if not present or if line number is above the expected * @since 7.7 */ + @Override public String getLine(int line) { return getLine(line, 0); } @@ -309,6 +307,7 @@ public String getLine(int line) { * @return line content or null if not present or if line number is above the expected * @since 7.7 */ + @Override public String getLine(int line, int offset) { Field87B cp = newInstance(this); return getLine(cp, line, null, offset); @@ -321,6 +320,7 @@ public String getLine(int line, int offset) { * @return lines content or empty list if field's value is empty * @since 7.7 */ + @Override public List getLines() { return SwiftParseUtils.getLines(getValue()); } @@ -333,6 +333,7 @@ public List getLines() { * @return found lines or empty list if lines are not present or the offset is invalid * @since 7.7 */ + @Override public List getLines(int offset) { Field87B cp = newInstance(this); return SwiftParseUtils.getLines(getLine(cp, null, null, offset)); @@ -347,6 +348,7 @@ public List getLines(int offset) { * @return found lines or empty list if value is empty * @since 7.7 */ + @Override public List getLinesBetween(int start, int end) { return getLinesBetween(start, end, 0); } @@ -361,6 +363,7 @@ public List getLinesBetween(int start, int end) { * @return found lines or empty list if lines are not present or the offset is invalid * @since 7.7 */ + @Override public List getLinesBetween(int start, int end, int offset) { Field87B cp = newInstance(this); return SwiftParseUtils.getLines(getLine(cp, start, end, offset)); diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field87D.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field87D.java index 5af757ea6..030944d90 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field87D.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field87D.java @@ -30,12 +30,9 @@ import com.prowidesoftware.swift.model.field.MultiLineField; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -358,7 +355,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field87D(f)); } @@ -374,6 +371,7 @@ public static List getAll(final SwiftTagListBlock block) { * @return line content or null if not present or if line number is above the expected * @since 7.7 */ + @Override public String getLine(int line) { return getLine(line, 0); } @@ -387,6 +385,7 @@ public String getLine(int line) { * @return line content or null if not present or if line number is above the expected * @since 7.7 */ + @Override public String getLine(int line, int offset) { Field87D cp = newInstance(this); return getLine(cp, line, null, offset); @@ -399,6 +398,7 @@ public String getLine(int line, int offset) { * @return lines content or empty list if field's value is empty * @since 7.7 */ + @Override public List getLines() { return SwiftParseUtils.getLines(getValue()); } @@ -411,6 +411,7 @@ public List getLines() { * @return found lines or empty list if lines are not present or the offset is invalid * @since 7.7 */ + @Override public List getLines(int offset) { Field87D cp = newInstance(this); return SwiftParseUtils.getLines(getLine(cp, null, null, offset)); @@ -425,6 +426,7 @@ public List getLines(int offset) { * @return found lines or empty list if value is empty * @since 7.7 */ + @Override public List getLinesBetween(int start, int end) { return getLinesBetween(start, end, 0); } @@ -439,6 +441,7 @@ public List getLinesBetween(int start, int end) { * @return found lines or empty list if lines are not present or the offset is invalid * @since 7.7 */ + @Override public List getLinesBetween(int start, int end, int offset) { Field87D cp = newInstance(this); return SwiftParseUtils.getLines(getLine(cp, start, end, offset)); diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field87J.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field87J.java index 8fc5b3729..97c88f59e 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field87J.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field87J.java @@ -29,12 +29,9 @@ -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -235,7 +232,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field87J(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field88A.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field88A.java index 98e7e25f9..0a4e00696 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field88A.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field88A.java @@ -33,12 +33,9 @@ import com.prowidesoftware.swift.model.field.BICContainer; import com.prowidesoftware.swift.model.field.BICResolver; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -242,10 +239,12 @@ public Field88A setIdentifierCode(com.prowidesoftware.swift.model.BIC component3 } + @Override public List bics() { return BICResolver.bics(this); } + @Override public List bicStrings () { return BICResolver.bicStrings(this); } @@ -314,7 +313,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field88A(f)); } @@ -330,6 +329,7 @@ public static List getAll(final SwiftTagListBlock block) { * @return line content or null if not present or if line number is above the expected * @since 7.7 */ + @Override public String getLine(int line) { return getLine(line, 0); } @@ -343,6 +343,7 @@ public String getLine(int line) { * @return line content or null if not present or if line number is above the expected * @since 7.7 */ + @Override public String getLine(int line, int offset) { Field88A cp = newInstance(this); return getLine(cp, line, null, offset); @@ -355,6 +356,7 @@ public String getLine(int line, int offset) { * @return lines content or empty list if field's value is empty * @since 7.7 */ + @Override public List getLines() { return SwiftParseUtils.getLines(getValue()); } @@ -367,6 +369,7 @@ public List getLines() { * @return found lines or empty list if lines are not present or the offset is invalid * @since 7.7 */ + @Override public List getLines(int offset) { Field88A cp = newInstance(this); return SwiftParseUtils.getLines(getLine(cp, null, null, offset)); @@ -381,6 +384,7 @@ public List getLines(int offset) { * @return found lines or empty list if value is empty * @since 7.7 */ + @Override public List getLinesBetween(int start, int end) { return getLinesBetween(start, end, 0); } @@ -395,6 +399,7 @@ public List getLinesBetween(int start, int end) { * @return found lines or empty list if lines are not present or the offset is invalid * @since 7.7 */ + @Override public List getLinesBetween(int start, int end, int offset) { Field88A cp = newInstance(this); return SwiftParseUtils.getLines(getLine(cp, start, end, offset)); diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field88B.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field88B.java index f42db3aac..fb77a657d 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field88B.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field88B.java @@ -30,12 +30,9 @@ import com.prowidesoftware.swift.model.field.MultiLineField; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -280,7 +277,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field88B(f)); } @@ -296,6 +293,7 @@ public static List getAll(final SwiftTagListBlock block) { * @return line content or null if not present or if line number is above the expected * @since 7.7 */ + @Override public String getLine(int line) { return getLine(line, 0); } @@ -309,6 +307,7 @@ public String getLine(int line) { * @return line content or null if not present or if line number is above the expected * @since 7.7 */ + @Override public String getLine(int line, int offset) { Field88B cp = newInstance(this); return getLine(cp, line, null, offset); @@ -321,6 +320,7 @@ public String getLine(int line, int offset) { * @return lines content or empty list if field's value is empty * @since 7.7 */ + @Override public List getLines() { return SwiftParseUtils.getLines(getValue()); } @@ -333,6 +333,7 @@ public List getLines() { * @return found lines or empty list if lines are not present or the offset is invalid * @since 7.7 */ + @Override public List getLines(int offset) { Field88B cp = newInstance(this); return SwiftParseUtils.getLines(getLine(cp, null, null, offset)); @@ -347,6 +348,7 @@ public List getLines(int offset) { * @return found lines or empty list if value is empty * @since 7.7 */ + @Override public List getLinesBetween(int start, int end) { return getLinesBetween(start, end, 0); } @@ -361,6 +363,7 @@ public List getLinesBetween(int start, int end) { * @return found lines or empty list if lines are not present or the offset is invalid * @since 7.7 */ + @Override public List getLinesBetween(int start, int end, int offset) { Field88B cp = newInstance(this); return SwiftParseUtils.getLines(getLine(cp, start, end, offset)); diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field88D.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field88D.java index 151d8a59f..d7d0b7b8e 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field88D.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field88D.java @@ -30,12 +30,9 @@ import com.prowidesoftware.swift.model.field.MultiLineField; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -358,7 +355,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field88D(f)); } @@ -374,6 +371,7 @@ public static List getAll(final SwiftTagListBlock block) { * @return line content or null if not present or if line number is above the expected * @since 7.7 */ + @Override public String getLine(int line) { return getLine(line, 0); } @@ -387,6 +385,7 @@ public String getLine(int line) { * @return line content or null if not present or if line number is above the expected * @since 7.7 */ + @Override public String getLine(int line, int offset) { Field88D cp = newInstance(this); return getLine(cp, line, null, offset); @@ -399,6 +398,7 @@ public String getLine(int line, int offset) { * @return lines content or empty list if field's value is empty * @since 7.7 */ + @Override public List getLines() { return SwiftParseUtils.getLines(getValue()); } @@ -411,6 +411,7 @@ public List getLines() { * @return found lines or empty list if lines are not present or the offset is invalid * @since 7.7 */ + @Override public List getLines(int offset) { Field88D cp = newInstance(this); return SwiftParseUtils.getLines(getLine(cp, null, null, offset)); @@ -425,6 +426,7 @@ public List getLines(int offset) { * @return found lines or empty list if value is empty * @since 7.7 */ + @Override public List getLinesBetween(int start, int end) { return getLinesBetween(start, end, 0); } @@ -439,6 +441,7 @@ public List getLinesBetween(int start, int end) { * @return found lines or empty list if lines are not present or the offset is invalid * @since 7.7 */ + @Override public List getLinesBetween(int start, int end, int offset) { Field88D cp = newInstance(this); return SwiftParseUtils.getLines(getLine(cp, start, end, offset)); diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field88J.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field88J.java index 2e39d93af..cad76e17f 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field88J.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field88J.java @@ -29,12 +29,9 @@ -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -235,7 +232,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field88J(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field89A.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field89A.java index 2ad47b780..543d473af 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field89A.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field89A.java @@ -33,12 +33,9 @@ import com.prowidesoftware.swift.model.field.BICContainer; import com.prowidesoftware.swift.model.field.BICResolver; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -242,10 +239,12 @@ public Field89A setIdentifierCode(com.prowidesoftware.swift.model.BIC component3 } + @Override public List bics() { return BICResolver.bics(this); } + @Override public List bicStrings () { return BICResolver.bicStrings(this); } @@ -314,7 +313,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field89A(f)); } @@ -330,6 +329,7 @@ public static List getAll(final SwiftTagListBlock block) { * @return line content or null if not present or if line number is above the expected * @since 7.7 */ + @Override public String getLine(int line) { return getLine(line, 0); } @@ -343,6 +343,7 @@ public String getLine(int line) { * @return line content or null if not present or if line number is above the expected * @since 7.7 */ + @Override public String getLine(int line, int offset) { Field89A cp = newInstance(this); return getLine(cp, line, null, offset); @@ -355,6 +356,7 @@ public String getLine(int line, int offset) { * @return lines content or empty list if field's value is empty * @since 7.7 */ + @Override public List getLines() { return SwiftParseUtils.getLines(getValue()); } @@ -367,6 +369,7 @@ public List getLines() { * @return found lines or empty list if lines are not present or the offset is invalid * @since 7.7 */ + @Override public List getLines(int offset) { Field89A cp = newInstance(this); return SwiftParseUtils.getLines(getLine(cp, null, null, offset)); @@ -381,6 +384,7 @@ public List getLines(int offset) { * @return found lines or empty list if value is empty * @since 7.7 */ + @Override public List getLinesBetween(int start, int end) { return getLinesBetween(start, end, 0); } @@ -395,6 +399,7 @@ public List getLinesBetween(int start, int end) { * @return found lines or empty list if lines are not present or the offset is invalid * @since 7.7 */ + @Override public List getLinesBetween(int start, int end, int offset) { Field89A cp = newInstance(this); return SwiftParseUtils.getLines(getLine(cp, start, end, offset)); diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field89D.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field89D.java index 08220f8d6..32d015adc 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field89D.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field89D.java @@ -30,12 +30,9 @@ import com.prowidesoftware.swift.model.field.MultiLineField; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -358,7 +355,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field89D(f)); } @@ -374,6 +371,7 @@ public static List getAll(final SwiftTagListBlock block) { * @return line content or null if not present or if line number is above the expected * @since 7.7 */ + @Override public String getLine(int line) { return getLine(line, 0); } @@ -387,6 +385,7 @@ public String getLine(int line) { * @return line content or null if not present or if line number is above the expected * @since 7.7 */ + @Override public String getLine(int line, int offset) { Field89D cp = newInstance(this); return getLine(cp, line, null, offset); @@ -399,6 +398,7 @@ public String getLine(int line, int offset) { * @return lines content or empty list if field's value is empty * @since 7.7 */ + @Override public List getLines() { return SwiftParseUtils.getLines(getValue()); } @@ -411,6 +411,7 @@ public List getLines() { * @return found lines or empty list if lines are not present or the offset is invalid * @since 7.7 */ + @Override public List getLines(int offset) { Field89D cp = newInstance(this); return SwiftParseUtils.getLines(getLine(cp, null, null, offset)); @@ -425,6 +426,7 @@ public List getLines(int offset) { * @return found lines or empty list if value is empty * @since 7.7 */ + @Override public List getLinesBetween(int start, int end) { return getLinesBetween(start, end, 0); } @@ -439,6 +441,7 @@ public List getLinesBetween(int start, int end) { * @return found lines or empty list if lines are not present or the offset is invalid * @since 7.7 */ + @Override public List getLinesBetween(int start, int end, int offset) { Field89D cp = newInstance(this); return SwiftParseUtils.getLines(getLine(cp, start, end, offset)); diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field89J.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field89J.java index 0af1fa42f..6fbf29def 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field89J.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field89J.java @@ -29,12 +29,9 @@ -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -235,7 +232,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field89J(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field90A.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field90A.java index 1fbfe4f9a..f1508ead9 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field90A.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field90A.java @@ -34,12 +34,9 @@ import com.prowidesoftware.swift.model.field.AmountContainer; import com.prowidesoftware.swift.model.field.AmountResolver; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -232,21 +229,20 @@ public String getValueDisplay(int component, Locale locale) { //default format (as is) return getComponent(3); } - if (component == 4) { - //amount, rate - java.text.NumberFormat f = java.text.NumberFormat.getNumberInstance(notNull(locale)); - f.setMaximumFractionDigits(13); - BigDecimal n = getComponent4AsBigDecimal(); - if (n != null) { - return f.format(n); - } + // This is the last component, return directly without `if` + //amount, rate + java.text.NumberFormat f = java.text.NumberFormat.getNumberInstance(notNull(locale)); + f.setMaximumFractionDigits(13); + BigDecimal n = getComponent4AsBigDecimal(); + if (n != null) { + return f.format(n); } return null; } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -516,32 +512,13 @@ public Field90A setComponent4(String component4) { return this; } - /** - * Set the component4 from a BigDecimal object. - *
- * Parses the BigDecimal into a SWIFT amount with truncated zero decimals and mandatory decimal separator. - *

- * @since 9.2.7 - * - * @param component4 the BigDecimal with the Price content to set - * @return the field object to enable build pattern - */ - public Field90A setComponent4(java.math.BigDecimal component4) { - setComponent(4, SwiftFormatUtils.getBigDecimal(component4)); - return this; - } /** * Alternative method setter for field's Price (component 4) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10.0 becomes an Float) * * @param component4 the Number with the Price content to set * @return the field object to enable build pattern - * @see #setPrice(java.math.BigDecimal) */ public Field90A setComponent4(java.lang.Number component4) { @@ -573,27 +550,13 @@ public Field90A setPrice(String component4) { return setComponent4(component4); } - /** - * Set the Price (component 4) from a BigDecimal object. - * - * @see #setComponent4(java.math.BigDecimal) - * - * @param component4 BigDecimal with the Price content to set - * @return the field object to enable build pattern - * @since 9.2.7 - */ - public Field90A setPrice(java.math.BigDecimal component4) { - return setComponent4(component4); - } - /** * Alternative method setter for field's Price (component 4) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10 becomes an Integer) * * @param component4 the Number with the Price content to set * @return the field object to enable build pattern - * @see #setPrice(java.math.BigDecimal) */ public Field90A setPrice(java.lang.Number component4) { return setComponent4(component4); @@ -616,6 +579,7 @@ public List amounts() { * @return the first amount as BigDecimal value. Can be null * @see AmountResolver#amount(Field) */ + @Override public BigDecimal amount() { return AmountResolver.amount(this); } @@ -627,6 +591,7 @@ public BigDecimal amount() { * * @return DSS component value or null if the DSS is not set or not available for this field. */ + @Override public String getDSS() { return null; } @@ -637,6 +602,7 @@ public String getDSS() { * @see #getDSS() * @return true if DSS is present, false otherwise. */ + @Override public boolean isDSSPresent() { return false; } @@ -651,6 +617,7 @@ public boolean isDSSPresent() { * * @return for generic fields returns the value of the conditional qualifier or null if not set or not applicable for this field. */ + @Override public String getConditionalQualifier() { return getComponent(CONDITIONAL_QUALIFIER); } @@ -718,7 +685,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field90A(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field90B.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field90B.java index 5acca9153..2a5b80006 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field90B.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field90B.java @@ -35,12 +35,9 @@ import com.prowidesoftware.swift.model.field.MonetaryAmountContainer; import com.prowidesoftware.swift.model.field.MonetaryAmountResolver; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -233,21 +230,20 @@ public String getValueDisplay(int component, Locale locale) { //default format (as is) return getComponent(3); } - if (component == 4) { - //amount, rate - java.text.NumberFormat f = java.text.NumberFormat.getNumberInstance(notNull(locale)); - f.setMaximumFractionDigits(13); - BigDecimal n = getComponent4AsBigDecimal(); - if (n != null) { - return f.format(n); - } + // This is the last component, return directly without `if` + //amount, rate + java.text.NumberFormat f = java.text.NumberFormat.getNumberInstance(notNull(locale)); + f.setMaximumFractionDigits(13); + BigDecimal n = getComponent4AsBigDecimal(); + if (n != null) { + return f.format(n); } return null; } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -557,32 +553,13 @@ public Field90B setComponent4(String component4) { return this; } - /** - * Set the component4 from a BigDecimal object. - *
- * Parses the BigDecimal into a SWIFT amount with truncated zero decimals and mandatory decimal separator. - *

- * @since 9.2.7 - * - * @param component4 the BigDecimal with the Price content to set - * @return the field object to enable build pattern - */ - public Field90B setComponent4(java.math.BigDecimal component4) { - setComponent(4, SwiftFormatUtils.getBigDecimal(component4)); - return this; - } /** * Alternative method setter for field's Price (component 4) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10.0 becomes an Float) * * @param component4 the Number with the Price content to set * @return the field object to enable build pattern - * @see #setPrice(java.math.BigDecimal) */ public Field90B setComponent4(java.lang.Number component4) { @@ -614,53 +591,45 @@ public Field90B setPrice(String component4) { return setComponent4(component4); } - /** - * Set the Price (component 4) from a BigDecimal object. - * - * @see #setComponent4(java.math.BigDecimal) - * - * @param component4 BigDecimal with the Price content to set - * @return the field object to enable build pattern - * @since 9.2.7 - */ - public Field90B setPrice(java.math.BigDecimal component4) { - return setComponent4(component4); - } - /** * Alternative method setter for field's Price (component 4) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10 becomes an Integer) * * @param component4 the Number with the Price content to set * @return the field object to enable build pattern - * @see #setPrice(java.math.BigDecimal) */ public Field90B setPrice(java.lang.Number component4) { return setComponent4(component4); } + @Override public List currencyStrings() { return MonetaryAmountResolver.currencyStrings(this); } + @Override public List currencies() { return MonetaryAmountResolver.currencies(this); } + @Override public Currency currency() { return MonetaryAmountResolver.resolveCurrency(this); } + @Override public String currencyString() { return MonetaryAmountResolver.resolveCurrencyString(this); } + @Override public void initializeCurrencies(String cur) { MonetaryAmountResolver.resolveSetCurrency(this, cur); } + @Override public void initializeCurrencies(Currency cur) { MonetaryAmountResolver.resolveSetCurrency(this, cur); } @@ -681,6 +650,7 @@ public List amounts() { * @return the first amount as BigDecimal value. Can be null * @see MonetaryAmountResolver#amount(Field) */ + @Override public BigDecimal amount() { return MonetaryAmountResolver.amount(this); } @@ -692,6 +662,7 @@ public BigDecimal amount() { * * @return DSS component value or null if the DSS is not set or not available for this field. */ + @Override public String getDSS() { return null; } @@ -702,6 +673,7 @@ public String getDSS() { * @see #getDSS() * @return true if DSS is present, false otherwise. */ + @Override public boolean isDSSPresent() { return false; } @@ -716,6 +688,7 @@ public boolean isDSSPresent() { * * @return for generic fields returns the value of the conditional qualifier or null if not set or not applicable for this field. */ + @Override public String getConditionalQualifier() { return getComponent(CONDITIONAL_QUALIFIER); } @@ -783,7 +756,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field90B(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field90C.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field90C.java index 2d1275409..4bf17fb08 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field90C.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field90C.java @@ -34,12 +34,9 @@ import com.prowidesoftware.swift.model.field.MonetaryAmountContainer; import com.prowidesoftware.swift.model.field.MonetaryAmountResolver; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -214,21 +211,20 @@ public String getValueDisplay(int component, Locale locale) { //default format (as is) return getComponent(2); } - if (component == 3) { - //amount, rate - java.text.NumberFormat f = java.text.NumberFormat.getNumberInstance(notNull(locale)); - f.setMaximumFractionDigits(13); - BigDecimal n = getComponent3AsBigDecimal(); - if (n != null) { - return f.format(n); - } + // This is the last component, return directly without `if` + //amount, rate + java.text.NumberFormat f = java.text.NumberFormat.getNumberInstance(notNull(locale)); + f.setMaximumFractionDigits(13); + BigDecimal n = getComponent3AsBigDecimal(); + if (n != null) { + return f.format(n); } return null; } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -449,32 +445,14 @@ public Field90C setComponent1(String component1) { return this; } - /** - * Set the component1 from a Long object. - *
- * If the component being set is a fixed length number, the argument will not be - * padded. It is recommended for these cases to use the setComponent1(String) - * method. - * - * @see #setComponent1(String) - * @since 9.2.7 - * - * @param component1 the Long with the Number content to set - * @return the field object to enable build pattern - */ - public Field90C setComponent1(java.lang.Long component1) { - setComponent(1, SwiftFormatUtils.getLong(component1)); - return this; - } /** * Alternative method setter for field's Number (component 1) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10 becomes an Integer) * * @param component1 the Number with the Number content to set * @return the field object to enable build pattern - * @see #setNumber(java.lang.Long) */ public Field90C setComponent1(java.lang.Number component1) { @@ -504,27 +482,13 @@ public Field90C setNumber(String component1) { return setComponent1(component1); } - /** - * Set the Number (component 1) from a Long object. - * - * @see #setComponent1(java.lang.Long) - * - * @param component1 Long with the Number content to set - * @return the field object to enable build pattern - * @since 9.2.7 - */ - public Field90C setNumber(java.lang.Long component1) { - return setComponent1(component1); - } - /** * Alternative method setter for field's Number (component 1) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10 becomes an Integer) * * @param component1 the Number with the Number content to set * @return the field object to enable build pattern - * @see #setNumber(java.lang.Long) */ public Field90C setNumber(java.lang.Number component1) { return setComponent1(component1); @@ -585,32 +549,13 @@ public Field90C setComponent3(String component3) { return this; } - /** - * Set the component3 from a BigDecimal object. - *
- * Parses the BigDecimal into a SWIFT amount with truncated zero decimals and mandatory decimal separator. - *

- * @since 9.2.7 - * - * @param component3 the BigDecimal with the Amount content to set - * @return the field object to enable build pattern - */ - public Field90C setComponent3(java.math.BigDecimal component3) { - setComponent(3, SwiftFormatUtils.getBigDecimal(component3)); - return this; - } /** * Alternative method setter for field's Amount (component 3) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10.0 becomes an Float) * * @param component3 the Number with the Amount content to set * @return the field object to enable build pattern - * @see #setAmount(java.math.BigDecimal) */ public Field90C setComponent3(java.lang.Number component3) { @@ -642,53 +587,45 @@ public Field90C setAmount(String component3) { return setComponent3(component3); } - /** - * Set the Amount (component 3) from a BigDecimal object. - * - * @see #setComponent3(java.math.BigDecimal) - * - * @param component3 BigDecimal with the Amount content to set - * @return the field object to enable build pattern - * @since 9.2.7 - */ - public Field90C setAmount(java.math.BigDecimal component3) { - return setComponent3(component3); - } - /** * Alternative method setter for field's Amount (component 3) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10 becomes an Integer) * * @param component3 the Number with the Amount content to set * @return the field object to enable build pattern - * @see #setAmount(java.math.BigDecimal) */ public Field90C setAmount(java.lang.Number component3) { return setComponent3(component3); } + @Override public List currencyStrings() { return MonetaryAmountResolver.currencyStrings(this); } + @Override public List currencies() { return MonetaryAmountResolver.currencies(this); } + @Override public Currency currency() { return MonetaryAmountResolver.resolveCurrency(this); } + @Override public String currencyString() { return MonetaryAmountResolver.resolveCurrencyString(this); } + @Override public void initializeCurrencies(String cur) { MonetaryAmountResolver.resolveSetCurrency(this, cur); } + @Override public void initializeCurrencies(Currency cur) { MonetaryAmountResolver.resolveSetCurrency(this, cur); } @@ -709,6 +646,7 @@ public List amounts() { * @return the first amount as BigDecimal value. Can be null * @see MonetaryAmountResolver#amount(Field) */ + @Override public BigDecimal amount() { return MonetaryAmountResolver.amount(this); } @@ -777,7 +715,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field90C(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field90D.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field90D.java index c97e1fe33..753e9808c 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field90D.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field90D.java @@ -34,12 +34,9 @@ import com.prowidesoftware.swift.model.field.MonetaryAmountContainer; import com.prowidesoftware.swift.model.field.MonetaryAmountResolver; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -214,21 +211,20 @@ public String getValueDisplay(int component, Locale locale) { //default format (as is) return getComponent(2); } - if (component == 3) { - //amount, rate - java.text.NumberFormat f = java.text.NumberFormat.getNumberInstance(notNull(locale)); - f.setMaximumFractionDigits(13); - BigDecimal n = getComponent3AsBigDecimal(); - if (n != null) { - return f.format(n); - } + // This is the last component, return directly without `if` + //amount, rate + java.text.NumberFormat f = java.text.NumberFormat.getNumberInstance(notNull(locale)); + f.setMaximumFractionDigits(13); + BigDecimal n = getComponent3AsBigDecimal(); + if (n != null) { + return f.format(n); } return null; } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -449,32 +445,14 @@ public Field90D setComponent1(String component1) { return this; } - /** - * Set the component1 from a Long object. - *
- * If the component being set is a fixed length number, the argument will not be - * padded. It is recommended for these cases to use the setComponent1(String) - * method. - * - * @see #setComponent1(String) - * @since 9.2.7 - * - * @param component1 the Long with the Number content to set - * @return the field object to enable build pattern - */ - public Field90D setComponent1(java.lang.Long component1) { - setComponent(1, SwiftFormatUtils.getLong(component1)); - return this; - } /** * Alternative method setter for field's Number (component 1) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10 becomes an Integer) * * @param component1 the Number with the Number content to set * @return the field object to enable build pattern - * @see #setNumber(java.lang.Long) */ public Field90D setComponent1(java.lang.Number component1) { @@ -504,27 +482,13 @@ public Field90D setNumber(String component1) { return setComponent1(component1); } - /** - * Set the Number (component 1) from a Long object. - * - * @see #setComponent1(java.lang.Long) - * - * @param component1 Long with the Number content to set - * @return the field object to enable build pattern - * @since 9.2.7 - */ - public Field90D setNumber(java.lang.Long component1) { - return setComponent1(component1); - } - /** * Alternative method setter for field's Number (component 1) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10 becomes an Integer) * * @param component1 the Number with the Number content to set * @return the field object to enable build pattern - * @see #setNumber(java.lang.Long) */ public Field90D setNumber(java.lang.Number component1) { return setComponent1(component1); @@ -585,32 +549,13 @@ public Field90D setComponent3(String component3) { return this; } - /** - * Set the component3 from a BigDecimal object. - *
- * Parses the BigDecimal into a SWIFT amount with truncated zero decimals and mandatory decimal separator. - *

- * @since 9.2.7 - * - * @param component3 the BigDecimal with the Amount content to set - * @return the field object to enable build pattern - */ - public Field90D setComponent3(java.math.BigDecimal component3) { - setComponent(3, SwiftFormatUtils.getBigDecimal(component3)); - return this; - } /** * Alternative method setter for field's Amount (component 3) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10.0 becomes an Float) * * @param component3 the Number with the Amount content to set * @return the field object to enable build pattern - * @see #setAmount(java.math.BigDecimal) */ public Field90D setComponent3(java.lang.Number component3) { @@ -642,53 +587,45 @@ public Field90D setAmount(String component3) { return setComponent3(component3); } - /** - * Set the Amount (component 3) from a BigDecimal object. - * - * @see #setComponent3(java.math.BigDecimal) - * - * @param component3 BigDecimal with the Amount content to set - * @return the field object to enable build pattern - * @since 9.2.7 - */ - public Field90D setAmount(java.math.BigDecimal component3) { - return setComponent3(component3); - } - /** * Alternative method setter for field's Amount (component 3) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10 becomes an Integer) * * @param component3 the Number with the Amount content to set * @return the field object to enable build pattern - * @see #setAmount(java.math.BigDecimal) */ public Field90D setAmount(java.lang.Number component3) { return setComponent3(component3); } + @Override public List currencyStrings() { return MonetaryAmountResolver.currencyStrings(this); } + @Override public List currencies() { return MonetaryAmountResolver.currencies(this); } + @Override public Currency currency() { return MonetaryAmountResolver.resolveCurrency(this); } + @Override public String currencyString() { return MonetaryAmountResolver.resolveCurrencyString(this); } + @Override public void initializeCurrencies(String cur) { MonetaryAmountResolver.resolveSetCurrency(this, cur); } + @Override public void initializeCurrencies(Currency cur) { MonetaryAmountResolver.resolveSetCurrency(this, cur); } @@ -709,6 +646,7 @@ public List amounts() { * @return the first amount as BigDecimal value. Can be null * @see MonetaryAmountResolver#amount(Field) */ + @Override public BigDecimal amount() { return MonetaryAmountResolver.amount(this); } @@ -777,7 +715,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field90D(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field90E.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field90E.java index 556002747..0d668bfc2 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field90E.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field90E.java @@ -30,12 +30,9 @@ import com.prowidesoftware.swift.model.field.GenericField; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -202,16 +199,14 @@ public String getValueDisplay(int component, Locale locale) { //default format (as is) return getComponent(1); } - if (component == 2) { - //default format (as is) - return getComponent(2); - } - return null; + // This is the last component, return directly without `if` + //default format (as is) + return getComponent(2); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -400,6 +395,7 @@ public Field90E setPriceCode(String component2) { * * @return DSS component value or null if the DSS is not set or not available for this field. */ + @Override public String getDSS() { return null; } @@ -410,6 +406,7 @@ public String getDSS() { * @see #getDSS() * @return true if DSS is present, false otherwise. */ + @Override public boolean isDSSPresent() { return false; } @@ -424,6 +421,7 @@ public boolean isDSSPresent() { * * @return for generic fields returns the value of the conditional qualifier or null if not set or not applicable for this field. */ + @Override public String getConditionalQualifier() { return getComponent(CONDITIONAL_QUALIFIER); } @@ -491,7 +489,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field90E(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field90F.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field90F.java index e548fee39..ab23ddea5 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field90F.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field90F.java @@ -35,12 +35,9 @@ import com.prowidesoftware.swift.model.field.MonetaryAmountContainer; import com.prowidesoftware.swift.model.field.MonetaryAmountResolver; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -267,21 +264,20 @@ public String getValueDisplay(int component, Locale locale) { //default format (as is) return getComponent(5); } - if (component == 6) { - //amount, rate - java.text.NumberFormat f = java.text.NumberFormat.getNumberInstance(notNull(locale)); - f.setMaximumFractionDigits(13); - BigDecimal n = getComponent6AsBigDecimal(); - if (n != null) { - return f.format(n); - } + // This is the last component, return directly without `if` + //amount, rate + java.text.NumberFormat f = java.text.NumberFormat.getNumberInstance(notNull(locale)); + f.setMaximumFractionDigits(13); + BigDecimal n = getComponent6AsBigDecimal(); + if (n != null) { + return f.format(n); } return null; } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -648,32 +644,13 @@ public Field90F setComponent4(String component4) { return this; } - /** - * Set the component4 from a BigDecimal object. - *
- * Parses the BigDecimal into a SWIFT amount with truncated zero decimals and mandatory decimal separator. - *

- * @since 9.2.7 - * - * @param component4 the BigDecimal with the Amount content to set - * @return the field object to enable build pattern - */ - public Field90F setComponent4(java.math.BigDecimal component4) { - setComponent(4, SwiftFormatUtils.getBigDecimal(component4)); - return this; - } /** * Alternative method setter for field's Amount (component 4) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10.0 becomes an Float) * * @param component4 the Number with the Amount content to set * @return the field object to enable build pattern - * @see #setAmount(java.math.BigDecimal) */ public Field90F setComponent4(java.lang.Number component4) { @@ -705,27 +682,13 @@ public Field90F setAmount(String component4) { return setComponent4(component4); } - /** - * Set the Amount (component 4) from a BigDecimal object. - * - * @see #setComponent4(java.math.BigDecimal) - * - * @param component4 BigDecimal with the Amount content to set - * @return the field object to enable build pattern - * @since 9.2.7 - */ - public Field90F setAmount(java.math.BigDecimal component4) { - return setComponent4(component4); - } - /** * Alternative method setter for field's Amount (component 4) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10 becomes an Integer) * * @param component4 the Number with the Amount content to set * @return the field object to enable build pattern - * @see #setAmount(java.math.BigDecimal) */ public Field90F setAmount(java.lang.Number component4) { return setComponent4(component4); @@ -763,32 +726,13 @@ public Field90F setComponent6(String component6) { return this; } - /** - * Set the component6 from a BigDecimal object. - *
- * Parses the BigDecimal into a SWIFT amount with truncated zero decimals and mandatory decimal separator. - *

- * @since 9.2.7 - * - * @param component6 the BigDecimal with the Quantity content to set - * @return the field object to enable build pattern - */ - public Field90F setComponent6(java.math.BigDecimal component6) { - setComponent(6, SwiftFormatUtils.getBigDecimal(component6)); - return this; - } /** * Alternative method setter for field's Quantity (component 6) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10.0 becomes an Float) * * @param component6 the Number with the Quantity content to set * @return the field object to enable build pattern - * @see #setQuantity(java.math.BigDecimal) */ public Field90F setComponent6(java.lang.Number component6) { @@ -820,53 +764,45 @@ public Field90F setQuantity(String component6) { return setComponent6(component6); } - /** - * Set the Quantity (component 6) from a BigDecimal object. - * - * @see #setComponent6(java.math.BigDecimal) - * - * @param component6 BigDecimal with the Quantity content to set - * @return the field object to enable build pattern - * @since 9.2.7 - */ - public Field90F setQuantity(java.math.BigDecimal component6) { - return setComponent6(component6); - } - /** * Alternative method setter for field's Quantity (component 6) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10 becomes an Integer) * * @param component6 the Number with the Quantity content to set * @return the field object to enable build pattern - * @see #setQuantity(java.math.BigDecimal) */ public Field90F setQuantity(java.lang.Number component6) { return setComponent6(component6); } + @Override public List currencyStrings() { return MonetaryAmountResolver.currencyStrings(this); } + @Override public List currencies() { return MonetaryAmountResolver.currencies(this); } + @Override public Currency currency() { return MonetaryAmountResolver.resolveCurrency(this); } + @Override public String currencyString() { return MonetaryAmountResolver.resolveCurrencyString(this); } + @Override public void initializeCurrencies(String cur) { MonetaryAmountResolver.resolveSetCurrency(this, cur); } + @Override public void initializeCurrencies(Currency cur) { MonetaryAmountResolver.resolveSetCurrency(this, cur); } @@ -887,6 +823,7 @@ public List amounts() { * @return the first amount as BigDecimal value. Can be null * @see MonetaryAmountResolver#amount(Field) */ + @Override public BigDecimal amount() { return MonetaryAmountResolver.amount(this); } @@ -898,6 +835,7 @@ public BigDecimal amount() { * * @return DSS component value or null if the DSS is not set or not available for this field. */ + @Override public String getDSS() { return null; } @@ -908,6 +846,7 @@ public String getDSS() { * @see #getDSS() * @return true if DSS is present, false otherwise. */ + @Override public boolean isDSSPresent() { return false; } @@ -922,6 +861,7 @@ public boolean isDSSPresent() { * * @return for generic fields returns the value of the conditional qualifier or null if not set or not applicable for this field. */ + @Override public String getConditionalQualifier() { return getComponent(CONDITIONAL_QUALIFIER); } @@ -989,7 +929,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field90F(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field90J.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field90J.java index 268a0a813..e3b267b13 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field90J.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field90J.java @@ -35,12 +35,9 @@ import com.prowidesoftware.swift.model.field.MonetaryAmountContainer; import com.prowidesoftware.swift.model.field.MonetaryAmountResolver; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -268,21 +265,20 @@ public String getValueDisplay(int component, Locale locale) { //default format (as is) return getComponent(5); } - if (component == 6) { - //amount, rate - java.text.NumberFormat f = java.text.NumberFormat.getNumberInstance(notNull(locale)); - f.setMaximumFractionDigits(13); - BigDecimal n = getComponent6AsBigDecimal(); - if (n != null) { - return f.format(n); - } + // This is the last component, return directly without `if` + //amount, rate + java.text.NumberFormat f = java.text.NumberFormat.getNumberInstance(notNull(locale)); + f.setMaximumFractionDigits(13); + BigDecimal n = getComponent6AsBigDecimal(); + if (n != null) { + return f.format(n); } return null; } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -672,32 +668,13 @@ public Field90J setComponent4(String component4) { return this; } - /** - * Set the component4 from a BigDecimal object. - *
- * Parses the BigDecimal into a SWIFT amount with truncated zero decimals and mandatory decimal separator. - *

- * @since 9.2.7 - * - * @param component4 the BigDecimal with the Amount1 content to set - * @return the field object to enable build pattern - */ - public Field90J setComponent4(java.math.BigDecimal component4) { - setComponent(4, SwiftFormatUtils.getBigDecimal(component4)); - return this; - } /** * Alternative method setter for field's Amount1 (component 4) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10.0 becomes an Float) * * @param component4 the Number with the Amount1 content to set * @return the field object to enable build pattern - * @see #setAmount1(java.math.BigDecimal) */ public Field90J setComponent4(java.lang.Number component4) { @@ -729,27 +706,13 @@ public Field90J setAmount1(String component4) { return setComponent4(component4); } - /** - * Set the Amount1 (component 4) from a BigDecimal object. - * - * @see #setComponent4(java.math.BigDecimal) - * - * @param component4 BigDecimal with the Amount1 content to set - * @return the field object to enable build pattern - * @since 9.2.7 - */ - public Field90J setAmount1(java.math.BigDecimal component4) { - return setComponent4(component4); - } - /** * Alternative method setter for field's Amount1 (component 4) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10 becomes an Integer) * * @param component4 the Number with the Amount1 content to set * @return the field object to enable build pattern - * @see #setAmount1(java.math.BigDecimal) */ public Field90J setAmount1(java.lang.Number component4) { return setComponent4(component4); @@ -810,32 +773,13 @@ public Field90J setComponent6(String component6) { return this; } - /** - * Set the component6 from a BigDecimal object. - *
- * Parses the BigDecimal into a SWIFT amount with truncated zero decimals and mandatory decimal separator. - *

- * @since 9.2.7 - * - * @param component6 the BigDecimal with the Amount2 content to set - * @return the field object to enable build pattern - */ - public Field90J setComponent6(java.math.BigDecimal component6) { - setComponent(6, SwiftFormatUtils.getBigDecimal(component6)); - return this; - } /** * Alternative method setter for field's Amount2 (component 6) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10.0 becomes an Float) * * @param component6 the Number with the Amount2 content to set * @return the field object to enable build pattern - * @see #setAmount2(java.math.BigDecimal) */ public Field90J setComponent6(java.lang.Number component6) { @@ -867,53 +811,45 @@ public Field90J setAmount2(String component6) { return setComponent6(component6); } - /** - * Set the Amount2 (component 6) from a BigDecimal object. - * - * @see #setComponent6(java.math.BigDecimal) - * - * @param component6 BigDecimal with the Amount2 content to set - * @return the field object to enable build pattern - * @since 9.2.7 - */ - public Field90J setAmount2(java.math.BigDecimal component6) { - return setComponent6(component6); - } - /** * Alternative method setter for field's Amount2 (component 6) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10 becomes an Integer) * * @param component6 the Number with the Amount2 content to set * @return the field object to enable build pattern - * @see #setAmount2(java.math.BigDecimal) */ public Field90J setAmount2(java.lang.Number component6) { return setComponent6(component6); } + @Override public List currencyStrings() { return MonetaryAmountResolver.currencyStrings(this); } + @Override public List currencies() { return MonetaryAmountResolver.currencies(this); } + @Override public Currency currency() { return MonetaryAmountResolver.resolveCurrency(this); } + @Override public String currencyString() { return MonetaryAmountResolver.resolveCurrencyString(this); } + @Override public void initializeCurrencies(String cur) { MonetaryAmountResolver.resolveSetCurrency(this, cur); } + @Override public void initializeCurrencies(Currency cur) { MonetaryAmountResolver.resolveSetCurrency(this, cur); } @@ -934,6 +870,7 @@ public List amounts() { * @return the first amount as BigDecimal value. Can be null * @see MonetaryAmountResolver#amount(Field) */ + @Override public BigDecimal amount() { return MonetaryAmountResolver.amount(this); } @@ -945,6 +882,7 @@ public BigDecimal amount() { * * @return DSS component value or null if the DSS is not set or not available for this field. */ + @Override public String getDSS() { return null; } @@ -955,6 +893,7 @@ public String getDSS() { * @see #getDSS() * @return true if DSS is present, false otherwise. */ + @Override public boolean isDSSPresent() { return false; } @@ -969,6 +908,7 @@ public boolean isDSSPresent() { * * @return for generic fields returns the value of the conditional qualifier or null if not set or not applicable for this field. */ + @Override public String getConditionalQualifier() { return getComponent(CONDITIONAL_QUALIFIER); } @@ -1036,7 +976,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field90J(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field91A.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field91A.java index 21b8604c6..fa4f7b3c9 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field91A.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field91A.java @@ -33,12 +33,9 @@ import com.prowidesoftware.swift.model.field.BICContainer; import com.prowidesoftware.swift.model.field.BICResolver; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -242,10 +239,12 @@ public Field91A setIdentifierCode(com.prowidesoftware.swift.model.BIC component3 } + @Override public List bics() { return BICResolver.bics(this); } + @Override public List bicStrings () { return BICResolver.bicStrings(this); } @@ -314,7 +313,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field91A(f)); } @@ -330,6 +329,7 @@ public static List getAll(final SwiftTagListBlock block) { * @return line content or null if not present or if line number is above the expected * @since 7.7 */ + @Override public String getLine(int line) { return getLine(line, 0); } @@ -343,6 +343,7 @@ public String getLine(int line) { * @return line content or null if not present or if line number is above the expected * @since 7.7 */ + @Override public String getLine(int line, int offset) { Field91A cp = newInstance(this); return getLine(cp, line, null, offset); @@ -355,6 +356,7 @@ public String getLine(int line, int offset) { * @return lines content or empty list if field's value is empty * @since 7.7 */ + @Override public List getLines() { return SwiftParseUtils.getLines(getValue()); } @@ -367,6 +369,7 @@ public List getLines() { * @return found lines or empty list if lines are not present or the offset is invalid * @since 7.7 */ + @Override public List getLines(int offset) { Field91A cp = newInstance(this); return SwiftParseUtils.getLines(getLine(cp, null, null, offset)); @@ -381,6 +384,7 @@ public List getLines(int offset) { * @return found lines or empty list if value is empty * @since 7.7 */ + @Override public List getLinesBetween(int start, int end) { return getLinesBetween(start, end, 0); } @@ -395,6 +399,7 @@ public List getLinesBetween(int start, int end) { * @return found lines or empty list if lines are not present or the offset is invalid * @since 7.7 */ + @Override public List getLinesBetween(int start, int end, int offset) { Field91A cp = newInstance(this); return SwiftParseUtils.getLines(getLine(cp, start, end, offset)); diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field91D.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field91D.java index f3e556db8..dabbb705f 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field91D.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field91D.java @@ -30,12 +30,9 @@ import com.prowidesoftware.swift.model.field.MultiLineField; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -358,7 +355,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field91D(f)); } @@ -374,6 +371,7 @@ public static List getAll(final SwiftTagListBlock block) { * @return line content or null if not present or if line number is above the expected * @since 7.7 */ + @Override public String getLine(int line) { return getLine(line, 0); } @@ -387,6 +385,7 @@ public String getLine(int line) { * @return line content or null if not present or if line number is above the expected * @since 7.7 */ + @Override public String getLine(int line, int offset) { Field91D cp = newInstance(this); return getLine(cp, line, null, offset); @@ -399,6 +398,7 @@ public String getLine(int line, int offset) { * @return lines content or empty list if field's value is empty * @since 7.7 */ + @Override public List getLines() { return SwiftParseUtils.getLines(getValue()); } @@ -411,6 +411,7 @@ public List getLines() { * @return found lines or empty list if lines are not present or the offset is invalid * @since 7.7 */ + @Override public List getLines(int offset) { Field91D cp = newInstance(this); return SwiftParseUtils.getLines(getLine(cp, null, null, offset)); @@ -425,6 +426,7 @@ public List getLines(int offset) { * @return found lines or empty list if value is empty * @since 7.7 */ + @Override public List getLinesBetween(int start, int end) { return getLinesBetween(start, end, 0); } @@ -439,6 +441,7 @@ public List getLinesBetween(int start, int end) { * @return found lines or empty list if lines are not present or the offset is invalid * @since 7.7 */ + @Override public List getLinesBetween(int start, int end, int offset) { Field91D cp = newInstance(this); return SwiftParseUtils.getLines(getLine(cp, start, end, offset)); diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field91J.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field91J.java index 8ced0d94f..5fd094a23 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field91J.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field91J.java @@ -29,12 +29,9 @@ -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -235,7 +232,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field91J(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field92B.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field92B.java index 236d85d53..3c6cdcd9c 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field92B.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field92B.java @@ -35,12 +35,9 @@ import com.prowidesoftware.swift.model.field.MonetaryAmountContainer; import com.prowidesoftware.swift.model.field.MonetaryAmountResolver; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -233,21 +230,20 @@ public String getValueDisplay(int component, Locale locale) { //default format (as is) return getComponent(3); } - if (component == 4) { - //amount, rate - java.text.NumberFormat f = java.text.NumberFormat.getNumberInstance(notNull(locale)); - f.setMaximumFractionDigits(13); - BigDecimal n = getComponent4AsBigDecimal(); - if (n != null) { - return f.format(n); - } + // This is the last component, return directly without `if` + //amount, rate + java.text.NumberFormat f = java.text.NumberFormat.getNumberInstance(notNull(locale)); + f.setMaximumFractionDigits(13); + BigDecimal n = getComponent4AsBigDecimal(); + if (n != null) { + return f.format(n); } return null; } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -594,32 +590,13 @@ public Field92B setComponent4(String component4) { return this; } - /** - * Set the component4 from a BigDecimal object. - *
- * Parses the BigDecimal into a SWIFT amount with truncated zero decimals and mandatory decimal separator. - *

- * @since 9.2.7 - * - * @param component4 the BigDecimal with the Rate content to set - * @return the field object to enable build pattern - */ - public Field92B setComponent4(java.math.BigDecimal component4) { - setComponent(4, SwiftFormatUtils.getBigDecimal(component4)); - return this; - } /** * Alternative method setter for field's Rate (component 4) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10.0 becomes an Float) * * @param component4 the Number with the Rate content to set * @return the field object to enable build pattern - * @see #setRate(java.math.BigDecimal) */ public Field92B setComponent4(java.lang.Number component4) { @@ -651,53 +628,45 @@ public Field92B setRate(String component4) { return setComponent4(component4); } - /** - * Set the Rate (component 4) from a BigDecimal object. - * - * @see #setComponent4(java.math.BigDecimal) - * - * @param component4 BigDecimal with the Rate content to set - * @return the field object to enable build pattern - * @since 9.2.7 - */ - public Field92B setRate(java.math.BigDecimal component4) { - return setComponent4(component4); - } - /** * Alternative method setter for field's Rate (component 4) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10 becomes an Integer) * * @param component4 the Number with the Rate content to set * @return the field object to enable build pattern - * @see #setRate(java.math.BigDecimal) */ public Field92B setRate(java.lang.Number component4) { return setComponent4(component4); } + @Override public List currencyStrings() { return MonetaryAmountResolver.currencyStrings(this); } + @Override public List currencies() { return MonetaryAmountResolver.currencies(this); } + @Override public Currency currency() { return MonetaryAmountResolver.resolveCurrency(this); } + @Override public String currencyString() { return MonetaryAmountResolver.resolveCurrencyString(this); } + @Override public void initializeCurrencies(String cur) { MonetaryAmountResolver.resolveSetCurrency(this, cur); } + @Override public void initializeCurrencies(Currency cur) { MonetaryAmountResolver.resolveSetCurrency(this, cur); } @@ -718,6 +687,7 @@ public List amounts() { * @return the first amount as BigDecimal value. Can be null * @see MonetaryAmountResolver#amount(Field) */ + @Override public BigDecimal amount() { return MonetaryAmountResolver.amount(this); } @@ -729,6 +699,7 @@ public BigDecimal amount() { * * @return DSS component value or null if the DSS is not set or not available for this field. */ + @Override public String getDSS() { return null; } @@ -739,6 +710,7 @@ public String getDSS() { * @see #getDSS() * @return true if DSS is present, false otherwise. */ + @Override public boolean isDSSPresent() { return false; } @@ -753,6 +725,7 @@ public boolean isDSSPresent() { * * @return for generic fields returns the value of the conditional qualifier or null if not set or not applicable for this field. */ + @Override public String getConditionalQualifier() { return getComponent(CONDITIONAL_QUALIFIER); } @@ -820,7 +793,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field92B(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field92C.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field92C.java index 9809127a2..cfa068b47 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field92C.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field92C.java @@ -30,12 +30,9 @@ import com.prowidesoftware.swift.model.field.GenericField; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -215,16 +212,14 @@ public String getValueDisplay(int component, Locale locale) { //default format (as is) return getComponent(2); } - if (component == 3) { - //default format (as is) - return getComponent(3); - } - return null; + // This is the last component, return directly without `if` + //default format (as is) + return getComponent(3); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -456,6 +451,7 @@ public Field92C setRateName(String component3) { * * @return DSS component value or null if the DSS is not set or not available for this field. */ + @Override public String getDSS() { return getComponent2(); } @@ -466,6 +462,7 @@ public String getDSS() { * @see #getDSS() * @return true if DSS is present, false otherwise. */ + @Override public boolean isDSSPresent() { return getComponent2() != null; } @@ -480,6 +477,7 @@ public boolean isDSSPresent() { * * @return for generic fields returns the value of the conditional qualifier or null if not set or not applicable for this field. */ + @Override public String getConditionalQualifier() { return getComponent(CONDITIONAL_QUALIFIER); } @@ -547,7 +545,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field92C(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field92D.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field92D.java index 51e5856bb..df2e112ae 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field92D.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field92D.java @@ -34,12 +34,9 @@ import com.prowidesoftware.swift.model.field.AmountContainer; import com.prowidesoftware.swift.model.field.AmountResolver; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -224,21 +221,20 @@ public String getValueDisplay(int component, Locale locale) { return f.format(n); } } - if (component == 3) { - //amount, rate - java.text.NumberFormat f = java.text.NumberFormat.getNumberInstance(notNull(locale)); - f.setMaximumFractionDigits(13); - BigDecimal n = getComponent3AsBigDecimal(); - if (n != null) { - return f.format(n); - } + // This is the last component, return directly without `if` + //amount, rate + java.text.NumberFormat f = java.text.NumberFormat.getNumberInstance(notNull(locale)); + f.setMaximumFractionDigits(13); + BigDecimal n = getComponent3AsBigDecimal(); + if (n != null) { + return f.format(n); } return null; } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -463,32 +459,13 @@ public Field92D setComponent2(String component2) { return this; } - /** - * Set the component2 from a BigDecimal object. - *
- * Parses the BigDecimal into a SWIFT amount with truncated zero decimals and mandatory decimal separator. - *

- * @since 9.2.7 - * - * @param component2 the BigDecimal with the Quantity1 content to set - * @return the field object to enable build pattern - */ - public Field92D setComponent2(java.math.BigDecimal component2) { - setComponent(2, SwiftFormatUtils.getBigDecimal(component2)); - return this; - } /** * Alternative method setter for field's Quantity1 (component 2) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10.0 becomes an Float) * * @param component2 the Number with the Quantity1 content to set * @return the field object to enable build pattern - * @see #setQuantity1(java.math.BigDecimal) */ public Field92D setComponent2(java.lang.Number component2) { @@ -520,27 +497,13 @@ public Field92D setQuantity1(String component2) { return setComponent2(component2); } - /** - * Set the Quantity1 (component 2) from a BigDecimal object. - * - * @see #setComponent2(java.math.BigDecimal) - * - * @param component2 BigDecimal with the Quantity1 content to set - * @return the field object to enable build pattern - * @since 9.2.7 - */ - public Field92D setQuantity1(java.math.BigDecimal component2) { - return setComponent2(component2); - } - /** * Alternative method setter for field's Quantity1 (component 2) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10 becomes an Integer) * * @param component2 the Number with the Quantity1 content to set * @return the field object to enable build pattern - * @see #setQuantity1(java.math.BigDecimal) */ public Field92D setQuantity1(java.lang.Number component2) { return setComponent2(component2); @@ -557,32 +520,13 @@ public Field92D setComponent3(String component3) { return this; } - /** - * Set the component3 from a BigDecimal object. - *
- * Parses the BigDecimal into a SWIFT amount with truncated zero decimals and mandatory decimal separator. - *

- * @since 9.2.7 - * - * @param component3 the BigDecimal with the Quantity2 content to set - * @return the field object to enable build pattern - */ - public Field92D setComponent3(java.math.BigDecimal component3) { - setComponent(3, SwiftFormatUtils.getBigDecimal(component3)); - return this; - } /** * Alternative method setter for field's Quantity2 (component 3) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10.0 becomes an Float) * * @param component3 the Number with the Quantity2 content to set * @return the field object to enable build pattern - * @see #setQuantity2(java.math.BigDecimal) */ public Field92D setComponent3(java.lang.Number component3) { @@ -614,27 +558,13 @@ public Field92D setQuantity2(String component3) { return setComponent3(component3); } - /** - * Set the Quantity2 (component 3) from a BigDecimal object. - * - * @see #setComponent3(java.math.BigDecimal) - * - * @param component3 BigDecimal with the Quantity2 content to set - * @return the field object to enable build pattern - * @since 9.2.7 - */ - public Field92D setQuantity2(java.math.BigDecimal component3) { - return setComponent3(component3); - } - /** * Alternative method setter for field's Quantity2 (component 3) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10 becomes an Integer) * * @param component3 the Number with the Quantity2 content to set * @return the field object to enable build pattern - * @see #setQuantity2(java.math.BigDecimal) */ public Field92D setQuantity2(java.lang.Number component3) { return setComponent3(component3); @@ -657,6 +587,7 @@ public List amounts() { * @return the first amount as BigDecimal value. Can be null * @see AmountResolver#amount(Field) */ + @Override public BigDecimal amount() { return AmountResolver.amount(this); } @@ -668,6 +599,7 @@ public BigDecimal amount() { * * @return DSS component value or null if the DSS is not set or not available for this field. */ + @Override public String getDSS() { return null; } @@ -678,6 +610,7 @@ public String getDSS() { * @see #getDSS() * @return true if DSS is present, false otherwise. */ + @Override public boolean isDSSPresent() { return false; } @@ -692,6 +625,7 @@ public boolean isDSSPresent() { * * @return for generic fields returns the value of the conditional qualifier or null if not set or not applicable for this field. */ + @Override public String getConditionalQualifier() { return getComponent(CONDITIONAL_QUALIFIER); } @@ -759,7 +693,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field92D(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field92F.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field92F.java index 8e6d6a6b1..5ec05af3c 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field92F.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field92F.java @@ -35,12 +35,9 @@ import com.prowidesoftware.swift.model.field.MonetaryAmountContainer; import com.prowidesoftware.swift.model.field.MonetaryAmountResolver; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -220,21 +217,20 @@ public String getValueDisplay(int component, Locale locale) { //default format (as is) return getComponent(2); } - if (component == 3) { - //amount, rate - java.text.NumberFormat f = java.text.NumberFormat.getNumberInstance(notNull(locale)); - f.setMaximumFractionDigits(13); - BigDecimal n = getComponent3AsBigDecimal(); - if (n != null) { - return f.format(n); - } + // This is the last component, return directly without `if` + //amount, rate + java.text.NumberFormat f = java.text.NumberFormat.getNumberInstance(notNull(locale)); + f.setMaximumFractionDigits(13); + BigDecimal n = getComponent3AsBigDecimal(); + if (n != null) { + return f.format(n); } return null; } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -504,32 +500,13 @@ public Field92F setComponent3(String component3) { return this; } - /** - * Set the component3 from a BigDecimal object. - *
- * Parses the BigDecimal into a SWIFT amount with truncated zero decimals and mandatory decimal separator. - *

- * @since 9.2.7 - * - * @param component3 the BigDecimal with the Amount content to set - * @return the field object to enable build pattern - */ - public Field92F setComponent3(java.math.BigDecimal component3) { - setComponent(3, SwiftFormatUtils.getBigDecimal(component3)); - return this; - } /** * Alternative method setter for field's Amount (component 3) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10.0 becomes an Float) * * @param component3 the Number with the Amount content to set * @return the field object to enable build pattern - * @see #setAmount(java.math.BigDecimal) */ public Field92F setComponent3(java.lang.Number component3) { @@ -561,53 +538,45 @@ public Field92F setAmount(String component3) { return setComponent3(component3); } - /** - * Set the Amount (component 3) from a BigDecimal object. - * - * @see #setComponent3(java.math.BigDecimal) - * - * @param component3 BigDecimal with the Amount content to set - * @return the field object to enable build pattern - * @since 9.2.7 - */ - public Field92F setAmount(java.math.BigDecimal component3) { - return setComponent3(component3); - } - /** * Alternative method setter for field's Amount (component 3) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10 becomes an Integer) * * @param component3 the Number with the Amount content to set * @return the field object to enable build pattern - * @see #setAmount(java.math.BigDecimal) */ public Field92F setAmount(java.lang.Number component3) { return setComponent3(component3); } + @Override public List currencyStrings() { return MonetaryAmountResolver.currencyStrings(this); } + @Override public List currencies() { return MonetaryAmountResolver.currencies(this); } + @Override public Currency currency() { return MonetaryAmountResolver.resolveCurrency(this); } + @Override public String currencyString() { return MonetaryAmountResolver.resolveCurrencyString(this); } + @Override public void initializeCurrencies(String cur) { MonetaryAmountResolver.resolveSetCurrency(this, cur); } + @Override public void initializeCurrencies(Currency cur) { MonetaryAmountResolver.resolveSetCurrency(this, cur); } @@ -628,6 +597,7 @@ public List amounts() { * @return the first amount as BigDecimal value. Can be null * @see MonetaryAmountResolver#amount(Field) */ + @Override public BigDecimal amount() { return MonetaryAmountResolver.amount(this); } @@ -639,6 +609,7 @@ public BigDecimal amount() { * * @return DSS component value or null if the DSS is not set or not available for this field. */ + @Override public String getDSS() { return null; } @@ -649,6 +620,7 @@ public String getDSS() { * @see #getDSS() * @return true if DSS is present, false otherwise. */ + @Override public boolean isDSSPresent() { return false; } @@ -663,6 +635,7 @@ public boolean isDSSPresent() { * * @return for generic fields returns the value of the conditional qualifier or null if not set or not applicable for this field. */ + @Override public String getConditionalQualifier() { return getComponent(CONDITIONAL_QUALIFIER); } @@ -730,7 +703,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field92F(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field92H.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field92H.java index b7a11b465..d6bdc0396 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field92H.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field92H.java @@ -35,12 +35,9 @@ import com.prowidesoftware.swift.model.field.MonetaryAmountContainer; import com.prowidesoftware.swift.model.field.MonetaryAmountResolver; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -239,16 +236,14 @@ public String getValueDisplay(int component, Locale locale) { return f.format(n); } } - if (component == 4) { - //default format (as is) - return getComponent(4); - } - return null; + // This is the last component, return directly without `if` + //default format (as is) + return getComponent(4); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -537,32 +532,13 @@ public Field92H setComponent3(String component3) { return this; } - /** - * Set the component3 from a BigDecimal object. - *
- * Parses the BigDecimal into a SWIFT amount with truncated zero decimals and mandatory decimal separator. - *

- * @since 9.2.7 - * - * @param component3 the BigDecimal with the Amount content to set - * @return the field object to enable build pattern - */ - public Field92H setComponent3(java.math.BigDecimal component3) { - setComponent(3, SwiftFormatUtils.getBigDecimal(component3)); - return this; - } /** * Alternative method setter for field's Amount (component 3) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10.0 becomes an Float) * * @param component3 the Number with the Amount content to set * @return the field object to enable build pattern - * @see #setAmount(java.math.BigDecimal) */ public Field92H setComponent3(java.lang.Number component3) { @@ -594,27 +570,13 @@ public Field92H setAmount(String component3) { return setComponent3(component3); } - /** - * Set the Amount (component 3) from a BigDecimal object. - * - * @see #setComponent3(java.math.BigDecimal) - * - * @param component3 BigDecimal with the Amount content to set - * @return the field object to enable build pattern - * @since 9.2.7 - */ - public Field92H setAmount(java.math.BigDecimal component3) { - return setComponent3(component3); - } - /** * Alternative method setter for field's Amount (component 3) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10 becomes an Integer) * * @param component3 the Number with the Amount content to set * @return the field object to enable build pattern - * @see #setAmount(java.math.BigDecimal) */ public Field92H setAmount(java.lang.Number component3) { return setComponent3(component3); @@ -642,26 +604,32 @@ public Field92H setRateStatus(String component4) { } + @Override public List currencyStrings() { return MonetaryAmountResolver.currencyStrings(this); } + @Override public List currencies() { return MonetaryAmountResolver.currencies(this); } + @Override public Currency currency() { return MonetaryAmountResolver.resolveCurrency(this); } + @Override public String currencyString() { return MonetaryAmountResolver.resolveCurrencyString(this); } + @Override public void initializeCurrencies(String cur) { MonetaryAmountResolver.resolveSetCurrency(this, cur); } + @Override public void initializeCurrencies(Currency cur) { MonetaryAmountResolver.resolveSetCurrency(this, cur); } @@ -682,6 +650,7 @@ public List amounts() { * @return the first amount as BigDecimal value. Can be null * @see MonetaryAmountResolver#amount(Field) */ + @Override public BigDecimal amount() { return MonetaryAmountResolver.amount(this); } @@ -693,6 +662,7 @@ public BigDecimal amount() { * * @return DSS component value or null if the DSS is not set or not available for this field. */ + @Override public String getDSS() { return null; } @@ -703,6 +673,7 @@ public String getDSS() { * @see #getDSS() * @return true if DSS is present, false otherwise. */ + @Override public boolean isDSSPresent() { return false; } @@ -717,6 +688,7 @@ public boolean isDSSPresent() { * * @return for generic fields returns the value of the conditional qualifier or null if not set or not applicable for this field. */ + @Override public String getConditionalQualifier() { return getComponent(CONDITIONAL_QUALIFIER); } @@ -784,7 +756,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field92H(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field92J.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field92J.java index 58abe2721..7d49c273c 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field92J.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field92J.java @@ -35,12 +35,9 @@ import com.prowidesoftware.swift.model.field.MonetaryAmountContainer; import com.prowidesoftware.swift.model.field.MonetaryAmountResolver; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -267,16 +264,14 @@ public String getValueDisplay(int component, Locale locale) { return f.format(n); } } - if (component == 6) { - //default format (as is) - return getComponent(6); - } - return null; + // This is the last component, return directly without `if` + //default format (as is) + return getComponent(6); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -654,32 +649,13 @@ public Field92J setComponent5(String component5) { return this; } - /** - * Set the component5 from a BigDecimal object. - *
- * Parses the BigDecimal into a SWIFT amount with truncated zero decimals and mandatory decimal separator. - *

- * @since 9.2.7 - * - * @param component5 the BigDecimal with the Amount content to set - * @return the field object to enable build pattern - */ - public Field92J setComponent5(java.math.BigDecimal component5) { - setComponent(5, SwiftFormatUtils.getBigDecimal(component5)); - return this; - } /** * Alternative method setter for field's Amount (component 5) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10.0 becomes an Float) * * @param component5 the Number with the Amount content to set * @return the field object to enable build pattern - * @see #setAmount(java.math.BigDecimal) */ public Field92J setComponent5(java.lang.Number component5) { @@ -711,27 +687,13 @@ public Field92J setAmount(String component5) { return setComponent5(component5); } - /** - * Set the Amount (component 5) from a BigDecimal object. - * - * @see #setComponent5(java.math.BigDecimal) - * - * @param component5 BigDecimal with the Amount content to set - * @return the field object to enable build pattern - * @since 9.2.7 - */ - public Field92J setAmount(java.math.BigDecimal component5) { - return setComponent5(component5); - } - /** * Alternative method setter for field's Amount (component 5) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10 becomes an Integer) * * @param component5 the Number with the Amount content to set * @return the field object to enable build pattern - * @see #setAmount(java.math.BigDecimal) */ public Field92J setAmount(java.lang.Number component5) { return setComponent5(component5); @@ -759,26 +721,32 @@ public Field92J setRateStatus(String component6) { } + @Override public List currencyStrings() { return MonetaryAmountResolver.currencyStrings(this); } + @Override public List currencies() { return MonetaryAmountResolver.currencies(this); } + @Override public Currency currency() { return MonetaryAmountResolver.resolveCurrency(this); } + @Override public String currencyString() { return MonetaryAmountResolver.resolveCurrencyString(this); } + @Override public void initializeCurrencies(String cur) { MonetaryAmountResolver.resolveSetCurrency(this, cur); } + @Override public void initializeCurrencies(Currency cur) { MonetaryAmountResolver.resolveSetCurrency(this, cur); } @@ -799,6 +767,7 @@ public List amounts() { * @return the first amount as BigDecimal value. Can be null * @see MonetaryAmountResolver#amount(Field) */ + @Override public BigDecimal amount() { return MonetaryAmountResolver.amount(this); } @@ -810,6 +779,7 @@ public BigDecimal amount() { * * @return DSS component value or null if the DSS is not set or not available for this field. */ + @Override public String getDSS() { return getComponent2(); } @@ -820,6 +790,7 @@ public String getDSS() { * @see #getDSS() * @return true if DSS is present, false otherwise. */ + @Override public boolean isDSSPresent() { return getComponent2() != null; } @@ -834,6 +805,7 @@ public boolean isDSSPresent() { * * @return for generic fields returns the value of the conditional qualifier or null if not set or not applicable for this field. */ + @Override public String getConditionalQualifier() { return getComponent(CONDITIONAL_QUALIFIER); } @@ -901,7 +873,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field92J(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field92K.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field92K.java index 58b010a52..2b427fab4 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field92K.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field92K.java @@ -30,12 +30,9 @@ import com.prowidesoftware.swift.model.field.GenericField; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -201,16 +198,14 @@ public String getValueDisplay(int component, Locale locale) { //default format (as is) return getComponent(1); } - if (component == 2) { - //default format (as is) - return getComponent(2); - } - return null; + // This is the last component, return directly without `if` + //default format (as is) + return getComponent(2); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -396,6 +391,7 @@ public Field92K setRateTypeCode(String component2) { * * @return DSS component value or null if the DSS is not set or not available for this field. */ + @Override public String getDSS() { return null; } @@ -406,6 +402,7 @@ public String getDSS() { * @see #getDSS() * @return true if DSS is present, false otherwise. */ + @Override public boolean isDSSPresent() { return false; } @@ -420,6 +417,7 @@ public boolean isDSSPresent() { * * @return for generic fields returns the value of the conditional qualifier or null if not set or not applicable for this field. */ + @Override public String getConditionalQualifier() { return getComponent(CONDITIONAL_QUALIFIER); } @@ -487,7 +485,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field92K(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field92L.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field92L.java index f3853579b..34ea4fb0d 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field92L.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field92L.java @@ -35,12 +35,9 @@ import com.prowidesoftware.swift.model.field.MonetaryAmountContainer; import com.prowidesoftware.swift.model.field.MonetaryAmountResolver; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -253,21 +250,20 @@ public String getValueDisplay(int component, Locale locale) { //default format (as is) return getComponent(4); } - if (component == 5) { - //amount, rate - java.text.NumberFormat f = java.text.NumberFormat.getNumberInstance(notNull(locale)); - f.setMaximumFractionDigits(13); - BigDecimal n = getComponent5AsBigDecimal(); - if (n != null) { - return f.format(n); - } + // This is the last component, return directly without `if` + //amount, rate + java.text.NumberFormat f = java.text.NumberFormat.getNumberInstance(notNull(locale)); + f.setMaximumFractionDigits(13); + BigDecimal n = getComponent5AsBigDecimal(); + if (n != null) { + return f.format(n); } return null; } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -614,32 +610,13 @@ public Field92L setComponent3(String component3) { return this; } - /** - * Set the component3 from a BigDecimal object. - *
- * Parses the BigDecimal into a SWIFT amount with truncated zero decimals and mandatory decimal separator. - *

- * @since 9.2.7 - * - * @param component3 the BigDecimal with the Amount1 content to set - * @return the field object to enable build pattern - */ - public Field92L setComponent3(java.math.BigDecimal component3) { - setComponent(3, SwiftFormatUtils.getBigDecimal(component3)); - return this; - } /** * Alternative method setter for field's Amount1 (component 3) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10.0 becomes an Float) * * @param component3 the Number with the Amount1 content to set * @return the field object to enable build pattern - * @see #setAmount1(java.math.BigDecimal) */ public Field92L setComponent3(java.lang.Number component3) { @@ -671,27 +648,13 @@ public Field92L setAmount1(String component3) { return setComponent3(component3); } - /** - * Set the Amount1 (component 3) from a BigDecimal object. - * - * @see #setComponent3(java.math.BigDecimal) - * - * @param component3 BigDecimal with the Amount1 content to set - * @return the field object to enable build pattern - * @since 9.2.7 - */ - public Field92L setAmount1(java.math.BigDecimal component3) { - return setComponent3(component3); - } - /** * Alternative method setter for field's Amount1 (component 3) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10 becomes an Integer) * * @param component3 the Number with the Amount1 content to set * @return the field object to enable build pattern - * @see #setAmount1(java.math.BigDecimal) */ public Field92L setAmount1(java.lang.Number component3) { return setComponent3(component3); @@ -752,32 +715,13 @@ public Field92L setComponent5(String component5) { return this; } - /** - * Set the component5 from a BigDecimal object. - *
- * Parses the BigDecimal into a SWIFT amount with truncated zero decimals and mandatory decimal separator. - *

- * @since 9.2.7 - * - * @param component5 the BigDecimal with the Amount2 content to set - * @return the field object to enable build pattern - */ - public Field92L setComponent5(java.math.BigDecimal component5) { - setComponent(5, SwiftFormatUtils.getBigDecimal(component5)); - return this; - } /** * Alternative method setter for field's Amount2 (component 5) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10.0 becomes an Float) * * @param component5 the Number with the Amount2 content to set * @return the field object to enable build pattern - * @see #setAmount2(java.math.BigDecimal) */ public Field92L setComponent5(java.lang.Number component5) { @@ -809,53 +753,45 @@ public Field92L setAmount2(String component5) { return setComponent5(component5); } - /** - * Set the Amount2 (component 5) from a BigDecimal object. - * - * @see #setComponent5(java.math.BigDecimal) - * - * @param component5 BigDecimal with the Amount2 content to set - * @return the field object to enable build pattern - * @since 9.2.7 - */ - public Field92L setAmount2(java.math.BigDecimal component5) { - return setComponent5(component5); - } - /** * Alternative method setter for field's Amount2 (component 5) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10 becomes an Integer) * * @param component5 the Number with the Amount2 content to set * @return the field object to enable build pattern - * @see #setAmount2(java.math.BigDecimal) */ public Field92L setAmount2(java.lang.Number component5) { return setComponent5(component5); } + @Override public List currencyStrings() { return MonetaryAmountResolver.currencyStrings(this); } + @Override public List currencies() { return MonetaryAmountResolver.currencies(this); } + @Override public Currency currency() { return MonetaryAmountResolver.resolveCurrency(this); } + @Override public String currencyString() { return MonetaryAmountResolver.resolveCurrencyString(this); } + @Override public void initializeCurrencies(String cur) { MonetaryAmountResolver.resolveSetCurrency(this, cur); } + @Override public void initializeCurrencies(Currency cur) { MonetaryAmountResolver.resolveSetCurrency(this, cur); } @@ -876,6 +812,7 @@ public List amounts() { * @return the first amount as BigDecimal value. Can be null * @see MonetaryAmountResolver#amount(Field) */ + @Override public BigDecimal amount() { return MonetaryAmountResolver.amount(this); } @@ -887,6 +824,7 @@ public BigDecimal amount() { * * @return DSS component value or null if the DSS is not set or not available for this field. */ + @Override public String getDSS() { return null; } @@ -897,6 +835,7 @@ public String getDSS() { * @see #getDSS() * @return true if DSS is present, false otherwise. */ + @Override public boolean isDSSPresent() { return false; } @@ -911,6 +850,7 @@ public boolean isDSSPresent() { * * @return for generic fields returns the value of the conditional qualifier or null if not set or not applicable for this field. */ + @Override public String getConditionalQualifier() { return getComponent(CONDITIONAL_QUALIFIER); } @@ -978,7 +918,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field92L(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field92M.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field92M.java index 5b0226fb6..ac2efd792 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field92M.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field92M.java @@ -35,12 +35,9 @@ import com.prowidesoftware.swift.model.field.MonetaryAmountContainer; import com.prowidesoftware.swift.model.field.MonetaryAmountResolver; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -239,21 +236,20 @@ public String getValueDisplay(int component, Locale locale) { return f.format(n); } } - if (component == 4) { - //amount, rate - java.text.NumberFormat f = java.text.NumberFormat.getNumberInstance(notNull(locale)); - f.setMaximumFractionDigits(13); - BigDecimal n = getComponent4AsBigDecimal(); - if (n != null) { - return f.format(n); - } + // This is the last component, return directly without `if` + //amount, rate + java.text.NumberFormat f = java.text.NumberFormat.getNumberInstance(notNull(locale)); + f.setMaximumFractionDigits(13); + BigDecimal n = getComponent4AsBigDecimal(); + if (n != null) { + return f.format(n); } return null; } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -561,32 +557,13 @@ public Field92M setComponent3(String component3) { return this; } - /** - * Set the component3 from a BigDecimal object. - *
- * Parses the BigDecimal into a SWIFT amount with truncated zero decimals and mandatory decimal separator. - *

- * @since 9.2.7 - * - * @param component3 the BigDecimal with the Amount content to set - * @return the field object to enable build pattern - */ - public Field92M setComponent3(java.math.BigDecimal component3) { - setComponent(3, SwiftFormatUtils.getBigDecimal(component3)); - return this; - } /** * Alternative method setter for field's Amount (component 3) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10.0 becomes an Float) * * @param component3 the Number with the Amount content to set * @return the field object to enable build pattern - * @see #setAmount(java.math.BigDecimal) */ public Field92M setComponent3(java.lang.Number component3) { @@ -618,27 +595,13 @@ public Field92M setAmount(String component3) { return setComponent3(component3); } - /** - * Set the Amount (component 3) from a BigDecimal object. - * - * @see #setComponent3(java.math.BigDecimal) - * - * @param component3 BigDecimal with the Amount content to set - * @return the field object to enable build pattern - * @since 9.2.7 - */ - public Field92M setAmount(java.math.BigDecimal component3) { - return setComponent3(component3); - } - /** * Alternative method setter for field's Amount (component 3) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10 becomes an Integer) * * @param component3 the Number with the Amount content to set * @return the field object to enable build pattern - * @see #setAmount(java.math.BigDecimal) */ public Field92M setAmount(java.lang.Number component3) { return setComponent3(component3); @@ -655,32 +618,13 @@ public Field92M setComponent4(String component4) { return this; } - /** - * Set the component4 from a BigDecimal object. - *
- * Parses the BigDecimal into a SWIFT amount with truncated zero decimals and mandatory decimal separator. - *

- * @since 9.2.7 - * - * @param component4 the BigDecimal with the Quantity content to set - * @return the field object to enable build pattern - */ - public Field92M setComponent4(java.math.BigDecimal component4) { - setComponent(4, SwiftFormatUtils.getBigDecimal(component4)); - return this; - } /** * Alternative method setter for field's Quantity (component 4) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10.0 becomes an Float) * * @param component4 the Number with the Quantity content to set * @return the field object to enable build pattern - * @see #setQuantity(java.math.BigDecimal) */ public Field92M setComponent4(java.lang.Number component4) { @@ -712,53 +656,45 @@ public Field92M setQuantity(String component4) { return setComponent4(component4); } - /** - * Set the Quantity (component 4) from a BigDecimal object. - * - * @see #setComponent4(java.math.BigDecimal) - * - * @param component4 BigDecimal with the Quantity content to set - * @return the field object to enable build pattern - * @since 9.2.7 - */ - public Field92M setQuantity(java.math.BigDecimal component4) { - return setComponent4(component4); - } - /** * Alternative method setter for field's Quantity (component 4) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10 becomes an Integer) * * @param component4 the Number with the Quantity content to set * @return the field object to enable build pattern - * @see #setQuantity(java.math.BigDecimal) */ public Field92M setQuantity(java.lang.Number component4) { return setComponent4(component4); } + @Override public List currencyStrings() { return MonetaryAmountResolver.currencyStrings(this); } + @Override public List currencies() { return MonetaryAmountResolver.currencies(this); } + @Override public Currency currency() { return MonetaryAmountResolver.resolveCurrency(this); } + @Override public String currencyString() { return MonetaryAmountResolver.resolveCurrencyString(this); } + @Override public void initializeCurrencies(String cur) { MonetaryAmountResolver.resolveSetCurrency(this, cur); } + @Override public void initializeCurrencies(Currency cur) { MonetaryAmountResolver.resolveSetCurrency(this, cur); } @@ -779,6 +715,7 @@ public List amounts() { * @return the first amount as BigDecimal value. Can be null * @see MonetaryAmountResolver#amount(Field) */ + @Override public BigDecimal amount() { return MonetaryAmountResolver.amount(this); } @@ -790,6 +727,7 @@ public BigDecimal amount() { * * @return DSS component value or null if the DSS is not set or not available for this field. */ + @Override public String getDSS() { return null; } @@ -800,6 +738,7 @@ public String getDSS() { * @see #getDSS() * @return true if DSS is present, false otherwise. */ + @Override public boolean isDSSPresent() { return false; } @@ -814,6 +753,7 @@ public boolean isDSSPresent() { * * @return for generic fields returns the value of the conditional qualifier or null if not set or not applicable for this field. */ + @Override public String getConditionalQualifier() { return getComponent(CONDITIONAL_QUALIFIER); } @@ -881,7 +821,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field92M(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field92N.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field92N.java index 6dc44605c..94b1776ce 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field92N.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field92N.java @@ -35,12 +35,9 @@ import com.prowidesoftware.swift.model.field.MonetaryAmountContainer; import com.prowidesoftware.swift.model.field.MonetaryAmountResolver; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -238,21 +235,20 @@ public String getValueDisplay(int component, Locale locale) { //default format (as is) return getComponent(3); } - if (component == 4) { - //amount, rate - java.text.NumberFormat f = java.text.NumberFormat.getNumberInstance(notNull(locale)); - f.setMaximumFractionDigits(13); - BigDecimal n = getComponent4AsBigDecimal(); - if (n != null) { - return f.format(n); - } + // This is the last component, return directly without `if` + //amount, rate + java.text.NumberFormat f = java.text.NumberFormat.getNumberInstance(notNull(locale)); + f.setMaximumFractionDigits(13); + BigDecimal n = getComponent4AsBigDecimal(); + if (n != null) { + return f.format(n); } return null; } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -516,32 +512,13 @@ public Field92N setComponent2(String component2) { return this; } - /** - * Set the component2 from a BigDecimal object. - *
- * Parses the BigDecimal into a SWIFT amount with truncated zero decimals and mandatory decimal separator. - *

- * @since 9.2.7 - * - * @param component2 the BigDecimal with the Quantity content to set - * @return the field object to enable build pattern - */ - public Field92N setComponent2(java.math.BigDecimal component2) { - setComponent(2, SwiftFormatUtils.getBigDecimal(component2)); - return this; - } /** * Alternative method setter for field's Quantity (component 2) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10.0 becomes an Float) * * @param component2 the Number with the Quantity content to set * @return the field object to enable build pattern - * @see #setQuantity(java.math.BigDecimal) */ public Field92N setComponent2(java.lang.Number component2) { @@ -573,27 +550,13 @@ public Field92N setQuantity(String component2) { return setComponent2(component2); } - /** - * Set the Quantity (component 2) from a BigDecimal object. - * - * @see #setComponent2(java.math.BigDecimal) - * - * @param component2 BigDecimal with the Quantity content to set - * @return the field object to enable build pattern - * @since 9.2.7 - */ - public Field92N setQuantity(java.math.BigDecimal component2) { - return setComponent2(component2); - } - /** * Alternative method setter for field's Quantity (component 2) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10 becomes an Integer) * * @param component2 the Number with the Quantity content to set * @return the field object to enable build pattern - * @see #setQuantity(java.math.BigDecimal) */ public Field92N setQuantity(java.lang.Number component2) { return setComponent2(component2); @@ -654,32 +617,13 @@ public Field92N setComponent4(String component4) { return this; } - /** - * Set the component4 from a BigDecimal object. - *
- * Parses the BigDecimal into a SWIFT amount with truncated zero decimals and mandatory decimal separator. - *

- * @since 9.2.7 - * - * @param component4 the BigDecimal with the Amount content to set - * @return the field object to enable build pattern - */ - public Field92N setComponent4(java.math.BigDecimal component4) { - setComponent(4, SwiftFormatUtils.getBigDecimal(component4)); - return this; - } /** * Alternative method setter for field's Amount (component 4) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10.0 becomes an Float) * * @param component4 the Number with the Amount content to set * @return the field object to enable build pattern - * @see #setAmount(java.math.BigDecimal) */ public Field92N setComponent4(java.lang.Number component4) { @@ -711,53 +655,45 @@ public Field92N setAmount(String component4) { return setComponent4(component4); } - /** - * Set the Amount (component 4) from a BigDecimal object. - * - * @see #setComponent4(java.math.BigDecimal) - * - * @param component4 BigDecimal with the Amount content to set - * @return the field object to enable build pattern - * @since 9.2.7 - */ - public Field92N setAmount(java.math.BigDecimal component4) { - return setComponent4(component4); - } - /** * Alternative method setter for field's Amount (component 4) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10 becomes an Integer) * * @param component4 the Number with the Amount content to set * @return the field object to enable build pattern - * @see #setAmount(java.math.BigDecimal) */ public Field92N setAmount(java.lang.Number component4) { return setComponent4(component4); } + @Override public List currencyStrings() { return MonetaryAmountResolver.currencyStrings(this); } + @Override public List currencies() { return MonetaryAmountResolver.currencies(this); } + @Override public Currency currency() { return MonetaryAmountResolver.resolveCurrency(this); } + @Override public String currencyString() { return MonetaryAmountResolver.resolveCurrencyString(this); } + @Override public void initializeCurrencies(String cur) { MonetaryAmountResolver.resolveSetCurrency(this, cur); } + @Override public void initializeCurrencies(Currency cur) { MonetaryAmountResolver.resolveSetCurrency(this, cur); } @@ -778,6 +714,7 @@ public List amounts() { * @return the first amount as BigDecimal value. Can be null * @see MonetaryAmountResolver#amount(Field) */ + @Override public BigDecimal amount() { return MonetaryAmountResolver.amount(this); } @@ -789,6 +726,7 @@ public BigDecimal amount() { * * @return DSS component value or null if the DSS is not set or not available for this field. */ + @Override public String getDSS() { return null; } @@ -799,6 +737,7 @@ public String getDSS() { * @see #getDSS() * @return true if DSS is present, false otherwise. */ + @Override public boolean isDSSPresent() { return false; } @@ -813,6 +752,7 @@ public boolean isDSSPresent() { * * @return for generic fields returns the value of the conditional qualifier or null if not set or not applicable for this field. */ + @Override public String getConditionalQualifier() { return getComponent(CONDITIONAL_QUALIFIER); } @@ -880,7 +820,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field92N(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field93A.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field93A.java index 46ac3d083..3666db61b 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field93A.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field93A.java @@ -30,12 +30,9 @@ import com.prowidesoftware.swift.model.field.GenericField; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -215,16 +212,14 @@ public String getValueDisplay(int component, Locale locale) { //default format (as is) return getComponent(2); } - if (component == 3) { - //default format (as is) - return getComponent(3); - } - return null; + // This is the last component, return directly without `if` + //default format (as is) + return getComponent(3); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -456,6 +451,7 @@ public Field93A setSubbalanceType(String component3) { * * @return DSS component value or null if the DSS is not set or not available for this field. */ + @Override public String getDSS() { return getComponent2(); } @@ -466,6 +462,7 @@ public String getDSS() { * @see #getDSS() * @return true if DSS is present, false otherwise. */ + @Override public boolean isDSSPresent() { return getComponent2() != null; } @@ -480,6 +477,7 @@ public boolean isDSSPresent() { * * @return for generic fields returns the value of the conditional qualifier or null if not set or not applicable for this field. */ + @Override public String getConditionalQualifier() { return getComponent(CONDITIONAL_QUALIFIER); } @@ -547,7 +545,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field93A(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field93E.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field93E.java index de74dfc5e..7f5b62221 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field93E.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field93E.java @@ -34,12 +34,9 @@ import com.prowidesoftware.swift.model.field.AmountContainer; import com.prowidesoftware.swift.model.field.AmountResolver; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -245,21 +242,20 @@ public String getValueDisplay(int component, Locale locale) { //default format (as is) return getComponent(4); } - if (component == 5) { - //amount, rate - java.text.NumberFormat f = java.text.NumberFormat.getNumberInstance(notNull(locale)); - f.setMaximumFractionDigits(13); - BigDecimal n = getComponent5AsBigDecimal(); - if (n != null) { - return f.format(n); - } + // This is the last component, return directly without `if` + //amount, rate + java.text.NumberFormat f = java.text.NumberFormat.getNumberInstance(notNull(locale)); + f.setMaximumFractionDigits(13); + BigDecimal n = getComponent5AsBigDecimal(); + if (n != null) { + return f.format(n); } return null; } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -569,32 +565,13 @@ public Field93E setComponent5(String component5) { return this; } - /** - * Set the component5 from a BigDecimal object. - *
- * Parses the BigDecimal into a SWIFT amount with truncated zero decimals and mandatory decimal separator. - *

- * @since 9.2.7 - * - * @param component5 the BigDecimal with the Balance of Digital Tokens content to set - * @return the field object to enable build pattern - */ - public Field93E setComponent5(java.math.BigDecimal component5) { - setComponent(5, SwiftFormatUtils.getBigDecimal(component5)); - return this; - } /** * Alternative method setter for field's Balance of Digital Tokens (component 5) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10.0 becomes an Float) * * @param component5 the Number with the Balance of Digital Tokens content to set * @return the field object to enable build pattern - * @see #setBalanceofDigitalTokens(java.math.BigDecimal) */ public Field93E setComponent5(java.lang.Number component5) { @@ -626,27 +603,13 @@ public Field93E setBalanceofDigitalTokens(String component5) { return setComponent5(component5); } - /** - * Set the Balance of Digital Tokens (component 5) from a BigDecimal object. - * - * @see #setComponent5(java.math.BigDecimal) - * - * @param component5 BigDecimal with the Balance of Digital Tokens content to set - * @return the field object to enable build pattern - * @since 9.2.7 - */ - public Field93E setBalanceofDigitalTokens(java.math.BigDecimal component5) { - return setComponent5(component5); - } - /** * Alternative method setter for field's Balance of Digital Tokens (component 5) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10 becomes an Integer) * * @param component5 the Number with the Balance of Digital Tokens content to set * @return the field object to enable build pattern - * @see #setBalanceofDigitalTokens(java.math.BigDecimal) */ public Field93E setBalanceofDigitalTokens(java.lang.Number component5) { return setComponent5(component5); @@ -669,6 +632,7 @@ public List amounts() { * @return the first amount as BigDecimal value. Can be null * @see AmountResolver#amount(Field) */ + @Override public BigDecimal amount() { return AmountResolver.amount(this); } @@ -680,6 +644,7 @@ public BigDecimal amount() { * * @return DSS component value or null if the DSS is not set or not available for this field. */ + @Override public String getDSS() { return null; } @@ -690,6 +655,7 @@ public String getDSS() { * @see #getDSS() * @return true if DSS is present, false otherwise. */ + @Override public boolean isDSSPresent() { return false; } @@ -704,6 +670,7 @@ public boolean isDSSPresent() { * * @return for generic fields returns the value of the conditional qualifier or null if not set or not applicable for this field. */ + @Override public String getConditionalQualifier() { return getComponent(CONDITIONAL_QUALIFIER); } @@ -771,7 +738,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field93E(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field93F.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field93F.java index e4d33faf5..097567364 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field93F.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field93F.java @@ -34,12 +34,9 @@ import com.prowidesoftware.swift.model.field.AmountContainer; import com.prowidesoftware.swift.model.field.AmountResolver; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -245,21 +242,20 @@ public String getValueDisplay(int component, Locale locale) { //default format (as is) return getComponent(4); } - if (component == 5) { - //amount, rate - java.text.NumberFormat f = java.text.NumberFormat.getNumberInstance(notNull(locale)); - f.setMaximumFractionDigits(13); - BigDecimal n = getComponent5AsBigDecimal(); - if (n != null) { - return f.format(n); - } + // This is the last component, return directly without `if` + //amount, rate + java.text.NumberFormat f = java.text.NumberFormat.getNumberInstance(notNull(locale)); + f.setMaximumFractionDigits(13); + BigDecimal n = getComponent5AsBigDecimal(); + if (n != null) { + return f.format(n); } return null; } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -572,32 +568,13 @@ public Field93F setComponent5(String component5) { return this; } - /** - * Set the component5 from a BigDecimal object. - *
- * Parses the BigDecimal into a SWIFT amount with truncated zero decimals and mandatory decimal separator. - *

- * @since 9.2.7 - * - * @param component5 the BigDecimal with the Balance of Digital Tokens content to set - * @return the field object to enable build pattern - */ - public Field93F setComponent5(java.math.BigDecimal component5) { - setComponent(5, SwiftFormatUtils.getBigDecimal(component5)); - return this; - } /** * Alternative method setter for field's Balance of Digital Tokens (component 5) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10.0 becomes an Float) * * @param component5 the Number with the Balance of Digital Tokens content to set * @return the field object to enable build pattern - * @see #setBalanceofDigitalTokens(java.math.BigDecimal) */ public Field93F setComponent5(java.lang.Number component5) { @@ -629,27 +606,13 @@ public Field93F setBalanceofDigitalTokens(String component5) { return setComponent5(component5); } - /** - * Set the Balance of Digital Tokens (component 5) from a BigDecimal object. - * - * @see #setComponent5(java.math.BigDecimal) - * - * @param component5 BigDecimal with the Balance of Digital Tokens content to set - * @return the field object to enable build pattern - * @since 9.2.7 - */ - public Field93F setBalanceofDigitalTokens(java.math.BigDecimal component5) { - return setComponent5(component5); - } - /** * Alternative method setter for field's Balance of Digital Tokens (component 5) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10 becomes an Integer) * * @param component5 the Number with the Balance of Digital Tokens content to set * @return the field object to enable build pattern - * @see #setBalanceofDigitalTokens(java.math.BigDecimal) */ public Field93F setBalanceofDigitalTokens(java.lang.Number component5) { return setComponent5(component5); @@ -672,6 +635,7 @@ public List amounts() { * @return the first amount as BigDecimal value. Can be null * @see AmountResolver#amount(Field) */ + @Override public BigDecimal amount() { return AmountResolver.amount(this); } @@ -683,6 +647,7 @@ public BigDecimal amount() { * * @return DSS component value or null if the DSS is not set or not available for this field. */ + @Override public String getDSS() { return getComponent2(); } @@ -693,6 +658,7 @@ public String getDSS() { * @see #getDSS() * @return true if DSS is present, false otherwise. */ + @Override public boolean isDSSPresent() { return getComponent2() != null; } @@ -707,6 +673,7 @@ public boolean isDSSPresent() { * * @return for generic fields returns the value of the conditional qualifier or null if not set or not applicable for this field. */ + @Override public String getConditionalQualifier() { return getComponent(CONDITIONAL_QUALIFIER); } @@ -774,7 +741,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field93F(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field94A.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field94A.java index 1f8887121..bb9dbaa58 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field94A.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field94A.java @@ -29,12 +29,9 @@ -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -183,19 +180,16 @@ public String getValue() { */ @Override public String getValueDisplay(int component, Locale locale) { - if (component < 1 || component > 1) { + if (component != 1) { throw new IllegalArgumentException("invalid component number " + component + " for field 94A"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -398,7 +392,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field94A(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field94B.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field94B.java index af507bdd5..e1411fe1b 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field94B.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field94B.java @@ -30,12 +30,9 @@ import com.prowidesoftware.swift.model.field.GenericField; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -228,16 +225,14 @@ public String getValueDisplay(int component, Locale locale) { //default format (as is) return getComponent(3); } - if (component == 4) { - //default format (as is) - return getComponent(4); - } - return null; + // This is the last component, return directly without `if` + //default format (as is) + return getComponent(4); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -509,6 +504,7 @@ public Field94B setNarrative(String component4) { * * @return DSS component value or null if the DSS is not set or not available for this field. */ + @Override public String getDSS() { return getComponent2(); } @@ -519,6 +515,7 @@ public String getDSS() { * @see #getDSS() * @return true if DSS is present, false otherwise. */ + @Override public boolean isDSSPresent() { return getComponent2() != null; } @@ -533,6 +530,7 @@ public boolean isDSSPresent() { * * @return for generic fields returns the value of the conditional qualifier or null if not set or not applicable for this field. */ + @Override public String getConditionalQualifier() { return getComponent(CONDITIONAL_QUALIFIER); } @@ -600,7 +598,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field94B(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field94C.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field94C.java index 5b79b304e..5b801eed6 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field94C.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field94C.java @@ -30,12 +30,9 @@ import com.prowidesoftware.swift.model.field.GenericField; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -201,16 +198,14 @@ public String getValueDisplay(int component, Locale locale) { //default format (as is) return getComponent(1); } - if (component == 2) { - //default format (as is) - return getComponent(2); - } - return null; + // This is the last component, return directly without `if` + //default format (as is) + return getComponent(2); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -396,6 +391,7 @@ public Field94C setCountryCode(String component2) { * * @return DSS component value or null if the DSS is not set or not available for this field. */ + @Override public String getDSS() { return null; } @@ -406,6 +402,7 @@ public String getDSS() { * @see #getDSS() * @return true if DSS is present, false otherwise. */ + @Override public boolean isDSSPresent() { return false; } @@ -420,6 +417,7 @@ public boolean isDSSPresent() { * * @return for generic fields returns the value of the conditional qualifier or null if not set or not applicable for this field. */ + @Override public String getConditionalQualifier() { return getComponent(CONDITIONAL_QUALIFIER); } @@ -487,7 +485,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field94C(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field94D.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field94D.java index 433b9023b..d6fadb18b 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field94D.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field94D.java @@ -30,12 +30,9 @@ import com.prowidesoftware.swift.model.field.GenericField; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -215,16 +212,14 @@ public String getValueDisplay(int component, Locale locale) { //default format (as is) return getComponent(2); } - if (component == 3) { - //default format (as is) - return getComponent(3); - } - return null; + // This is the last component, return directly without `if` + //default format (as is) + return getComponent(3); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -453,6 +448,7 @@ public Field94D setPlace(String component3) { * * @return DSS component value or null if the DSS is not set or not available for this field. */ + @Override public String getDSS() { return null; } @@ -463,6 +459,7 @@ public String getDSS() { * @see #getDSS() * @return true if DSS is present, false otherwise. */ + @Override public boolean isDSSPresent() { return false; } @@ -477,6 +474,7 @@ public boolean isDSSPresent() { * * @return for generic fields returns the value of the conditional qualifier or null if not set or not applicable for this field. */ + @Override public String getConditionalQualifier() { return getComponent(CONDITIONAL_QUALIFIER); } @@ -544,7 +542,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field94D(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field94E.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field94E.java index 5af9c2127..6777dafdf 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field94E.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field94E.java @@ -31,12 +31,9 @@ import com.prowidesoftware.swift.model.field.GenericField; import com.prowidesoftware.swift.model.field.MultiLineField; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -252,16 +249,14 @@ public String getValueDisplay(int component, Locale locale) { //default format (as is) return getComponent(10); } - if (component == 11) { - //default format (as is) - return getComponent(11); - } - return null; + // This is the last component, return directly without `if` + //default format (as is) + return getComponent(11); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -874,6 +869,7 @@ public Field94E setAddressLine10(String component11) { * * @return DSS component value or null if the DSS is not set or not available for this field. */ + @Override public String getDSS() { return null; } @@ -884,6 +880,7 @@ public String getDSS() { * @see #getDSS() * @return true if DSS is present, false otherwise. */ + @Override public boolean isDSSPresent() { return false; } @@ -898,6 +895,7 @@ public boolean isDSSPresent() { * * @return for generic fields returns the value of the conditional qualifier or null if not set or not applicable for this field. */ + @Override public String getConditionalQualifier() { return getComponent(CONDITIONAL_QUALIFIER); } @@ -965,7 +963,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field94E(f)); } @@ -981,6 +979,7 @@ public static List getAll(final SwiftTagListBlock block) { * @return line content or null if not present or if line number is above the expected * @since 7.7 */ + @Override public String getLine(int line) { return getLine(line, 0); } @@ -994,6 +993,7 @@ public String getLine(int line) { * @return line content or null if not present or if line number is above the expected * @since 7.7 */ + @Override public String getLine(int line, int offset) { Field94E cp = newInstance(this); return getLine(cp, line, null, offset); @@ -1006,6 +1006,7 @@ public String getLine(int line, int offset) { * @return lines content or empty list if field's value is empty * @since 7.7 */ + @Override public List getLines() { return SwiftParseUtils.getLines(getValue()); } @@ -1018,6 +1019,7 @@ public List getLines() { * @return found lines or empty list if lines are not present or the offset is invalid * @since 7.7 */ + @Override public List getLines(int offset) { Field94E cp = newInstance(this); return SwiftParseUtils.getLines(getLine(cp, null, null, offset)); @@ -1032,6 +1034,7 @@ public List getLines(int offset) { * @return found lines or empty list if value is empty * @since 7.7 */ + @Override public List getLinesBetween(int start, int end) { return getLinesBetween(start, end, 0); } @@ -1046,6 +1049,7 @@ public List getLinesBetween(int start, int end) { * @return found lines or empty list if lines are not present or the offset is invalid * @since 7.7 */ + @Override public List getLinesBetween(int start, int end, int offset) { Field94E cp = newInstance(this); return SwiftParseUtils.getLines(getLine(cp, start, end, offset)); diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field94F.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field94F.java index 7e9964386..547cc4d95 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field94F.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field94F.java @@ -33,12 +33,9 @@ import com.prowidesoftware.swift.model.field.BICContainer; import com.prowidesoftware.swift.model.field.BICResolver; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -220,16 +217,14 @@ public String getValueDisplay(int component, Locale locale) { //default format (as is) return getComponent(2); } - if (component == 3) { - //default format (as is) - return getComponent(3); - } - return null; + // This is the last component, return directly without `if` + //default format (as is) + return getComponent(3); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -494,10 +489,12 @@ public Field94F setIdentifierCode(com.prowidesoftware.swift.model.BIC component3 } + @Override public List bics() { return BICResolver.bics(this); } + @Override public List bicStrings () { return BICResolver.bicStrings(this); } @@ -509,6 +506,7 @@ public List bicStrings () { * * @return DSS component value or null if the DSS is not set or not available for this field. */ + @Override public String getDSS() { return null; } @@ -519,6 +517,7 @@ public String getDSS() { * @see #getDSS() * @return true if DSS is present, false otherwise. */ + @Override public boolean isDSSPresent() { return false; } @@ -533,6 +532,7 @@ public boolean isDSSPresent() { * * @return for generic fields returns the value of the conditional qualifier or null if not set or not applicable for this field. */ + @Override public String getConditionalQualifier() { return getComponent(CONDITIONAL_QUALIFIER); } @@ -600,7 +600,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field94F(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field94G.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field94G.java index 4af709453..b9d9a2060 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field94G.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field94G.java @@ -31,12 +31,9 @@ import com.prowidesoftware.swift.model.field.GenericField; import com.prowidesoftware.swift.model.field.MultiLineField; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -215,16 +212,14 @@ public String getValueDisplay(int component, Locale locale) { //default format (as is) return getComponent(2); } - if (component == 3) { - //default format (as is) - return getComponent(3); - } - return null; + // This is the last component, return directly without `if` + //default format (as is) + return getComponent(3); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -493,6 +488,7 @@ public Field94G setAddressLine2(String component3) { * * @return DSS component value or null if the DSS is not set or not available for this field. */ + @Override public String getDSS() { return null; } @@ -503,6 +499,7 @@ public String getDSS() { * @see #getDSS() * @return true if DSS is present, false otherwise. */ + @Override public boolean isDSSPresent() { return false; } @@ -517,6 +514,7 @@ public boolean isDSSPresent() { * * @return for generic fields returns the value of the conditional qualifier or null if not set or not applicable for this field. */ + @Override public String getConditionalQualifier() { return getComponent(CONDITIONAL_QUALIFIER); } @@ -584,7 +582,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field94G(f)); } @@ -600,6 +598,7 @@ public static List getAll(final SwiftTagListBlock block) { * @return line content or null if not present or if line number is above the expected * @since 7.7 */ + @Override public String getLine(int line) { return getLine(line, 0); } @@ -613,6 +612,7 @@ public String getLine(int line) { * @return line content or null if not present or if line number is above the expected * @since 7.7 */ + @Override public String getLine(int line, int offset) { Field94G cp = newInstance(this); return getLine(cp, line, null, offset); @@ -625,6 +625,7 @@ public String getLine(int line, int offset) { * @return lines content or empty list if field's value is empty * @since 7.7 */ + @Override public List getLines() { return SwiftParseUtils.getLines(getValue()); } @@ -637,6 +638,7 @@ public List getLines() { * @return found lines or empty list if lines are not present or the offset is invalid * @since 7.7 */ + @Override public List getLines(int offset) { Field94G cp = newInstance(this); return SwiftParseUtils.getLines(getLine(cp, null, null, offset)); @@ -651,6 +653,7 @@ public List getLines(int offset) { * @return found lines or empty list if value is empty * @since 7.7 */ + @Override public List getLinesBetween(int start, int end) { return getLinesBetween(start, end, 0); } @@ -665,6 +668,7 @@ public List getLinesBetween(int start, int end) { * @return found lines or empty list if lines are not present or the offset is invalid * @since 7.7 */ + @Override public List getLinesBetween(int start, int end, int offset) { Field94G cp = newInstance(this); return SwiftParseUtils.getLines(getLine(cp, start, end, offset)); diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field94H.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field94H.java index 673fa9191..eef11265e 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field94H.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field94H.java @@ -33,12 +33,9 @@ import com.prowidesoftware.swift.model.field.BICContainer; import com.prowidesoftware.swift.model.field.BICResolver; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -205,16 +202,14 @@ public String getValueDisplay(int component, Locale locale) { //default format (as is) return getComponent(1); } - if (component == 2) { - //default format (as is) - return getComponent(2); - } - return null; + // This is the last component, return directly without `if` + //default format (as is) + return getComponent(2); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -436,10 +431,12 @@ public Field94H setIdentifierCode(com.prowidesoftware.swift.model.BIC component2 } + @Override public List bics() { return BICResolver.bics(this); } + @Override public List bicStrings () { return BICResolver.bicStrings(this); } @@ -451,6 +448,7 @@ public List bicStrings () { * * @return DSS component value or null if the DSS is not set or not available for this field. */ + @Override public String getDSS() { return null; } @@ -461,6 +459,7 @@ public String getDSS() { * @see #getDSS() * @return true if DSS is present, false otherwise. */ + @Override public boolean isDSSPresent() { return false; } @@ -475,6 +474,7 @@ public boolean isDSSPresent() { * * @return for generic fields returns the value of the conditional qualifier or null if not set or not applicable for this field. */ + @Override public String getConditionalQualifier() { return getComponent(CONDITIONAL_QUALIFIER); } @@ -542,7 +542,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field94H(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field94L.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field94L.java index 6720a978c..0a1180380 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field94L.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field94L.java @@ -32,12 +32,9 @@ import com.prowidesoftware.swift.model.field.GenericField; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -220,16 +217,14 @@ public String getValueDisplay(int component, Locale locale) { //default format (as is) return getComponent(2); } - if (component == 3) { - //default format (as is) - return getComponent(3); - } - return null; + // This is the last component, return directly without `if` + //default format (as is) + return getComponent(3); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -456,32 +451,14 @@ public Field94L setComponent3(String component3) { return this; } - /** - * Set the component3 from a Long object. - *
- * If the component being set is a fixed length number, the argument will not be - * padded. It is recommended for these cases to use the setComponent3(String) - * method. - * - * @see #setComponent3(String) - * @since 9.2.7 - * - * @param component3 the Long with the Legal Entity Identifier Number content to set - * @return the field object to enable build pattern - */ - public Field94L setComponent3(java.lang.Long component3) { - setComponent(3, SwiftFormatUtils.getLong(component3)); - return this; - } /** * Alternative method setter for field's Legal Entity Identifier Number (component 3) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10 becomes an Integer) * * @param component3 the Number with the Legal Entity Identifier Number content to set * @return the field object to enable build pattern - * @see #setLegalEntityIdentifierNumber(java.lang.Long) */ public Field94L setComponent3(java.lang.Number component3) { @@ -511,27 +488,13 @@ public Field94L setLegalEntityIdentifierNumber(String component3) { return setComponent3(component3); } - /** - * Set the Legal Entity Identifier Number (component 3) from a Long object. - * - * @see #setComponent3(java.lang.Long) - * - * @param component3 Long with the Legal Entity Identifier Number content to set - * @return the field object to enable build pattern - * @since 9.2.7 - */ - public Field94L setLegalEntityIdentifierNumber(java.lang.Long component3) { - return setComponent3(component3); - } - /** * Alternative method setter for field's Legal Entity Identifier Number (component 3) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10 becomes an Integer) * * @param component3 the Number with the Legal Entity Identifier Number content to set * @return the field object to enable build pattern - * @see #setLegalEntityIdentifierNumber(java.lang.Long) */ public Field94L setLegalEntityIdentifierNumber(java.lang.Number component3) { return setComponent3(component3); @@ -545,6 +508,7 @@ public Field94L setLegalEntityIdentifierNumber(java.lang.Number component3) { * * @return DSS component value or null if the DSS is not set or not available for this field. */ + @Override public String getDSS() { return null; } @@ -555,6 +519,7 @@ public String getDSS() { * @see #getDSS() * @return true if DSS is present, false otherwise. */ + @Override public boolean isDSSPresent() { return false; } @@ -569,6 +534,7 @@ public boolean isDSSPresent() { * * @return for generic fields returns the value of the conditional qualifier or null if not set or not applicable for this field. */ + @Override public String getConditionalQualifier() { return getComponent(CONDITIONAL_QUALIFIER); } @@ -636,7 +602,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field94L(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field95C.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field95C.java index 5d226b4d3..4e7a3587a 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field95C.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field95C.java @@ -30,12 +30,9 @@ import com.prowidesoftware.swift.model.field.GenericField; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -201,16 +198,14 @@ public String getValueDisplay(int component, Locale locale) { //default format (as is) return getComponent(1); } - if (component == 2) { - //default format (as is) - return getComponent(2); - } - return null; + // This is the last component, return directly without `if` + //default format (as is) + return getComponent(2); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -396,6 +391,7 @@ public Field95C setCountryCode(String component2) { * * @return DSS component value or null if the DSS is not set or not available for this field. */ + @Override public String getDSS() { return null; } @@ -406,6 +402,7 @@ public String getDSS() { * @see #getDSS() * @return true if DSS is present, false otherwise. */ + @Override public boolean isDSSPresent() { return false; } @@ -420,6 +417,7 @@ public boolean isDSSPresent() { * * @return for generic fields returns the value of the conditional qualifier or null if not set or not applicable for this field. */ + @Override public String getConditionalQualifier() { return getComponent(CONDITIONAL_QUALIFIER); } @@ -487,7 +485,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field95C(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field95L.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field95L.java index 9e6dadfcf..70a5103fe 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field95L.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field95L.java @@ -32,12 +32,9 @@ import com.prowidesoftware.swift.model.field.GenericField; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -220,16 +217,14 @@ public String getValueDisplay(int component, Locale locale) { //default format (as is) return getComponent(2); } - if (component == 3) { - //default format (as is) - return getComponent(3); - } - return null; + // This is the last component, return directly without `if` + //default format (as is) + return getComponent(3); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -456,32 +451,14 @@ public Field95L setComponent3(String component3) { return this; } - /** - * Set the component3 from a Long object. - *
- * If the component being set is a fixed length number, the argument will not be - * padded. It is recommended for these cases to use the setComponent3(String) - * method. - * - * @see #setComponent3(String) - * @since 9.2.7 - * - * @param component3 the Long with the Legal Entity Identifier Number content to set - * @return the field object to enable build pattern - */ - public Field95L setComponent3(java.lang.Long component3) { - setComponent(3, SwiftFormatUtils.getLong(component3)); - return this; - } /** * Alternative method setter for field's Legal Entity Identifier Number (component 3) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10 becomes an Integer) * * @param component3 the Number with the Legal Entity Identifier Number content to set * @return the field object to enable build pattern - * @see #setLegalEntityIdentifierNumber(java.lang.Long) */ public Field95L setComponent3(java.lang.Number component3) { @@ -511,27 +488,13 @@ public Field95L setLegalEntityIdentifierNumber(String component3) { return setComponent3(component3); } - /** - * Set the Legal Entity Identifier Number (component 3) from a Long object. - * - * @see #setComponent3(java.lang.Long) - * - * @param component3 Long with the Legal Entity Identifier Number content to set - * @return the field object to enable build pattern - * @since 9.2.7 - */ - public Field95L setLegalEntityIdentifierNumber(java.lang.Long component3) { - return setComponent3(component3); - } - /** * Alternative method setter for field's Legal Entity Identifier Number (component 3) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10 becomes an Integer) * * @param component3 the Number with the Legal Entity Identifier Number content to set * @return the field object to enable build pattern - * @see #setLegalEntityIdentifierNumber(java.lang.Long) */ public Field95L setLegalEntityIdentifierNumber(java.lang.Number component3) { return setComponent3(component3); @@ -545,6 +508,7 @@ public Field95L setLegalEntityIdentifierNumber(java.lang.Number component3) { * * @return DSS component value or null if the DSS is not set or not available for this field. */ + @Override public String getDSS() { return null; } @@ -555,6 +519,7 @@ public String getDSS() { * @see #getDSS() * @return true if DSS is present, false otherwise. */ + @Override public boolean isDSSPresent() { return false; } @@ -569,6 +534,7 @@ public boolean isDSSPresent() { * * @return for generic fields returns the value of the conditional qualifier or null if not set or not applicable for this field. */ + @Override public String getConditionalQualifier() { return getComponent(CONDITIONAL_QUALIFIER); } @@ -636,7 +602,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field95L(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field95P.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field95P.java index b209908e0..1b3ef8b8d 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field95P.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field95P.java @@ -33,12 +33,9 @@ import com.prowidesoftware.swift.model.field.BICContainer; import com.prowidesoftware.swift.model.field.BICResolver; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -220,10 +217,12 @@ public Field95P setIdentifierCode(com.prowidesoftware.swift.model.BIC component2 } + @Override public List bics() { return BICResolver.bics(this); } + @Override public List bicStrings () { return BICResolver.bicStrings(this); } @@ -235,6 +234,7 @@ public List bicStrings () { * * @return DSS component value or null if the DSS is not set or not available for this field. */ + @Override public String getDSS() { return null; } @@ -245,6 +245,7 @@ public String getDSS() { * @see #getDSS() * @return true if DSS is present, false otherwise. */ + @Override public boolean isDSSPresent() { return false; } @@ -259,6 +260,7 @@ public boolean isDSSPresent() { * * @return for generic fields returns the value of the conditional qualifier or null if not set or not applicable for this field. */ + @Override public String getConditionalQualifier() { return getComponent(CONDITIONAL_QUALIFIER); } @@ -326,7 +328,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field95P(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field95Q.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field95Q.java index f7ce308d1..35e2a5e10 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field95Q.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field95Q.java @@ -31,12 +31,9 @@ import com.prowidesoftware.swift.model.field.GenericField; import com.prowidesoftware.swift.model.field.MultiLineField; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -280,6 +277,7 @@ public Field95Q setNameAndAddressLine4(String component5) { * * @return DSS component value or null if the DSS is not set or not available for this field. */ + @Override public String getDSS() { return null; } @@ -290,6 +288,7 @@ public String getDSS() { * @see #getDSS() * @return true if DSS is present, false otherwise. */ + @Override public boolean isDSSPresent() { return false; } @@ -304,6 +303,7 @@ public boolean isDSSPresent() { * * @return for generic fields returns the value of the conditional qualifier or null if not set or not applicable for this field. */ + @Override public String getConditionalQualifier() { return getComponent(CONDITIONAL_QUALIFIER); } @@ -371,7 +371,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field95Q(f)); } @@ -387,6 +387,7 @@ public static List getAll(final SwiftTagListBlock block) { * @return line content or null if not present or if line number is above the expected * @since 7.7 */ + @Override public String getLine(int line) { return getLine(line, 0); } @@ -400,6 +401,7 @@ public String getLine(int line) { * @return line content or null if not present or if line number is above the expected * @since 7.7 */ + @Override public String getLine(int line, int offset) { Field95Q cp = newInstance(this); return getLine(cp, line, null, offset); @@ -412,6 +414,7 @@ public String getLine(int line, int offset) { * @return lines content or empty list if field's value is empty * @since 7.7 */ + @Override public List getLines() { return SwiftParseUtils.getLines(getValue()); } @@ -424,6 +427,7 @@ public List getLines() { * @return found lines or empty list if lines are not present or the offset is invalid * @since 7.7 */ + @Override public List getLines(int offset) { Field95Q cp = newInstance(this); return SwiftParseUtils.getLines(getLine(cp, null, null, offset)); @@ -438,6 +442,7 @@ public List getLines(int offset) { * @return found lines or empty list if value is empty * @since 7.7 */ + @Override public List getLinesBetween(int start, int end) { return getLinesBetween(start, end, 0); } @@ -452,6 +457,7 @@ public List getLinesBetween(int start, int end) { * @return found lines or empty list if lines are not present or the offset is invalid * @since 7.7 */ + @Override public List getLinesBetween(int start, int end, int offset) { Field95Q cp = newInstance(this); return SwiftParseUtils.getLines(getLine(cp, start, end, offset)); diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field95R.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field95R.java index f88da14ce..4c0a45abc 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field95R.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field95R.java @@ -30,12 +30,9 @@ import com.prowidesoftware.swift.model.field.GenericField; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -223,6 +220,7 @@ public Field95R setProprietaryCode(String component3) { * * @return DSS component value or null if the DSS is not set or not available for this field. */ + @Override public String getDSS() { return getComponent2(); } @@ -233,6 +231,7 @@ public String getDSS() { * @see #getDSS() * @return true if DSS is present, false otherwise. */ + @Override public boolean isDSSPresent() { return getComponent2() != null; } @@ -247,6 +246,7 @@ public boolean isDSSPresent() { * * @return for generic fields returns the value of the conditional qualifier or null if not set or not applicable for this field. */ + @Override public String getConditionalQualifier() { return getComponent(CONDITIONAL_QUALIFIER); } @@ -314,7 +314,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field95R(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field95S.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field95S.java index 09a787328..c672bf9de 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field95S.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field95S.java @@ -30,12 +30,9 @@ import com.prowidesoftware.swift.model.field.GenericField; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -267,6 +264,7 @@ public Field95S setAlternateID(String component5) { * * @return DSS component value or null if the DSS is not set or not available for this field. */ + @Override public String getDSS() { return getComponent2(); } @@ -277,6 +275,7 @@ public String getDSS() { * @see #getDSS() * @return true if DSS is present, false otherwise. */ + @Override public boolean isDSSPresent() { return getComponent2() != null; } @@ -291,6 +290,7 @@ public boolean isDSSPresent() { * * @return for generic fields returns the value of the conditional qualifier or null if not set or not applicable for this field. */ + @Override public String getConditionalQualifier() { return getComponent(CONDITIONAL_QUALIFIER); } @@ -358,7 +358,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field95S(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field95U.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field95U.java index 8fb9b8a59..5cd62b8cb 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field95U.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field95U.java @@ -31,12 +31,9 @@ import com.prowidesoftware.swift.model.field.GenericField; import com.prowidesoftware.swift.model.field.MultiLineField; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -258,6 +255,7 @@ public Field95U setPartyNameLine3(String component4) { * * @return DSS component value or null if the DSS is not set or not available for this field. */ + @Override public String getDSS() { return null; } @@ -268,6 +266,7 @@ public String getDSS() { * @see #getDSS() * @return true if DSS is present, false otherwise. */ + @Override public boolean isDSSPresent() { return false; } @@ -282,6 +281,7 @@ public boolean isDSSPresent() { * * @return for generic fields returns the value of the conditional qualifier or null if not set or not applicable for this field. */ + @Override public String getConditionalQualifier() { return getComponent(CONDITIONAL_QUALIFIER); } @@ -349,7 +349,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field95U(f)); } @@ -365,6 +365,7 @@ public static List getAll(final SwiftTagListBlock block) { * @return line content or null if not present or if line number is above the expected * @since 7.7 */ + @Override public String getLine(int line) { return getLine(line, 0); } @@ -378,6 +379,7 @@ public String getLine(int line) { * @return line content or null if not present or if line number is above the expected * @since 7.7 */ + @Override public String getLine(int line, int offset) { Field95U cp = newInstance(this); return getLine(cp, line, null, offset); @@ -390,6 +392,7 @@ public String getLine(int line, int offset) { * @return lines content or empty list if field's value is empty * @since 7.7 */ + @Override public List getLines() { return SwiftParseUtils.getLines(getValue()); } @@ -402,6 +405,7 @@ public List getLines() { * @return found lines or empty list if lines are not present or the offset is invalid * @since 7.7 */ + @Override public List getLines(int offset) { Field95U cp = newInstance(this); return SwiftParseUtils.getLines(getLine(cp, null, null, offset)); @@ -416,6 +420,7 @@ public List getLines(int offset) { * @return found lines or empty list if value is empty * @since 7.7 */ + @Override public List getLinesBetween(int start, int end) { return getLinesBetween(start, end, 0); } @@ -430,6 +435,7 @@ public List getLinesBetween(int start, int end) { * @return found lines or empty list if lines are not present or the offset is invalid * @since 7.7 */ + @Override public List getLinesBetween(int start, int end, int offset) { Field95U cp = newInstance(this); return SwiftParseUtils.getLines(getLine(cp, start, end, offset)); diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field95V.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field95V.java index 2a2b6f6eb..475ff029f 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field95V.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field95V.java @@ -31,12 +31,9 @@ import com.prowidesoftware.swift.model.field.GenericField; import com.prowidesoftware.swift.model.field.MultiLineField; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -252,16 +249,14 @@ public String getValueDisplay(int component, Locale locale) { //default format (as is) return getComponent(10); } - if (component == 11) { - //default format (as is) - return getComponent(11); - } - return null; + // This is the last component, return directly without `if` + //default format (as is) + return getComponent(11); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -874,6 +869,7 @@ public Field95V setNameAndAddressLine10(String component11) { * * @return DSS component value or null if the DSS is not set or not available for this field. */ + @Override public String getDSS() { return null; } @@ -884,6 +880,7 @@ public String getDSS() { * @see #getDSS() * @return true if DSS is present, false otherwise. */ + @Override public boolean isDSSPresent() { return false; } @@ -898,6 +895,7 @@ public boolean isDSSPresent() { * * @return for generic fields returns the value of the conditional qualifier or null if not set or not applicable for this field. */ + @Override public String getConditionalQualifier() { return getComponent(CONDITIONAL_QUALIFIER); } @@ -965,7 +963,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field95V(f)); } @@ -981,6 +979,7 @@ public static List getAll(final SwiftTagListBlock block) { * @return line content or null if not present or if line number is above the expected * @since 7.7 */ + @Override public String getLine(int line) { return getLine(line, 0); } @@ -994,6 +993,7 @@ public String getLine(int line) { * @return line content or null if not present or if line number is above the expected * @since 7.7 */ + @Override public String getLine(int line, int offset) { Field95V cp = newInstance(this); return getLine(cp, line, null, offset); @@ -1006,6 +1006,7 @@ public String getLine(int line, int offset) { * @return lines content or empty list if field's value is empty * @since 7.7 */ + @Override public List getLines() { return SwiftParseUtils.getLines(getValue()); } @@ -1018,6 +1019,7 @@ public List getLines() { * @return found lines or empty list if lines are not present or the offset is invalid * @since 7.7 */ + @Override public List getLines(int offset) { Field95V cp = newInstance(this); return SwiftParseUtils.getLines(getLine(cp, null, null, offset)); @@ -1032,6 +1034,7 @@ public List getLines(int offset) { * @return found lines or empty list if value is empty * @since 7.7 */ + @Override public List getLinesBetween(int start, int end) { return getLinesBetween(start, end, 0); } @@ -1046,6 +1049,7 @@ public List getLinesBetween(int start, int end) { * @return found lines or empty list if lines are not present or the offset is invalid * @since 7.7 */ + @Override public List getLinesBetween(int start, int end, int offset) { Field95V cp = newInstance(this); return SwiftParseUtils.getLines(getLine(cp, start, end, offset)); diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field96A.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field96A.java index ebe3d4ce1..22ff72bed 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field96A.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field96A.java @@ -33,12 +33,9 @@ import com.prowidesoftware.swift.model.field.BICContainer; import com.prowidesoftware.swift.model.field.BICResolver; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -242,10 +239,12 @@ public Field96A setIdentifierCode(com.prowidesoftware.swift.model.BIC component3 } + @Override public List bics() { return BICResolver.bics(this); } + @Override public List bicStrings () { return BICResolver.bicStrings(this); } @@ -314,7 +313,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field96A(f)); } @@ -330,6 +329,7 @@ public static List getAll(final SwiftTagListBlock block) { * @return line content or null if not present or if line number is above the expected * @since 7.7 */ + @Override public String getLine(int line) { return getLine(line, 0); } @@ -343,6 +343,7 @@ public String getLine(int line) { * @return line content or null if not present or if line number is above the expected * @since 7.7 */ + @Override public String getLine(int line, int offset) { Field96A cp = newInstance(this); return getLine(cp, line, null, offset); @@ -355,6 +356,7 @@ public String getLine(int line, int offset) { * @return lines content or empty list if field's value is empty * @since 7.7 */ + @Override public List getLines() { return SwiftParseUtils.getLines(getValue()); } @@ -367,6 +369,7 @@ public List getLines() { * @return found lines or empty list if lines are not present or the offset is invalid * @since 7.7 */ + @Override public List getLines(int offset) { Field96A cp = newInstance(this); return SwiftParseUtils.getLines(getLine(cp, null, null, offset)); @@ -381,6 +384,7 @@ public List getLines(int offset) { * @return found lines or empty list if value is empty * @since 7.7 */ + @Override public List getLinesBetween(int start, int end) { return getLinesBetween(start, end, 0); } @@ -395,6 +399,7 @@ public List getLinesBetween(int start, int end) { * @return found lines or empty list if lines are not present or the offset is invalid * @since 7.7 */ + @Override public List getLinesBetween(int start, int end, int offset) { Field96A cp = newInstance(this); return SwiftParseUtils.getLines(getLine(cp, start, end, offset)); diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field96D.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field96D.java index 37db562f2..afa3f1fba 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field96D.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field96D.java @@ -30,12 +30,9 @@ import com.prowidesoftware.swift.model.field.MultiLineField; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -358,7 +355,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field96D(f)); } @@ -374,6 +371,7 @@ public static List getAll(final SwiftTagListBlock block) { * @return line content or null if not present or if line number is above the expected * @since 7.7 */ + @Override public String getLine(int line) { return getLine(line, 0); } @@ -387,6 +385,7 @@ public String getLine(int line) { * @return line content or null if not present or if line number is above the expected * @since 7.7 */ + @Override public String getLine(int line, int offset) { Field96D cp = newInstance(this); return getLine(cp, line, null, offset); @@ -399,6 +398,7 @@ public String getLine(int line, int offset) { * @return lines content or empty list if field's value is empty * @since 7.7 */ + @Override public List getLines() { return SwiftParseUtils.getLines(getValue()); } @@ -411,6 +411,7 @@ public List getLines() { * @return found lines or empty list if lines are not present or the offset is invalid * @since 7.7 */ + @Override public List getLines(int offset) { Field96D cp = newInstance(this); return SwiftParseUtils.getLines(getLine(cp, null, null, offset)); @@ -425,6 +426,7 @@ public List getLines(int offset) { * @return found lines or empty list if value is empty * @since 7.7 */ + @Override public List getLinesBetween(int start, int end) { return getLinesBetween(start, end, 0); } @@ -439,6 +441,7 @@ public List getLinesBetween(int start, int end) { * @return found lines or empty list if lines are not present or the offset is invalid * @since 7.7 */ + @Override public List getLinesBetween(int start, int end, int offset) { Field96D cp = newInstance(this); return SwiftParseUtils.getLines(getLine(cp, start, end, offset)); diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field96J.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field96J.java index 1880e28d0..1872d0d84 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field96J.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field96J.java @@ -29,12 +29,9 @@ -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -235,7 +232,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field96J(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field97A.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field97A.java index 5dd7b2484..df8445807 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field97A.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field97A.java @@ -30,12 +30,9 @@ import com.prowidesoftware.swift.model.field.GenericField; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -202,16 +199,14 @@ public String getValueDisplay(int component, Locale locale) { //default format (as is) return getComponent(1); } - if (component == 2) { - //default format (as is) - return getComponent(2); - } - return null; + // This is the last component, return directly without `if` + //default format (as is) + return getComponent(2); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -409,6 +404,7 @@ public Field97A setAccountNumber(String component2) { * * @return DSS component value or null if the DSS is not set or not available for this field. */ + @Override public String getDSS() { return null; } @@ -419,6 +415,7 @@ public String getDSS() { * @see #getDSS() * @return true if DSS is present, false otherwise. */ + @Override public boolean isDSSPresent() { return false; } @@ -433,6 +430,7 @@ public boolean isDSSPresent() { * * @return for generic fields returns the value of the conditional qualifier or null if not set or not applicable for this field. */ + @Override public String getConditionalQualifier() { return getComponent(CONDITIONAL_QUALIFIER); } @@ -500,7 +498,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field97A(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field97B.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field97B.java index f751d906a..0a1002b30 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field97B.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field97B.java @@ -30,12 +30,9 @@ import com.prowidesoftware.swift.model.field.GenericField; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -229,16 +226,14 @@ public String getValueDisplay(int component, Locale locale) { //default format (as is) return getComponent(3); } - if (component == 4) { - //default format (as is) - return getComponent(4); - } - return null; + // This is the last component, return directly without `if` + //default format (as is) + return getComponent(4); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -507,6 +502,7 @@ public Field97B setAccountNumber(String component4) { * * @return DSS component value or null if the DSS is not set or not available for this field. */ + @Override public String getDSS() { return getComponent2(); } @@ -517,6 +513,7 @@ public String getDSS() { * @see #getDSS() * @return true if DSS is present, false otherwise. */ + @Override public boolean isDSSPresent() { return getComponent2() != null; } @@ -531,6 +528,7 @@ public boolean isDSSPresent() { * * @return for generic fields returns the value of the conditional qualifier or null if not set or not applicable for this field. */ + @Override public String getConditionalQualifier() { return getComponent(CONDITIONAL_QUALIFIER); } @@ -598,7 +596,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field97B(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field97C.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field97C.java index b3f561590..827ad18a6 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field97C.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field97C.java @@ -30,12 +30,9 @@ import com.prowidesoftware.swift.model.field.GenericField; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -202,16 +199,14 @@ public String getValueDisplay(int component, Locale locale) { //default format (as is) return getComponent(1); } - if (component == 2) { - //default format (as is) - return getComponent(2); - } - return null; + // This is the last component, return directly without `if` + //default format (as is) + return getComponent(2); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -400,6 +395,7 @@ public Field97C setAccountCode(String component2) { * * @return DSS component value or null if the DSS is not set or not available for this field. */ + @Override public String getDSS() { return null; } @@ -410,6 +406,7 @@ public String getDSS() { * @see #getDSS() * @return true if DSS is present, false otherwise. */ + @Override public boolean isDSSPresent() { return false; } @@ -424,6 +421,7 @@ public boolean isDSSPresent() { * * @return for generic fields returns the value of the conditional qualifier or null if not set or not applicable for this field. */ + @Override public String getConditionalQualifier() { return getComponent(CONDITIONAL_QUALIFIER); } @@ -491,7 +489,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field97C(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field97D.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field97D.java index 22ed32b1b..1fdc81793 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field97D.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field97D.java @@ -30,12 +30,9 @@ import com.prowidesoftware.swift.model.field.GenericField; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -214,16 +211,14 @@ public String getValueDisplay(int component, Locale locale) { //default format (as is) return getComponent(2); } - if (component == 3) { - //default format (as is) - return getComponent(3); - } - return null; + // This is the last component, return directly without `if` + //default format (as is) + return getComponent(3); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -452,6 +447,7 @@ public Field97D setIdentificationOfBlockchainOrWallet(String component3) { * * @return DSS component value or null if the DSS is not set or not available for this field. */ + @Override public String getDSS() { return getComponent2(); } @@ -462,6 +458,7 @@ public String getDSS() { * @see #getDSS() * @return true if DSS is present, false otherwise. */ + @Override public boolean isDSSPresent() { return getComponent2() != null; } @@ -476,6 +473,7 @@ public boolean isDSSPresent() { * * @return for generic fields returns the value of the conditional qualifier or null if not set or not applicable for this field. */ + @Override public String getConditionalQualifier() { return getComponent(CONDITIONAL_QUALIFIER); } @@ -543,7 +541,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field97D(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field97E.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field97E.java index ac3b41ea1..3facab3b7 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field97E.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field97E.java @@ -30,12 +30,9 @@ import com.prowidesoftware.swift.model.field.GenericField; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -202,16 +199,14 @@ public String getValueDisplay(int component, Locale locale) { //default format (as is) return getComponent(1); } - if (component == 2) { - //default format (as is) - return getComponent(2); - } - return null; + // This is the last component, return directly without `if` + //default format (as is) + return getComponent(2); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -409,6 +404,7 @@ public Field97E setInternationalBankAccountNumber(String component2) { * * @return DSS component value or null if the DSS is not set or not available for this field. */ + @Override public String getDSS() { return null; } @@ -419,6 +415,7 @@ public String getDSS() { * @see #getDSS() * @return true if DSS is present, false otherwise. */ + @Override public boolean isDSSPresent() { return false; } @@ -433,6 +430,7 @@ public boolean isDSSPresent() { * * @return for generic fields returns the value of the conditional qualifier or null if not set or not applicable for this field. */ + @Override public String getConditionalQualifier() { return getComponent(CONDITIONAL_QUALIFIER); } @@ -500,7 +498,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field97E(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field98A.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field98A.java index b13574c51..c3edc4da5 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field98A.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field98A.java @@ -33,12 +33,9 @@ import com.prowidesoftware.swift.model.field.DateContainer; import com.prowidesoftware.swift.model.field.DateResolver; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -204,20 +201,19 @@ public String getValueDisplay(int component, Locale locale) { //default format (as is) return getComponent(1); } - if (component == 2) { - //date: [YY]YYMMDD - java.text.DateFormat f = java.text.DateFormat.getDateInstance(java.text.DateFormat.DEFAULT, notNull(locale)); - java.util.Calendar cal = getComponent2AsCalendar(); - if (cal != null) { - return f.format(cal.getTime()); - } + // This is the last component, return directly without `if` + //date: [YY]YYMMDD + java.text.DateFormat f = java.text.DateFormat.getDateInstance(java.text.DateFormat.DEFAULT, notNull(locale)); + java.util.Calendar cal = getComponent2AsCalendar(); + if (cal != null) { + return f.format(cal.getTime()); } return null; } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -441,6 +437,7 @@ public Field98A setDate(java.util.Calendar component2) { * * @return the list of converted components (a Calendar object or null) */ + @Override public List dates() { return DateResolver.dates(this); } @@ -461,6 +458,7 @@ public Calendar date() { * * @return DSS component value or null if the DSS is not set or not available for this field. */ + @Override public String getDSS() { return null; } @@ -471,6 +469,7 @@ public String getDSS() { * @see #getDSS() * @return true if DSS is present, false otherwise. */ + @Override public boolean isDSSPresent() { return false; } @@ -485,6 +484,7 @@ public boolean isDSSPresent() { * * @return for generic fields returns the value of the conditional qualifier or null if not set or not applicable for this field. */ + @Override public String getConditionalQualifier() { return getComponent(CONDITIONAL_QUALIFIER); } @@ -552,7 +552,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field98A(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field98B.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field98B.java index 862d18380..db12e8fea 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field98B.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field98B.java @@ -30,12 +30,9 @@ import com.prowidesoftware.swift.model.field.GenericField; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -215,16 +212,14 @@ public String getValueDisplay(int component, Locale locale) { //default format (as is) return getComponent(2); } - if (component == 3) { - //default format (as is) - return getComponent(3); - } - return null; + // This is the last component, return directly without `if` + //default format (as is) + return getComponent(3); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -456,6 +451,7 @@ public Field98B setDateCode(String component3) { * * @return DSS component value or null if the DSS is not set or not available for this field. */ + @Override public String getDSS() { return getComponent2(); } @@ -466,6 +462,7 @@ public String getDSS() { * @see #getDSS() * @return true if DSS is present, false otherwise. */ + @Override public boolean isDSSPresent() { return getComponent2() != null; } @@ -480,6 +477,7 @@ public boolean isDSSPresent() { * * @return for generic fields returns the value of the conditional qualifier or null if not set or not applicable for this field. */ + @Override public String getConditionalQualifier() { return getComponent(CONDITIONAL_QUALIFIER); } @@ -547,7 +545,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field98B(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field98C.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field98C.java index 2fbc9780e..d37d467bb 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field98C.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field98C.java @@ -33,12 +33,9 @@ import com.prowidesoftware.swift.model.field.DateContainer; import com.prowidesoftware.swift.model.field.DateResolver; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -223,20 +220,19 @@ public String getValueDisplay(int component, Locale locale) { return f.format(cal.getTime()); } } - if (component == 3) { - //time with seconds: HHmmss - java.text.DateFormat f = new java.text.SimpleDateFormat("HH:mm:ss", notNull(locale)); - java.util.Calendar cal = getComponent3AsCalendar(); - if (cal != null) { - return f.format(cal.getTime()); - } + // This is the last component, return directly without `if` + //time with seconds: HHmmss + java.text.DateFormat f = new java.text.SimpleDateFormat("HH:mm:ss", notNull(locale)); + java.util.Calendar cal = getComponent3AsCalendar(); + if (cal != null) { + return f.format(cal.getTime()); } return null; } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -540,6 +536,7 @@ public Field98C setTime(java.util.Calendar component3) { * * @return the list of converted components (a Calendar object or null) */ + @Override public List dates() { return DateResolver.dates(this); } @@ -560,6 +557,7 @@ public Calendar date() { * * @return DSS component value or null if the DSS is not set or not available for this field. */ + @Override public String getDSS() { return null; } @@ -570,6 +568,7 @@ public String getDSS() { * @see #getDSS() * @return true if DSS is present, false otherwise. */ + @Override public boolean isDSSPresent() { return false; } @@ -584,6 +583,7 @@ public boolean isDSSPresent() { * * @return for generic fields returns the value of the conditional qualifier or null if not set or not applicable for this field. */ + @Override public String getConditionalQualifier() { return getComponent(CONDITIONAL_QUALIFIER); } @@ -651,7 +651,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field98C(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field98D.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field98D.java index ab3dc9b7b..b79019ee7 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field98D.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field98D.java @@ -34,12 +34,9 @@ import com.prowidesoftware.swift.model.field.DateContainer; import com.prowidesoftware.swift.model.field.DateResolver; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -275,20 +272,19 @@ public String getValueDisplay(int component, Locale locale) { //default format (as is) return getComponent(4); } - if (component == 5) { - //time: HH[mm] - java.text.DateFormat f = new java.text.SimpleDateFormat("HH:mm", notNull(locale)); - java.util.Calendar cal = getComponent5AsCalendar(); - if (cal != null) { - return f.format(cal.getTime()); - } + // This is the last component, return directly without `if` + //time: HH[mm] + java.text.DateFormat f = new java.text.SimpleDateFormat("HH:mm", notNull(locale)); + java.util.Calendar cal = getComponent5AsCalendar(); + if (cal != null) { + return f.format(cal.getTime()); } return null; } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -659,32 +655,14 @@ public Field98D setComponent3(String component3) { return this; } - /** - * Set the component3 from a Long object. - *
- * If the component being set is a fixed length number, the argument will not be - * padded. It is recommended for these cases to use the setComponent3(String) - * method. - * - * @see #setComponent3(String) - * @since 9.2.7 - * - * @param component3 the Long with the Decimals content to set - * @return the field object to enable build pattern - */ - public Field98D setComponent3(java.lang.Long component3) { - setComponent(3, SwiftFormatUtils.getLong(component3)); - return this; - } /** * Alternative method setter for field's Decimals (component 3) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10 becomes an Integer) * * @param component3 the Number with the Decimals content to set * @return the field object to enable build pattern - * @see #setDecimals(java.lang.Long) */ public Field98D setComponent3(java.lang.Number component3) { @@ -714,27 +692,13 @@ public Field98D setDecimals(String component3) { return setComponent3(component3); } - /** - * Set the Decimals (component 3) from a Long object. - * - * @see #setComponent3(java.lang.Long) - * - * @param component3 Long with the Decimals content to set - * @return the field object to enable build pattern - * @since 9.2.7 - */ - public Field98D setDecimals(java.lang.Long component3) { - return setComponent3(component3); - } - /** * Alternative method setter for field's Decimals (component 3) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10 becomes an Integer) * * @param component3 the Number with the Decimals content to set * @return the field object to enable build pattern - * @see #setDecimals(java.lang.Long) */ public Field98D setDecimals(java.lang.Number component3) { return setComponent3(component3); @@ -811,6 +775,7 @@ public Field98D setOffset(java.util.Calendar component5) { * * @return the list of converted components (a Calendar object or null) */ + @Override public List dates() { return DateResolver.dates(this); } @@ -888,7 +853,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field98D(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field98E.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field98E.java index 2d295c0fa..6ea16a4a7 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field98E.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field98E.java @@ -35,12 +35,9 @@ import com.prowidesoftware.swift.model.field.DateContainer; import com.prowidesoftware.swift.model.field.DateResolver; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -291,20 +288,19 @@ public String getValueDisplay(int component, Locale locale) { //default format (as is) return getComponent(5); } - if (component == 6) { - //time: HH[mm] - java.text.DateFormat f = new java.text.SimpleDateFormat("HH:mm", notNull(locale)); - java.util.Calendar cal = getComponent6AsCalendar(); - if (cal != null) { - return f.format(cal.getTime()); - } + // This is the last component, return directly without `if` + //time: HH[mm] + java.text.DateFormat f = new java.text.SimpleDateFormat("HH:mm", notNull(locale)); + java.util.Calendar cal = getComponent6AsCalendar(); + if (cal != null) { + return f.format(cal.getTime()); } return null; } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -715,32 +711,14 @@ public Field98E setComponent4(String component4) { return this; } - /** - * Set the component4 from a Long object. - *
- * If the component being set is a fixed length number, the argument will not be - * padded. It is recommended for these cases to use the setComponent4(String) - * method. - * - * @see #setComponent4(String) - * @since 9.2.7 - * - * @param component4 the Long with the Decimals content to set - * @return the field object to enable build pattern - */ - public Field98E setComponent4(java.lang.Long component4) { - setComponent(4, SwiftFormatUtils.getLong(component4)); - return this; - } /** * Alternative method setter for field's Decimals (component 4) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10 becomes an Integer) * * @param component4 the Number with the Decimals content to set * @return the field object to enable build pattern - * @see #setDecimals(java.lang.Long) */ public Field98E setComponent4(java.lang.Number component4) { @@ -770,27 +748,13 @@ public Field98E setDecimals(String component4) { return setComponent4(component4); } - /** - * Set the Decimals (component 4) from a Long object. - * - * @see #setComponent4(java.lang.Long) - * - * @param component4 Long with the Decimals content to set - * @return the field object to enable build pattern - * @since 9.2.7 - */ - public Field98E setDecimals(java.lang.Long component4) { - return setComponent4(component4); - } - /** * Alternative method setter for field's Decimals (component 4) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10 becomes an Integer) * * @param component4 the Number with the Decimals content to set * @return the field object to enable build pattern - * @see #setDecimals(java.lang.Long) */ public Field98E setDecimals(java.lang.Number component4) { return setComponent4(component4); @@ -867,6 +831,7 @@ public Field98E setOffset(java.util.Calendar component6) { * * @return the list of converted components (a Calendar object or null) */ + @Override public List dates() { return DateResolver.dates(this); } @@ -887,6 +852,7 @@ public Calendar date() { * * @return DSS component value or null if the DSS is not set or not available for this field. */ + @Override public String getDSS() { return null; } @@ -897,6 +863,7 @@ public String getDSS() { * @see #getDSS() * @return true if DSS is present, false otherwise. */ + @Override public boolean isDSSPresent() { return false; } @@ -911,6 +878,7 @@ public boolean isDSSPresent() { * * @return for generic fields returns the value of the conditional qualifier or null if not set or not applicable for this field. */ + @Override public String getConditionalQualifier() { return getComponent(CONDITIONAL_QUALIFIER); } @@ -978,7 +946,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field98E(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field98F.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field98F.java index 84307a9e6..04d2ce2e5 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field98F.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field98F.java @@ -31,12 +31,9 @@ import com.prowidesoftware.swift.model.field.GenericField; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -236,20 +233,19 @@ public String getValueDisplay(int component, Locale locale) { //default format (as is) return getComponent(3); } - if (component == 4) { - //time with seconds: HHmmss - java.text.DateFormat f = new java.text.SimpleDateFormat("HH:mm:ss", notNull(locale)); - java.util.Calendar cal = getComponent4AsCalendar(); - if (cal != null) { - return f.format(cal.getTime()); - } + // This is the last component, return directly without `if` + //time with seconds: HHmmss + java.text.DateFormat f = new java.text.SimpleDateFormat("HH:mm:ss", notNull(locale)); + java.util.Calendar cal = getComponent4AsCalendar(); + if (cal != null) { + return f.format(cal.getTime()); } return null; } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -561,6 +557,7 @@ public Field98F setTime(java.util.Calendar component4) { * * @return DSS component value or null if the DSS is not set or not available for this field. */ + @Override public String getDSS() { return getComponent2(); } @@ -571,6 +568,7 @@ public String getDSS() { * @see #getDSS() * @return true if DSS is present, false otherwise. */ + @Override public boolean isDSSPresent() { return getComponent2() != null; } @@ -585,6 +583,7 @@ public boolean isDSSPresent() { * * @return for generic fields returns the value of the conditional qualifier or null if not set or not applicable for this field. */ + @Override public String getConditionalQualifier() { return getComponent(CONDITIONAL_QUALIFIER); } @@ -652,7 +651,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field98F(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field98J.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field98J.java index 9600642bf..12b6b789f 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field98J.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field98J.java @@ -36,12 +36,9 @@ import com.prowidesoftware.swift.model.field.DateContainer; import com.prowidesoftware.swift.model.field.DateResolver; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -249,16 +246,14 @@ public String getValueDisplay(int component, Locale locale) { return f.format(cal.getTime()); } } - if (component == 4) { - //default format (as is) - return getComponent(4); - } - return null; + // This is the last component, return directly without `if` + //default format (as is) + return getComponent(4); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -645,6 +640,7 @@ public Field98J setIdentifierCode(com.prowidesoftware.swift.model.BIC component4 * * @return the list of converted components (a Calendar object or null) */ + @Override public List dates() { return DateResolver.dates(this); } @@ -658,10 +654,12 @@ public Calendar date() { return DateResolver.date(this); } + @Override public List bics() { return BICResolver.bics(this); } + @Override public List bicStrings () { return BICResolver.bicStrings(this); } @@ -673,6 +671,7 @@ public List bicStrings () { * * @return DSS component value or null if the DSS is not set or not available for this field. */ + @Override public String getDSS() { return null; } @@ -683,6 +682,7 @@ public String getDSS() { * @see #getDSS() * @return true if DSS is present, false otherwise. */ + @Override public boolean isDSSPresent() { return false; } @@ -697,6 +697,7 @@ public boolean isDSSPresent() { * * @return for generic fields returns the value of the conditional qualifier or null if not set or not applicable for this field. */ + @Override public String getConditionalQualifier() { return getComponent(CONDITIONAL_QUALIFIER); } @@ -764,7 +765,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field98J(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field98K.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field98K.java index 6b689da91..a46c1e2bd 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field98K.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field98K.java @@ -33,12 +33,9 @@ import com.prowidesoftware.swift.model.field.DateContainer; import com.prowidesoftware.swift.model.field.DateResolver; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -258,16 +255,14 @@ public String getValueDisplay(int component, Locale locale) { return f.format(cal.getTime()); } } - if (component == 5) { - //default format (as is) - return getComponent(5); - } - return null; + // This is the last component, return directly without `if` + //default format (as is) + return getComponent(5); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -651,6 +646,7 @@ public Field98K setProprietaryCode(String component5) { * * @return the list of converted components (a Calendar object or null) */ + @Override public List dates() { return DateResolver.dates(this); } @@ -671,6 +667,7 @@ public Calendar date() { * * @return DSS component value or null if the DSS is not set or not available for this field. */ + @Override public String getDSS() { return null; } @@ -681,6 +678,7 @@ public String getDSS() { * @see #getDSS() * @return true if DSS is present, false otherwise. */ + @Override public boolean isDSSPresent() { return false; } @@ -695,6 +693,7 @@ public boolean isDSSPresent() { * * @return for generic fields returns the value of the conditional qualifier or null if not set or not applicable for this field. */ + @Override public String getConditionalQualifier() { return getComponent(CONDITIONAL_QUALIFIER); } @@ -762,7 +761,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field98K(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field999.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field999.java index 931a61958..a8b6579d0 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field999.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field999.java @@ -29,12 +29,9 @@ -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -178,19 +175,16 @@ public String getValue() { */ @Override public String getValueDisplay(int component, Locale locale) { - if (component < 1 || component > 1) { + if (component != 1) { throw new IllegalArgumentException("invalid component number " + component + " for field 999"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -373,7 +367,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field999(f)); } @@ -388,13 +382,11 @@ public static List getAll(final SwiftTagListBlock block) { * @since 7.10.3 * @see Field#fromJson(String) */ + @SuppressWarnings("unused") public static Field999 fromJson(final String json) { - final Field999 field = new Field999(); - - - return field; + return new Field999(); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field99B.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field99B.java index 31f2ae687..b93a1a5ed 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field99B.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field99B.java @@ -32,12 +32,9 @@ import com.prowidesoftware.swift.model.field.GenericField; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -203,16 +200,14 @@ public String getValueDisplay(int component, Locale locale) { //default format (as is) return getComponent(1); } - if (component == 2) { - //default format (as is) - return getComponent(2); - } - return null; + // This is the last component, return directly without `if` + //default format (as is) + return getComponent(2); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -399,32 +394,14 @@ public Field99B setComponent2(String component2) { return this; } - /** - * Set the component2 from a Long object. - *
- * If the component being set is a fixed length number, the argument will not be - * padded. It is recommended for these cases to use the setComponent2(String) - * method. - * - * @see #setComponent2(String) - * @since 9.2.7 - * - * @param component2 the Long with the Number content to set - * @return the field object to enable build pattern - */ - public Field99B setComponent2(java.lang.Long component2) { - setComponent(2, SwiftFormatUtils.getLong(component2)); - return this; - } /** * Alternative method setter for field's Number (component 2) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10 becomes an Integer) * * @param component2 the Number with the Number content to set * @return the field object to enable build pattern - * @see #setNumber(java.lang.Long) */ public Field99B setComponent2(java.lang.Number component2) { @@ -454,27 +431,13 @@ public Field99B setNumber(String component2) { return setComponent2(component2); } - /** - * Set the Number (component 2) from a Long object. - * - * @see #setComponent2(java.lang.Long) - * - * @param component2 Long with the Number content to set - * @return the field object to enable build pattern - * @since 9.2.7 - */ - public Field99B setNumber(java.lang.Long component2) { - return setComponent2(component2); - } - /** * Alternative method setter for field's Number (component 2) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10 becomes an Integer) * * @param component2 the Number with the Number content to set * @return the field object to enable build pattern - * @see #setNumber(java.lang.Long) */ public Field99B setNumber(java.lang.Number component2) { return setComponent2(component2); @@ -488,6 +451,7 @@ public Field99B setNumber(java.lang.Number component2) { * * @return DSS component value or null if the DSS is not set or not available for this field. */ + @Override public String getDSS() { return null; } @@ -498,6 +462,7 @@ public String getDSS() { * @see #getDSS() * @return true if DSS is present, false otherwise. */ + @Override public boolean isDSSPresent() { return false; } @@ -512,6 +477,7 @@ public boolean isDSSPresent() { * * @return for generic fields returns the value of the conditional qualifier or null if not set or not applicable for this field. */ + @Override public String getConditionalQualifier() { return getComponent(CONDITIONAL_QUALIFIER); } @@ -579,7 +545,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field99B(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field99C.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field99C.java index 3a527e139..7598ffcd9 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field99C.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field99C.java @@ -32,12 +32,9 @@ import com.prowidesoftware.swift.model.field.GenericField; -import org.apache.commons.lang3.StringUtils; - -import com.prowidesoftware.swift.model.field.SwiftParseUtils; -import com.prowidesoftware.swift.model.field.Field; import com.prowidesoftware.swift.model.*; import com.prowidesoftware.swift.utils.SwiftFormatUtils; +import org.apache.commons.lang3.StringUtils; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -203,16 +200,14 @@ public String getValueDisplay(int component, Locale locale) { //default format (as is) return getComponent(1); } - if (component == 2) { - //default format (as is) - return getComponent(2); - } - return null; + // This is the last component, return directly without `if` + //default format (as is) + return getComponent(2); } /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -399,32 +394,14 @@ public Field99C setComponent2(String component2) { return this; } - /** - * Set the component2 from a Long object. - *
- * If the component being set is a fixed length number, the argument will not be - * padded. It is recommended for these cases to use the setComponent2(String) - * method. - * - * @see #setComponent2(String) - * @since 9.2.7 - * - * @param component2 the Long with the Number content to set - * @return the field object to enable build pattern - */ - public Field99C setComponent2(java.lang.Long component2) { - setComponent(2, SwiftFormatUtils.getLong(component2)); - return this; - } /** * Alternative method setter for field's Number (component 2) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10 becomes an Integer) * * @param component2 the Number with the Number content to set * @return the field object to enable build pattern - * @see #setNumber(java.lang.Long) */ public Field99C setComponent2(java.lang.Number component2) { @@ -454,27 +431,13 @@ public Field99C setNumber(String component2) { return setComponent2(component2); } - /** - * Set the Number (component 2) from a Long object. - * - * @see #setComponent2(java.lang.Long) - * - * @param component2 Long with the Number content to set - * @return the field object to enable build pattern - * @since 9.2.7 - */ - public Field99C setNumber(java.lang.Long component2) { - return setComponent2(component2); - } - /** * Alternative method setter for field's Number (component 2) as Number - * + *

* This method supports java constant value boxing for simpler coding styles (ex: 10 becomes an Integer) * * @param component2 the Number with the Number content to set * @return the field object to enable build pattern - * @see #setNumber(java.lang.Long) */ public Field99C setNumber(java.lang.Number component2) { return setComponent2(component2); @@ -488,6 +451,7 @@ public Field99C setNumber(java.lang.Number component2) { * * @return DSS component value or null if the DSS is not set or not available for this field. */ + @Override public String getDSS() { return null; } @@ -498,6 +462,7 @@ public String getDSS() { * @see #getDSS() * @return true if DSS is present, false otherwise. */ + @Override public boolean isDSSPresent() { return false; } @@ -512,6 +477,7 @@ public boolean isDSSPresent() { * * @return for generic fields returns the value of the conditional qualifier or null if not set or not applicable for this field. */ + @Override public String getConditionalQualifier() { return getComponent(CONDITIONAL_QUALIFIER); } @@ -579,7 +545,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field99C(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/mt/mt3xx/MT300.java b/src/generated/java/com/prowidesoftware/swift/model/mt/mt3xx/MT300.java index dd4e2fe95..23b175606 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/mt/mt3xx/MT300.java +++ b/src/generated/java/com/prowidesoftware/swift/model/mt/mt3xx/MT300.java @@ -2794,19 +2794,17 @@ public SequenceB1 getSequenceB1() { public SequenceB1 getSequenceB1(SwiftTagListBlock parentSequence) { if (parentSequence != null && !parentSequence.isEmpty()) { final SwiftTagListBlock content = parentSequence.getSubBlock(SequenceB1.START, SequenceB1.END); - content.removeTag(SequenceB1.END); - if (log.isLoggable(java.util.logging.Level.FINE)) { - if (content == null) { + if (content == null) { + if (log.isLoggable(java.util.logging.Level.FINE)) { log.fine("content for sequence SequenceB1: is null"); - } else { - log.fine("content for sequence SequenceB1: "+content.tagNamesList()); } - } - if (content == null) { return new SequenceB1(); - } else { - return new SequenceB1(content); } + content.removeTag(SequenceB1.END); + if (log.isLoggable(java.util.logging.Level.FINE)) { + log.fine("content for sequence SequenceB1: "+content.tagNamesList()); + } + return new SequenceB1(content); } return null; } diff --git a/src/generated/java/com/prowidesoftware/swift/model/mt/mt3xx/MT304.java b/src/generated/java/com/prowidesoftware/swift/model/mt/mt3xx/MT304.java index 7d6be3972..3b1bcfdfa 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/mt/mt3xx/MT304.java +++ b/src/generated/java/com/prowidesoftware/swift/model/mt/mt3xx/MT304.java @@ -1992,19 +1992,17 @@ public SequenceB1 getSequenceB1() { public SequenceB1 getSequenceB1(SwiftTagListBlock parentSequence) { if (parentSequence != null && !parentSequence.isEmpty()) { final SwiftTagListBlock content = parentSequence.getSubBlock(SequenceB1.START, SequenceB1.END); - content.removeTag(SequenceB1.END); - if (log.isLoggable(java.util.logging.Level.FINE)) { - if (content == null) { + if (content == null) { + if (log.isLoggable(java.util.logging.Level.FINE)) { log.fine("content for sequence SequenceB1: is null"); - } else { - log.fine("content for sequence SequenceB1: "+content.tagNamesList()); } - } - if (content == null) { return new SequenceB1(); - } else { - return new SequenceB1(content); } + content.removeTag(SequenceB1.END); + if (log.isLoggable(java.util.logging.Level.FINE)) { + log.fine("content for sequence SequenceB1: "+content.tagNamesList()); + } + return new SequenceB1(content); } return null; } diff --git a/src/main/java/com/prowidesoftware/swift/constraints/IbanValidator.java b/src/main/java/com/prowidesoftware/swift/constraints/IbanValidator.java index 552e92766..2eaf443aa 100644 --- a/src/main/java/com/prowidesoftware/swift/constraints/IbanValidator.java +++ b/src/main/java/com/prowidesoftware/swift/constraints/IbanValidator.java @@ -37,12 +37,13 @@ public boolean isValid(String iban, ConstraintValidatorContext context) { if (StringUtils.isBlank(iban)) { return true; } - IbanValidationResult result = new IBAN(iban).validate(); + IbanValidationResult result = IBAN.validate(iban); if (result == IbanValidationResult.OK) { return true; } else { context.disableDefaultConstraintViolation(); context.buildConstraintViolationWithTemplate(result.message()).addConstraintViolation(); + return false; } } diff --git a/src/main/java/com/prowidesoftware/swift/io/parser/SwiftParser.java b/src/main/java/com/prowidesoftware/swift/io/parser/SwiftParser.java index 6dc7988c4..f874ec537 100644 --- a/src/main/java/com/prowidesoftware/swift/io/parser/SwiftParser.java +++ b/src/main/java/com/prowidesoftware/swift/io/parser/SwiftParser.java @@ -119,7 +119,7 @@ private static Character extractBlock2Type(final String s) { if (i >= 0 && i + 1 < s.length()) { // check for input mark after ':' ch = s.charAt(i + 1); - } else if (s.length() > 0) { + } else if (!s.isEmpty()) { // check start ch = s.charAt(0); } @@ -326,9 +326,9 @@ protected SwiftBlock consumeBlock(final UnparsedTextList unparsedReceiver) throw // read the block contents final String s = readUntilBlockEnds(); - if ("".equals(s)) { + if (StringUtils.isEmpty(s)) { /* if we have an unparsed text add it to last block */ - if (unparsed.length() > 0) { + if (!unparsed.isEmpty()) { if (unparsedReceiver == null) { log.warning("Unparsed text '" + unparsed + "' can not be reported since unparsedReceiver is null"); } else { @@ -391,7 +391,7 @@ protected SwiftBlock consumeBlock(final UnparsedTextList unparsedReceiver) throw // create the block object b = createBlock(blockId, s); - if (unparsed.length() > 0) { + if (!unparsed.isEmpty()) { if (unparsedReceiver == null) { log.warning("Unparsed text '" + unparsed + "' can not be reported since unparsedReceiver is null"); } else { @@ -562,7 +562,7 @@ protected SwiftTagListBlock consumeTagListBlock(final SwiftTagListBlock b, final int end; for (end = i; end < data.length() && data.charAt(end) != '{'; end++) {} final String unparsedText = data.substring(i, end).trim(); - if (!"".equals(unparsedText)) { + if (!StringUtils.isEmpty(unparsedText)) { b.unparsedTextAddText(unparsedText); } i = end - 1; @@ -629,7 +629,7 @@ protected SwiftBlock4 consumeBlock4(final SwiftBlock4 b, final String s) { // check if we skipped a block unparsed text String unparsedText = s.substring(begin, start - ignore - 1).trim(); - if (!"".equals(unparsedText)) { + if (!StringUtils.isEmpty(unparsedText)) { b.unparsedTextAddText(unparsedText); } @@ -978,7 +978,7 @@ private UnparsedTextList processUnparsedText(final String unparsedText) { // separate a text final String text = unparsedText.substring(start, end).trim(); - if (!"".equals(text)) { + if (!StringUtils.isEmpty(text)) { // add it to the list (create it if needed) if (list == null) { diff --git a/src/main/java/com/prowidesoftware/swift/io/parser/XMLParser.java b/src/main/java/com/prowidesoftware/swift/io/parser/XMLParser.java index 342f40bab..1e52044d2 100644 --- a/src/main/java/com/prowidesoftware/swift/io/parser/XMLParser.java +++ b/src/main/java/com/prowidesoftware/swift/io/parser/XMLParser.java @@ -380,7 +380,13 @@ private Field getField(final Node t) { String text = getText(n); // normalize line feeds (DOM parser removes carriage return characters from original XML file) text = StringUtils.replace(text, "\n", FINWriterVisitor.SWIFT_EOL); - field.setComponent(Integer.parseInt(number), text); + try { + field.setComponent(Integer.parseInt(number), text); + } catch (NumberFormatException e) { + log.warning( + "error setting component " + number + " for field " + name + ": " + e.getMessage()); + return null; + } } } } diff --git a/src/main/java/com/prowidesoftware/swift/io/writer/FINWriterVisitor.java b/src/main/java/com/prowidesoftware/swift/io/writer/FINWriterVisitor.java index 0807a9084..873f7c31d 100644 --- a/src/main/java/com/prowidesoftware/swift/io/writer/FINWriterVisitor.java +++ b/src/main/java/com/prowidesoftware/swift/io/writer/FINWriterVisitor.java @@ -297,27 +297,6 @@ public void endBlockUser(SwiftBlockUser b) { write("}"); } - //////////////////////////////////////////////////////////// - // - // DEPRECATED - // - //////////////////////////////////////////////////////////// - public void tag(SwiftBlock b, Tag t) { - if (b == null) return; - if (b instanceof SwiftBlock3) { - tag((SwiftBlock3) b, t); - } - if (b instanceof SwiftBlock4) { - tag((SwiftBlock4) b, t); - } - if (b instanceof SwiftBlock5) { - tag((SwiftBlock5) b, t); - } - if (b instanceof SwiftBlockUser) { - tag((SwiftBlockUser) b, t); - } - } - //////////////////////////////////////////////////////////// // // INTERNAL METHODS diff --git a/src/main/java/com/prowidesoftware/swift/io/writer/XMLWriterVisitor.java b/src/main/java/com/prowidesoftware/swift/io/writer/XMLWriterVisitor.java index 7dd2ac1e1..11763d0bf 100644 --- a/src/main/java/com/prowidesoftware/swift/io/writer/XMLWriterVisitor.java +++ b/src/main/java/com/prowidesoftware/swift/io/writer/XMLWriterVisitor.java @@ -319,27 +319,6 @@ public void endBlockUser(SwiftBlockUser b) { write(EOL + ""); } - //////////////////////////////////////////////////////////// - // - // DEPRECATED - // - //////////////////////////////////////////////////////////// - public void tag(SwiftBlock b, Tag t) { - if (b == null) return; - if (b instanceof SwiftBlock3) { - tag((SwiftBlock3) b, t); - } - if (b instanceof SwiftBlock4) { - tag((SwiftBlock4) b, t); - } - if (b instanceof SwiftBlock5) { - tag((SwiftBlock5) b, t); - } - if (b instanceof SwiftBlockUser) { - tag((SwiftBlockUser) b, t); - } - } - //////////////////////////////////////////////////////////// // // INTERNAL METHODS diff --git a/src/main/java/com/prowidesoftware/swift/model/BicValidationResult.java b/src/main/java/com/prowidesoftware/swift/model/BicValidationResult.java index 18c2f7cc4..3a2d4b05f 100644 --- a/src/main/java/com/prowidesoftware/swift/model/BicValidationResult.java +++ b/src/main/java/com/prowidesoftware/swift/model/BicValidationResult.java @@ -15,6 +15,8 @@ */ package com.prowidesoftware.swift.model; +import static com.prowidesoftware.swift.utils.ConstraintUtils.escapeEcmaScript; + import java.util.Objects; /** @@ -52,7 +54,7 @@ public enum BicValidationResult { */ public String message() { return this.message - .replace("${found}", Objects.toString(found)) + .replace("${found}", Objects.toString(escapeEcmaScript(found))) .replace("${length}", found == null ? "-1" : String.valueOf(found.length())); } diff --git a/src/main/java/com/prowidesoftware/swift/model/IBAN.java b/src/main/java/com/prowidesoftware/swift/model/IBAN.java index ea913b30f..7da17d63c 100644 --- a/src/main/java/com/prowidesoftware/swift/model/IBAN.java +++ b/src/main/java/com/prowidesoftware/swift/model/IBAN.java @@ -139,16 +139,37 @@ public boolean isValid() { * @return IbanFormatStatus with detailed information of the validation problem found */ public IbanValidationResult validate() { - if (iban == null) { + if (this.iban == null) { return IbanValidationResult.IBAN_IS_NULL; } - if (iban.length() == 0) { + final String code = removeNonAlpha(this.iban); + + return validate(code); + } + + /** + * Check an IBAN code throwing an exception with validation details if it is not valid. + * + *

Validates that the length is at least 5 chars: composed by a valid 2 letters ISO country code, + * 2 verifying digits, and 1 BBAN. The verification digits are also computed and verified. + * For the BBAN validation the specific per country structure must be defined either in the + * BbanStructureValidations.json file or by API in the {@link BbanStructureValidations} instance. + * + *

Non alpha-numeric characters are removed from the code prior to validation. Meaning an IBAN + * such as "ES64 0049 6170 68 2810279951" will be considered valid. + * + * @return IbanFormatStatus with detailed information of the validation problem found + */ + public static IbanValidationResult validate(String code) { + if (code == null) { + return IbanValidationResult.IBAN_IS_NULL; + } + if (code.isEmpty()) { return IbanValidationResult.IBAN_IS_EMPTY; } - IbanValidationResult result = null; + IbanValidationResult result; try { - final String code = removeNonAlpha(this.iban); result = IbanValidationUtils.validateCountryCode(code); diff --git a/src/main/java/com/prowidesoftware/swift/model/IbanValidationResult.java b/src/main/java/com/prowidesoftware/swift/model/IbanValidationResult.java index 19bfc0e09..34c9d92dd 100644 --- a/src/main/java/com/prowidesoftware/swift/model/IbanValidationResult.java +++ b/src/main/java/com/prowidesoftware/swift/model/IbanValidationResult.java @@ -15,6 +15,8 @@ */ package com.prowidesoftware.swift.model; +import static com.prowidesoftware.swift.utils.ConstraintUtils.escapeEcmaScript; + import java.util.HashMap; import java.util.Map; import java.util.Map.Entry; @@ -68,7 +70,7 @@ public enum IbanValidationResult { public String message() { String msg = this.message; for (Entry e : vars.entrySet()) { - msg = msg.replace("${" + e.getKey() + "}", e.getValue()); + msg = msg.replace("${" + e.getKey() + "}", escapeEcmaScript(e.getValue())); } return msg; } diff --git a/src/main/java/com/prowidesoftware/swift/model/MtSwiftMessage.java b/src/main/java/com/prowidesoftware/swift/model/MtSwiftMessage.java index f4e7905c5..4add0122a 100644 --- a/src/main/java/com/prowidesoftware/swift/model/MtSwiftMessage.java +++ b/src/main/java/com/prowidesoftware/swift/model/MtSwiftMessage.java @@ -67,6 +67,7 @@ public MtSwiftMessage() {} /** * Calls {@link #MtSwiftMessage(String, MessageMetadataStrategy)} with the {@link DefaultMtMetadataStrategy} + * * @param fin the plain FIN message content */ public MtSwiftMessage(final String fin) { @@ -95,6 +96,7 @@ public MtSwiftMessage(final String fin, final MessageMetadataStrategy metadataSt /** * Calls {@link #MtSwiftMessage(InputStream, MessageMetadataStrategy)} with the {@link DefaultMtMetadataStrategy} + * * @param stream input stream to read * @throws IOException on error during file reading */ @@ -107,7 +109,7 @@ public MtSwiftMessage(final InputStream stream) throws IOException { *
* File format is set to {@link FileFormat#FIN}. * - * @param stream input stream to read + * @param stream input stream to read * @param metadataStrategy a strategy for metadata extraction * @throws IOException on error during file reading * @since 9.1.4 @@ -131,7 +133,7 @@ public MtSwiftMessage(final File file) throws IOException { *
* File format is set to {@link FileFormat#FIN} * - * @param file file holding message content + * @param file file holding message content * @param metadataStrategy a strategy for metadata extraction * @throws IOException on error during file reading * @since 9.1.4 @@ -339,6 +341,7 @@ private void applyStrategy(SwiftMessage model, MessageMetadataStrategy strategy) /** * Calls {@link #updateFromFIN(String, MessageMetadataStrategy)} with the {@link DefaultMtMetadataStrategy} + * * @param fin raw (FIN) message content to update from */ public void updateFromFIN(final String fin) { @@ -438,10 +441,13 @@ public SwiftMessage modelMessage() { public Integer getMessageTypeInt() { final String number = getMessageType(); if (StringUtils.isNumeric(number)) { - return Integer.parseInt(number); - } else { - return null; + try { + return Integer.parseInt(number); + } catch (NumberFormatException e) { + log.log(Level.WARNING, "error parsing message type as number: " + e.getMessage(), e); + } } + return null; } /** diff --git a/src/main/java/com/prowidesoftware/swift/model/SwiftMessageUtils.java b/src/main/java/com/prowidesoftware/swift/model/SwiftMessageUtils.java index c59927e16..bd675e147 100644 --- a/src/main/java/com/prowidesoftware/swift/model/SwiftMessageUtils.java +++ b/src/main/java/com/prowidesoftware/swift/model/SwiftMessageUtils.java @@ -332,7 +332,7 @@ public static String identifier(final SwiftMessage m) { /** * Proprietary checksum for message integrity verification or duplicates detection. *

Please notice this is not the SWIFT trailer CHK field. - *

The implementation computes an MD5 on the complete message in FIN format. The result hash + *

The implementation computes an SHA-256 on the complete message in FIN format. The result hash * is a 32 character string, you may consider encoding it with base64 on top to have the same * information stored in 22 characters. * @@ -344,7 +344,7 @@ public static String calculateChecksum(final SwiftMessage model) { final StringWriter writer = new StringWriter(); SwiftWriter.writeMessage(model, writer, true); final String fin = writer.getBuffer().toString(); - return md5(fin); + return sha256(fin); } else { return null; } @@ -353,7 +353,7 @@ public static String calculateChecksum(final SwiftMessage model) { /** * Proprietary checksum for message text block (block 4) integrity verification or duplicates detection *

Please notice this is not the SWIFT trailer CHK field. - *

The implementation computes an MD5 on the complete message in FIN format. The result hash + *

The implementation computes an SHA-256 on the complete message in FIN format. The result hash * is a 32 character string, you may consider encoding it with base64 on top to have the same * information stored in 22 characters. * @@ -366,24 +366,22 @@ public static String calculateChecksum(final SwiftBlock4 b4) { final StringWriter writer = new StringWriter(); SwiftWriter.writeBlock4(b4, writer); final String fin = writer.getBuffer().toString(); - return md5(fin); + return sha256(fin); } else { return null; } } /** - * Computes an MD5 hash on the parameter text + * Computes a SHA-256 hash on the parameter text * * @param text the text to hash * @return computed hash or null if exceptions are thrown reading bytes or processing the digest - * @since 7.9.5 */ - // TODO add base 64 encoding on top when upgraded to Java 8 - private static String md5(final String text) { + private static String sha256(final String text) { try { byte[] bytesOfMessage = text.getBytes(StandardCharsets.UTF_8); - MessageDigest md = MessageDigest.getInstance("MD5"); + MessageDigest md = MessageDigest.getInstance("SHA-256"); byte[] thedigest = md.digest(bytesOfMessage); // Converting the bytes to a Hex string diff --git a/src/main/java/com/prowidesoftware/swift/model/SwiftTagListBlock.java b/src/main/java/com/prowidesoftware/swift/model/SwiftTagListBlock.java index a5e739c5c..242bf6b05 100644 --- a/src/main/java/com/prowidesoftware/swift/model/SwiftTagListBlock.java +++ b/src/main/java/com/prowidesoftware/swift/model/SwiftTagListBlock.java @@ -1828,21 +1828,20 @@ public int countTagsStarsWith(final String name, final String value) { * @return a new block with the trimmed content */ public SwiftTagListBlock removeAfterFirstStartsWith(final String name, final String startsWith) { - if (this.tags == null || !this.tags.isEmpty()) { + if (this.tags == null || this.tags.isEmpty()) { return new SwiftTagListBlock(); } - final List tags = new ArrayList<>(); - boolean done = false; - for (int i = 0; i < this.tags.size() && !done; i++) { - final Tag t = this.tags.get(i); - if (StringUtils.equals(t.getName(), name) && t.startsWith(startsWith)) { - done = true; + final List updatedTags = new ArrayList<>(); + + for (Tag t : this.tags) { + if (StringUtils.equals(t.getName(), name) && StringUtils.startsWith(t.getValue(), startsWith)) { + break; } else { - tags.add(t); + updatedTags.add(t); } } - return new SwiftTagListBlock(tags); + return new SwiftTagListBlock(updatedTags); } /** @@ -1941,7 +1940,7 @@ public SwiftTagListBlock append(final Tag... tags) { * @since 7.7 */ public SwiftTagListBlock append(final Field field) { - Validate.notNull(field); + Validate.isTrue(field != null); this.tags.add(field.asTag()); return this; } @@ -1954,7 +1953,7 @@ public SwiftTagListBlock append(final Field field) { * @since 7.8 */ public SwiftTagListBlock append(final Field... fields) { - if (fields != null && fields.length > 0) { + if (fields != null) { for (final Field f : fields) { append(f); } diff --git a/src/main/java/com/prowidesoftware/swift/model/Tag.java b/src/main/java/com/prowidesoftware/swift/model/Tag.java index a39b7a278..ceac8f6c4 100644 --- a/src/main/java/com/prowidesoftware/swift/model/Tag.java +++ b/src/main/java/com/prowidesoftware/swift/model/Tag.java @@ -401,7 +401,11 @@ public Integer getNumber() { } } if (sb.length() > 0) { - return Integer.parseInt(sb.toString()); + try { + return Integer.parseInt(sb.toString()); + } catch (NumberFormatException e) { + return null; + } } } return null; diff --git a/src/main/java/com/prowidesoftware/swift/model/UnparsedTextList.java b/src/main/java/com/prowidesoftware/swift/model/UnparsedTextList.java index 42c9d3cbd..34cc34c49 100644 --- a/src/main/java/com/prowidesoftware/swift/model/UnparsedTextList.java +++ b/src/main/java/com/prowidesoftware/swift/model/UnparsedTextList.java @@ -247,21 +247,6 @@ public void addText(final SwiftMessage message) { this.addText(msg); } - /** - * removes an unparsed text - * - * @param index the index of the text to remove - * @throws IllegalArgumentException if parameter index is null - * @throws IndexOutOfBoundsException if parameter index is out of bounds - */ - public void removeText(final Integer index) { - // sanity check - Objects.requireNonNull(index, WRITER_MESSAGE); - - // remove the text - this.texts.remove(index.intValue()); - } - /** * removes an unparsed text * diff --git a/src/main/java/com/prowidesoftware/swift/model/field/Field.java b/src/main/java/com/prowidesoftware/swift/model/field/Field.java index e5a87fc6a..c2ae9ef7c 100644 --- a/src/main/java/com/prowidesoftware/swift/model/field/Field.java +++ b/src/main/java/com/prowidesoftware/swift/model/field/Field.java @@ -56,6 +56,14 @@ public abstract class Field implements PatternContainer, JsonSerializable { private static final String fieldNamePattern = "^\\d{2,3}[A-Z]?$"; + /** + * No-argument constructor required for serialization. + * Initializes the components list. + */ + protected Field() { + this.components = new ArrayList<>(); + } + /** * Creates a field with the list of components initialized to the given number of components. * diff --git a/src/main/java/com/prowidesoftware/swift/model/field/Field11T.java b/src/main/java/com/prowidesoftware/swift/model/field/Field11T.java index f63569990..281446fc0 100644 --- a/src/main/java/com/prowidesoftware/swift/model/field/Field11T.java +++ b/src/main/java/com/prowidesoftware/swift/model/field/Field11T.java @@ -221,13 +221,11 @@ public String getValueDisplay(int component, Locale locale) { return f.format(cal.getTime()); } } - if (component == 3) { - // time: HH[mm] - java.text.DateFormat f = new java.text.SimpleDateFormat("HH:mm", notNull(locale)); - java.util.Calendar cal = getComponent3AsCalendar(); - if (cal != null) { - return f.format(cal.getTime()); - } + // time: HH[mm] + java.text.DateFormat f = new java.text.SimpleDateFormat("HH:mm", notNull(locale)); + java.util.Calendar cal = getComponent3AsCalendar(); + if (cal != null) { + return f.format(cal.getTime()); } return null; } @@ -453,24 +451,6 @@ public Field11T setComponent1(String component1) { return this; } - /** - * Set the component1 from a Long object. - *
- * If the component being set is a fixed length number, the argument will not be - * padded. It is recommended for these cases to use the setComponent1(String) - * method. - * - * @see #setComponent1(String) - * @since 9.2.7 - * - * @param component1 the Long with the Type content to set - * @return the field object to enable build pattern - */ - public Field11T setComponent1(java.lang.Long component1) { - setComponent(1, SwiftFormatUtils.getLong(component1)); - return this; - } - /** * Alternative method setter for field's Type (component 1) as as Number * @@ -478,7 +458,6 @@ public Field11T setComponent1(java.lang.Long component1) { * * @param component1 the Number with the Type content to set * @return the field object to enable build pattern - * @see #setType(java.lang.Long) */ public Field11T setComponent1(java.lang.Number component1) { @@ -508,19 +487,6 @@ public Field11T setType(String component1) { return setComponent1(component1); } - /** - * Set the Type (component 1) from a Long object. - * - * @see #setComponent1(java.lang.Long) - * - * @param component1 Long with the Type content to set - * @return the field object to enable build pattern - * @since 9.2.7 - */ - public Field11T setType(java.lang.Long component1) { - return setComponent1(component1); - } - /** * Alternative method setter for field's Type (component 1) as as Number * @@ -528,7 +494,6 @@ public Field11T setType(java.lang.Long component1) { * * @param component1 the Number with the Type content to set * @return the field object to enable build pattern - * @see #setType(java.lang.Long) */ public Field11T setType(java.lang.Number component1) { return setComponent1(component1); @@ -627,6 +592,7 @@ public Field11T setTime(java.util.Calendar component3) { * * @return the list of converted components (a Calendar object or null) */ + @Override public List dates() { return DateResolver.dates(this); } @@ -703,7 +669,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field11T(f)); } @@ -719,6 +685,7 @@ public static List getAll(final SwiftTagListBlock block) { * @return line content or null if not present or if line number is above the expected * @since 7.7 */ + @Override public String getLine(int line) { return getLine(line, 0); } @@ -732,6 +699,7 @@ public String getLine(int line) { * @return line content or null if not present or if line number is above the expected * @since 7.7 */ + @Override public String getLine(int line, int offset) { Field11T cp = newInstance(this); return getLine(cp, line, null, offset); @@ -744,6 +712,7 @@ public String getLine(int line, int offset) { * @return lines content or empty list if field's value is empty * @since 7.7 */ + @Override public List getLines() { return SwiftParseUtils.getLines(getValue()); } @@ -756,6 +725,7 @@ public List getLines() { * @return found lines or empty list if lines are not present or the offset is invalid * @since 7.7 */ + @Override public List getLines(int offset) { Field11T cp = newInstance(this); return SwiftParseUtils.getLines(getLine(cp, null, null, offset)); @@ -770,6 +740,7 @@ public List getLines(int offset) { * @return found lines or empty list if value is empty * @since 7.7 */ + @Override public List getLinesBetween(int start, int end) { return getLinesBetween(start, end, 0); } @@ -784,6 +755,7 @@ public List getLinesBetween(int start, int end) { * @return found lines or empty list if lines are not present or the offset is invalid * @since 7.7 */ + @Override public List getLinesBetween(int start, int end, int offset) { Field11T cp = newInstance(this); return SwiftParseUtils.getLines(getLine(cp, start, end, offset)); diff --git a/src/main/java/com/prowidesoftware/swift/model/field/Field12H.java b/src/main/java/com/prowidesoftware/swift/model/field/Field12H.java index 1d2c523bc..799c164b6 100644 --- a/src/main/java/com/prowidesoftware/swift/model/field/Field12H.java +++ b/src/main/java/com/prowidesoftware/swift/model/field/Field12H.java @@ -191,11 +191,8 @@ public String getValueDisplay(int component, Locale locale) { // default format (as is) return getComponent(1); } - if (component == 2) { - // default format (as is) - return getComponent(2); - } - return null; + // default format (as is) + return getComponent(2); } /** @@ -238,10 +235,7 @@ public String validatorPattern() { */ @Override public boolean isOptional(int component) { - if (component == 2) { - return true; - } - return false; + return component == 2; } /** @@ -444,7 +438,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field12H(f)); } diff --git a/src/main/java/com/prowidesoftware/swift/model/field/Field12L.java b/src/main/java/com/prowidesoftware/swift/model/field/Field12L.java index a9384d7e6..87a90e355 100644 --- a/src/main/java/com/prowidesoftware/swift/model/field/Field12L.java +++ b/src/main/java/com/prowidesoftware/swift/model/field/Field12L.java @@ -174,14 +174,11 @@ public String getValue() { */ @Override public String getValueDisplay(int component, Locale locale) { - if (component < 1 || component > 1) { + if (component != 1) { throw new IllegalArgumentException("invalid component number " + component + " for field 12L"); } - if (component == 1) { - // default format (as is) - return getComponent(1); - } - return null; + // default format (as is) + return getComponent(1); } /** @@ -387,7 +384,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field12L(f)); } diff --git a/src/main/java/com/prowidesoftware/swift/model/field/Field12R.java b/src/main/java/com/prowidesoftware/swift/model/field/Field12R.java index 655199728..5dd30a98f 100644 --- a/src/main/java/com/prowidesoftware/swift/model/field/Field12R.java +++ b/src/main/java/com/prowidesoftware/swift/model/field/Field12R.java @@ -191,11 +191,8 @@ public String getValueDisplay(int component, Locale locale) { // default format (as is) return getComponent(1); } - if (component == 2) { - // default format (as is) - return getComponent(2); - } - return null; + // default format (as is) + return getComponent(2); } /** @@ -238,10 +235,7 @@ public String validatorPattern() { */ @Override public boolean isOptional(int component) { - if (component == 2) { - return true; - } - return false; + return component == 2; } /** @@ -444,7 +438,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field12R(f)); } diff --git a/src/main/java/com/prowidesoftware/swift/model/field/Field12S.java b/src/main/java/com/prowidesoftware/swift/model/field/Field12S.java index bca47b057..f6e64146c 100644 --- a/src/main/java/com/prowidesoftware/swift/model/field/Field12S.java +++ b/src/main/java/com/prowidesoftware/swift/model/field/Field12S.java @@ -174,14 +174,11 @@ public String getValue() { */ @Override public String getValueDisplay(int component, Locale locale) { - if (component < 1 || component > 1) { + if (component != 1) { throw new IllegalArgumentException("invalid component number " + component + " for field 12S"); } - if (component == 1) { - // default format (as is) - return getComponent(1); - } - return null; + // default format (as is) + return getComponent(1); } /** @@ -387,7 +384,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field12S(f)); } diff --git a/src/main/java/com/prowidesoftware/swift/model/field/Field13E.java b/src/main/java/com/prowidesoftware/swift/model/field/Field13E.java index a802972e0..fb73a23af 100644 --- a/src/main/java/com/prowidesoftware/swift/model/field/Field13E.java +++ b/src/main/java/com/prowidesoftware/swift/model/field/Field13E.java @@ -201,13 +201,11 @@ public String getValueDisplay(int component, Locale locale) { return f.format(cal.getTime()); } } - if (component == 2) { - // time: HH[mm] - java.text.DateFormat f = new java.text.SimpleDateFormat("HH:mm", notNull(locale)); - java.util.Calendar cal = getComponent2AsCalendar(); - if (cal != null) { - return f.format(cal.getTime()); - } + // time: HH[mm] + java.text.DateFormat f = new java.text.SimpleDateFormat("HH:mm", notNull(locale)); + java.util.Calendar cal = getComponent2AsCalendar(); + if (cal != null) { + return f.format(cal.getTime()); } return null; } @@ -477,6 +475,7 @@ public Field13E setTime(java.util.Calendar component2) { * * @return the list of converted components (a Calendar object or null) */ + @Override public List dates() { return DateResolver.dates(this); } @@ -553,7 +552,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field13E(f)); } diff --git a/src/main/java/com/prowidesoftware/swift/model/field/Field20E.java b/src/main/java/com/prowidesoftware/swift/model/field/Field20E.java index 77f920540..6033d4a09 100644 --- a/src/main/java/com/prowidesoftware/swift/model/field/Field20E.java +++ b/src/main/java/com/prowidesoftware/swift/model/field/Field20E.java @@ -190,11 +190,8 @@ public String getValueDisplay(int component, Locale locale) { // default format (as is) return getComponent(1); } - if (component == 2) { - // default format (as is) - return getComponent(2); - } - return null; + // default format (as is) + return getComponent(2); } /** @@ -440,7 +437,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field20E(f)); } diff --git a/src/main/java/com/prowidesoftware/swift/model/field/Field21S.java b/src/main/java/com/prowidesoftware/swift/model/field/Field21S.java index 091a79ecf..5124e85d5 100644 --- a/src/main/java/com/prowidesoftware/swift/model/field/Field21S.java +++ b/src/main/java/com/prowidesoftware/swift/model/field/Field21S.java @@ -174,14 +174,11 @@ public String getValue() { */ @Override public String getValueDisplay(int component, Locale locale) { - if (component < 1 || component > 1) { + if (component != 1) { throw new IllegalArgumentException("invalid component number " + component + " for field 21S"); } - if (component == 1) { - // default format (as is) - return getComponent(1); - } - return null; + // default format (as is) + return getComponent(1); } /** @@ -387,7 +384,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field21S(f)); } diff --git a/src/main/java/com/prowidesoftware/swift/model/field/Field21T.java b/src/main/java/com/prowidesoftware/swift/model/field/Field21T.java index 605a5eb4a..b0658a569 100644 --- a/src/main/java/com/prowidesoftware/swift/model/field/Field21T.java +++ b/src/main/java/com/prowidesoftware/swift/model/field/Field21T.java @@ -174,14 +174,11 @@ public String getValue() { */ @Override public String getValueDisplay(int component, Locale locale) { - if (component < 1 || component > 1) { + if (component != 1) { throw new IllegalArgumentException("invalid component number " + component + " for field 21T"); } - if (component == 1) { - // default format (as is) - return getComponent(1); - } - return null; + // default format (as is) + return getComponent(1); } /** @@ -387,7 +384,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field21T(f)); } diff --git a/src/main/java/com/prowidesoftware/swift/model/field/Field25F.java b/src/main/java/com/prowidesoftware/swift/model/field/Field25F.java index e57d70c9a..73f90cdb9 100644 --- a/src/main/java/com/prowidesoftware/swift/model/field/Field25F.java +++ b/src/main/java/com/prowidesoftware/swift/model/field/Field25F.java @@ -174,14 +174,11 @@ public String getValue() { */ @Override public String getValueDisplay(int component, Locale locale) { - if (component < 1 || component > 1) { + if (component != 1) { throw new IllegalArgumentException("invalid component number " + component + " for field 25F"); } - if (component == 1) { - // default format (as is) - return getComponent(1); - } - return null; + // default format (as is) + return getComponent(1); } /** @@ -387,7 +384,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field25F(f)); } diff --git a/src/main/java/com/prowidesoftware/swift/model/field/Field25G.java b/src/main/java/com/prowidesoftware/swift/model/field/Field25G.java index 67c15729c..6dacdf522 100644 --- a/src/main/java/com/prowidesoftware/swift/model/field/Field25G.java +++ b/src/main/java/com/prowidesoftware/swift/model/field/Field25G.java @@ -174,14 +174,11 @@ public String getValue() { */ @Override public String getValueDisplay(int component, Locale locale) { - if (component < 1 || component > 1) { + if (component != 1) { throw new IllegalArgumentException("invalid component number " + component + " for field 25G"); } - if (component == 1) { - // default format (as is) - return getComponent(1); - } - return null; + // default format (as is) + return getComponent(1); } /** @@ -387,7 +384,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field25G(f)); } diff --git a/src/main/java/com/prowidesoftware/swift/model/field/Field27A.java b/src/main/java/com/prowidesoftware/swift/model/field/Field27A.java index a2e2dff36..613db57cf 100644 --- a/src/main/java/com/prowidesoftware/swift/model/field/Field27A.java +++ b/src/main/java/com/prowidesoftware/swift/model/field/Field27A.java @@ -192,11 +192,8 @@ public String getValueDisplay(int component, Locale locale) { // default format (as is) return getComponent(1); } - if (component == 2) { - // default format (as is) - return getComponent(2); - } - return null; + // default format (as is) + return getComponent(2); } /** @@ -386,24 +383,6 @@ public Field27A setComponent1(String component1) { return this; } - /** - * Set the component1 from a Long object. - *
- * If the component being set is a fixed length number, the argument will not be - * padded. It is recommended for these cases to use the setComponent1(String) - * method. - * - * @see #setComponent1(String) - * @since 9.2.7 - * - * @param component1 the Long with the Number content to set - * @return the field object to enable build pattern - */ - public Field27A setComponent1(java.lang.Long component1) { - setComponent(1, SwiftFormatUtils.getLong(component1)); - return this; - } - /** * Alternative method setter for field's Number (component 1) as as Number * @@ -411,7 +390,6 @@ public Field27A setComponent1(java.lang.Long component1) { * * @param component1 the Number with the Number content to set * @return the field object to enable build pattern - * @see #setNumber(java.lang.Long) */ public Field27A setComponent1(java.lang.Number component1) { @@ -441,19 +419,6 @@ public Field27A setNumber(String component1) { return setComponent1(component1); } - /** - * Set the Number (component 1) from a Long object. - * - * @see #setComponent1(java.lang.Long) - * - * @param component1 Long with the Number content to set - * @return the field object to enable build pattern - * @since 9.2.7 - */ - public Field27A setNumber(java.lang.Long component1) { - return setComponent1(component1); - } - /** * Alternative method setter for field's Number (component 1) as as Number * @@ -461,7 +426,6 @@ public Field27A setNumber(java.lang.Long component1) { * * @param component1 the Number with the Number content to set * @return the field object to enable build pattern - * @see #setNumber(java.lang.Long) */ public Field27A setNumber(java.lang.Number component1) { return setComponent1(component1); @@ -478,24 +442,6 @@ public Field27A setComponent2(String component2) { return this; } - /** - * Set the component2 from a Long object. - *
- * If the component being set is a fixed length number, the argument will not be - * padded. It is recommended for these cases to use the setComponent2(String) - * method. - * - * @see #setComponent2(String) - * @since 9.2.7 - * - * @param component2 the Long with the Total content to set - * @return the field object to enable build pattern - */ - public Field27A setComponent2(java.lang.Long component2) { - setComponent(2, SwiftFormatUtils.getLong(component2)); - return this; - } - /** * Alternative method setter for field's Total (component 2) as as Number * @@ -503,7 +449,6 @@ public Field27A setComponent2(java.lang.Long component2) { * * @param component2 the Number with the Total content to set * @return the field object to enable build pattern - * @see #setTotal(java.lang.Long) */ public Field27A setComponent2(java.lang.Number component2) { @@ -533,19 +478,6 @@ public Field27A setTotal(String component2) { return setComponent2(component2); } - /** - * Set the Total (component 2) from a Long object. - * - * @see #setComponent2(java.lang.Long) - * - * @param component2 Long with the Total content to set - * @return the field object to enable build pattern - * @since 9.2.7 - */ - public Field27A setTotal(java.lang.Long component2) { - return setComponent2(component2); - } - /** * Alternative method setter for field's Total (component 2) as as Number * @@ -622,7 +554,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field27A(f)); } diff --git a/src/main/java/com/prowidesoftware/swift/model/field/Field29D.java b/src/main/java/com/prowidesoftware/swift/model/field/Field29D.java index b83de7f83..363ee644c 100644 --- a/src/main/java/com/prowidesoftware/swift/model/field/Field29D.java +++ b/src/main/java/com/prowidesoftware/swift/model/field/Field29D.java @@ -193,11 +193,8 @@ public String getValueDisplay(int component, Locale locale) { // default format (as is) return getComponent(3); } - if (component == 4) { - // default format (as is) - return getComponent(4); - } - return null; + // default format (as is) + return getComponent(4); } /** @@ -246,10 +243,7 @@ public boolean isOptional(int component) { if (component == 3) { return true; } - if (component == 4) { - return true; - } - return false; + return component == 4; } /** @@ -572,7 +566,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field29D(f)); } @@ -588,6 +582,7 @@ public static List getAll(final SwiftTagListBlock block) { * @return line content or null if not present or if line number is above the expected * @since 7.7 */ + @Override public String getLine(int line) { return getLine(line, 0); } @@ -601,6 +596,7 @@ public String getLine(int line) { * @return line content or null if not present or if line number is above the expected * @since 7.7 */ + @Override public String getLine(int line, int offset) { Field29D cp = newInstance(this); return getLine(cp, line, null, offset); @@ -613,6 +609,7 @@ public String getLine(int line, int offset) { * @return lines content or empty list if field's value is empty * @since 7.7 */ + @Override public List getLines() { return SwiftParseUtils.getLines(getValue()); } @@ -625,6 +622,7 @@ public List getLines() { * @return found lines or empty list if lines are not present or the offset is invalid * @since 7.7 */ + @Override public List getLines(int offset) { Field29D cp = newInstance(this); return SwiftParseUtils.getLines(getLine(cp, null, null, offset)); @@ -639,6 +637,7 @@ public List getLines(int offset) { * @return found lines or empty list if value is empty * @since 7.7 */ + @Override public List getLinesBetween(int start, int end) { return getLinesBetween(start, end, 0); } @@ -653,6 +652,7 @@ public List getLinesBetween(int start, int end) { * @return found lines or empty list if lines are not present or the offset is invalid * @since 7.7 */ + @Override public List getLinesBetween(int start, int end, int offset) { Field29D cp = newInstance(this); return SwiftParseUtils.getLines(getLine(cp, start, end, offset)); diff --git a/src/main/java/com/prowidesoftware/swift/model/field/Field29F.java b/src/main/java/com/prowidesoftware/swift/model/field/Field29F.java index 856c37be4..fe0bb769d 100644 --- a/src/main/java/com/prowidesoftware/swift/model/field/Field29F.java +++ b/src/main/java/com/prowidesoftware/swift/model/field/Field29F.java @@ -193,11 +193,8 @@ public String getValueDisplay(int component, Locale locale) { // default format (as is) return getComponent(3); } - if (component == 4) { - // default format (as is) - return getComponent(4); - } - return null; + // default format (as is) + return getComponent(4); } /** @@ -246,10 +243,7 @@ public boolean isOptional(int component) { if (component == 3) { return true; } - if (component == 4) { - return true; - } - return false; + return component == 4; } /** @@ -572,7 +566,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field29F(f)); } @@ -588,6 +582,7 @@ public static List getAll(final SwiftTagListBlock block) { * @return line content or null if not present or if line number is above the expected * @since 7.7 */ + @Override public String getLine(int line) { return getLine(line, 0); } @@ -601,6 +596,7 @@ public String getLine(int line) { * @return line content or null if not present or if line number is above the expected * @since 7.7 */ + @Override public String getLine(int line, int offset) { Field29F cp = newInstance(this); return getLine(cp, line, null, offset); @@ -613,6 +609,7 @@ public String getLine(int line, int offset) { * @return lines content or empty list if field's value is empty * @since 7.7 */ + @Override public List getLines() { return SwiftParseUtils.getLines(getValue()); } @@ -625,6 +622,7 @@ public List getLines() { * @return found lines or empty list if lines are not present or the offset is invalid * @since 7.7 */ + @Override public List getLines(int offset) { Field29F cp = newInstance(this); return SwiftParseUtils.getLines(getLine(cp, null, null, offset)); @@ -639,6 +637,7 @@ public List getLines(int offset) { * @return found lines or empty list if value is empty * @since 7.7 */ + @Override public List getLinesBetween(int start, int end) { return getLinesBetween(start, end, 0); } @@ -653,6 +652,7 @@ public List getLinesBetween(int start, int end) { * @return found lines or empty list if lines are not present or the offset is invalid * @since 7.7 */ + @Override public List getLinesBetween(int start, int end, int offset) { Field29F cp = newInstance(this); return SwiftParseUtils.getLines(getLine(cp, start, end, offset)); diff --git a/src/main/java/com/prowidesoftware/swift/model/field/Field29S.java b/src/main/java/com/prowidesoftware/swift/model/field/Field29S.java index ddb15d9be..e5f7f3466 100644 --- a/src/main/java/com/prowidesoftware/swift/model/field/Field29S.java +++ b/src/main/java/com/prowidesoftware/swift/model/field/Field29S.java @@ -190,11 +190,8 @@ public String getValueDisplay(int component, Locale locale) { // default format (as is) return getComponent(1); } - if (component == 2) { - // default format (as is) - return getComponent(2); - } - return null; + // default format (as is) + return getComponent(2); } /** @@ -440,7 +437,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field29S(f)); } diff --git a/src/main/java/com/prowidesoftware/swift/model/field/Field31J.java b/src/main/java/com/prowidesoftware/swift/model/field/Field31J.java index ce1c04410..1fb6409a9 100644 --- a/src/main/java/com/prowidesoftware/swift/model/field/Field31J.java +++ b/src/main/java/com/prowidesoftware/swift/model/field/Field31J.java @@ -176,17 +176,14 @@ public String getValue() { */ @Override public String getValueDisplay(int component, Locale locale) { - if (component < 1 || component > 1) { + if (component != 1) { throw new IllegalArgumentException("invalid component number " + component + " for field 31J"); } - if (component == 1) { - // date: [YY]YYMMDD - java.text.DateFormat f = - java.text.DateFormat.getDateInstance(java.text.DateFormat.DEFAULT, notNull(locale)); - java.util.Calendar cal = getComponent1AsCalendar(); - if (cal != null) { - return f.format(cal.getTime()); - } + // date: [YY]YYMMDD + java.text.DateFormat f = java.text.DateFormat.getDateInstance(java.text.DateFormat.DEFAULT, notNull(locale)); + java.util.Calendar cal = getComponent1AsCalendar(); + if (cal != null) { + return f.format(cal.getTime()); } return null; } @@ -376,6 +373,7 @@ public Field31J setDate(java.util.Calendar component1) { * * @return the list of converted components (a Calendar object or null) */ + @Override public List dates() { return DateResolver.dates(this); } @@ -452,7 +450,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field31J(f)); } diff --git a/src/main/java/com/prowidesoftware/swift/model/field/Field31K.java b/src/main/java/com/prowidesoftware/swift/model/field/Field31K.java index adfc5fa22..d20ecc58b 100644 --- a/src/main/java/com/prowidesoftware/swift/model/field/Field31K.java +++ b/src/main/java/com/prowidesoftware/swift/model/field/Field31K.java @@ -176,17 +176,14 @@ public String getValue() { */ @Override public String getValueDisplay(int component, Locale locale) { - if (component < 1 || component > 1) { + if (component != 1) { throw new IllegalArgumentException("invalid component number " + component + " for field 31K"); } - if (component == 1) { - // date: [YY]YYMMDD - java.text.DateFormat f = - java.text.DateFormat.getDateInstance(java.text.DateFormat.DEFAULT, notNull(locale)); - java.util.Calendar cal = getComponent1AsCalendar(); - if (cal != null) { - return f.format(cal.getTime()); - } + // date: [YY]YYMMDD + java.text.DateFormat f = java.text.DateFormat.getDateInstance(java.text.DateFormat.DEFAULT, notNull(locale)); + java.util.Calendar cal = getComponent1AsCalendar(); + if (cal != null) { + return f.format(cal.getTime()); } return null; } @@ -376,6 +373,7 @@ public Field31K setDate(java.util.Calendar component1) { * * @return the list of converted components (a Calendar object or null) */ + @Override public List dates() { return DateResolver.dates(this); } @@ -452,7 +450,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field31K(f)); } diff --git a/src/main/java/com/prowidesoftware/swift/model/field/Field31M.java b/src/main/java/com/prowidesoftware/swift/model/field/Field31M.java index d5c682113..f9d254f23 100644 --- a/src/main/java/com/prowidesoftware/swift/model/field/Field31M.java +++ b/src/main/java/com/prowidesoftware/swift/model/field/Field31M.java @@ -176,17 +176,14 @@ public String getValue() { */ @Override public String getValueDisplay(int component, Locale locale) { - if (component < 1 || component > 1) { + if (component != 1) { throw new IllegalArgumentException("invalid component number " + component + " for field 31M"); } - if (component == 1) { - // date: [YY]YYMMDD - java.text.DateFormat f = - java.text.DateFormat.getDateInstance(java.text.DateFormat.DEFAULT, notNull(locale)); - java.util.Calendar cal = getComponent1AsCalendar(); - if (cal != null) { - return f.format(cal.getTime()); - } + // date: [YY]YYMMDD + java.text.DateFormat f = java.text.DateFormat.getDateInstance(java.text.DateFormat.DEFAULT, notNull(locale)); + java.util.Calendar cal = getComponent1AsCalendar(); + if (cal != null) { + return f.format(cal.getTime()); } return null; } @@ -376,6 +373,7 @@ public Field31M setDate(java.util.Calendar component1) { * * @return the list of converted components (a Calendar object or null) */ + @Override public List dates() { return DateResolver.dates(this); } @@ -452,7 +450,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field31M(f)); } diff --git a/src/main/java/com/prowidesoftware/swift/model/field/Field31T.java b/src/main/java/com/prowidesoftware/swift/model/field/Field31T.java index 25f3ce3ce..1c7bc1a60 100644 --- a/src/main/java/com/prowidesoftware/swift/model/field/Field31T.java +++ b/src/main/java/com/prowidesoftware/swift/model/field/Field31T.java @@ -176,17 +176,14 @@ public String getValue() { */ @Override public String getValueDisplay(int component, Locale locale) { - if (component < 1 || component > 1) { + if (component != 1) { throw new IllegalArgumentException("invalid component number " + component + " for field 31T"); } - if (component == 1) { - // date: [YY]YYMMDD - java.text.DateFormat f = - java.text.DateFormat.getDateInstance(java.text.DateFormat.DEFAULT, notNull(locale)); - java.util.Calendar cal = getComponent1AsCalendar(); - if (cal != null) { - return f.format(cal.getTime()); - } + // date: [YY]YYMMDD + java.text.DateFormat f = java.text.DateFormat.getDateInstance(java.text.DateFormat.DEFAULT, notNull(locale)); + java.util.Calendar cal = getComponent1AsCalendar(); + if (cal != null) { + return f.format(cal.getTime()); } return null; } @@ -376,6 +373,7 @@ public Field31T setDate(java.util.Calendar component1) { * * @return the list of converted components (a Calendar object or null) */ + @Override public List dates() { return DateResolver.dates(this); } @@ -452,7 +450,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field31T(f)); } diff --git a/src/main/java/com/prowidesoftware/swift/model/field/Field34D.java b/src/main/java/com/prowidesoftware/swift/model/field/Field34D.java index 09d9e1b94..5bedacd93 100644 --- a/src/main/java/com/prowidesoftware/swift/model/field/Field34D.java +++ b/src/main/java/com/prowidesoftware/swift/model/field/Field34D.java @@ -191,14 +191,12 @@ public String getValueDisplay(int component, Locale locale) { // default format (as is) return getComponent(1); } - if (component == 2) { - // amount, rate - java.text.NumberFormat f = java.text.NumberFormat.getNumberInstance(notNull(locale)); - f.setMaximumFractionDigits(13); - BigDecimal n = getComponent2AsBigDecimal(); - if (n != null) { - return f.format(n); - } + // amount, rate + java.text.NumberFormat f = java.text.NumberFormat.getNumberInstance(notNull(locale)); + f.setMaximumFractionDigits(13); + BigDecimal n = getComponent2AsBigDecimal(); + if (n != null) { + return f.format(n); } return null; } @@ -392,24 +390,6 @@ public Field34D setComponent2(String component2) { return this; } - /** - * Set the component2 from a BigDecimal object. - *
- * Parses the BigDecimal into a SWIFT amount with truncated zero decimals and mandatory decimal separator. - *

- * @since 9.2.7 - * - * @param component2 the BigDecimal with the Amount content to set - * @return the field object to enable build pattern - */ - public Field34D setComponent2(java.math.BigDecimal component2) { - setComponent(2, SwiftFormatUtils.getBigDecimal(component2)); - return this; - } /** * Alternative method setter for field's Amount (component 2) as as Number * @@ -417,7 +397,6 @@ public Field34D setComponent2(java.math.BigDecimal component2) { * * @param component2 the Number with the Amount content to set * @return the field object to enable build pattern - * @see #setAmount(java.math.BigDecimal) */ public Field34D setComponent2(java.lang.Number component2) { @@ -449,19 +428,6 @@ public Field34D setAmount(String component2) { return setComponent2(component2); } - /** - * Set the Amount (component 2) from a BigDecimal object. - * - * @see #setComponent2(java.math.BigDecimal) - * - * @param component2 BigDecimal with the Amount content to set - * @return the field object to enable build pattern - * @since 9.2.7 - */ - public Field34D setAmount(java.math.BigDecimal component2) { - return setComponent2(component2); - } - /** * Alternative method setter for field's Amount (component 2) as as Number * @@ -469,7 +435,6 @@ public Field34D setAmount(java.math.BigDecimal component2) { * * @param component2 the Number with the Amount content to set * @return the field object to enable build pattern - * @see #setAmount(java.math.BigDecimal) */ public Field34D setAmount(java.lang.Number component2) { return setComponent2(component2); @@ -491,6 +456,7 @@ public List amounts() { * @return the first amount as BigDecimal value. Can be null * @see AmountResolver#amount(Field) */ + @Override public BigDecimal amount() { return AmountResolver.amount(this); } @@ -558,7 +524,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field34D(f)); } diff --git a/src/main/java/com/prowidesoftware/swift/model/field/Field34K.java b/src/main/java/com/prowidesoftware/swift/model/field/Field34K.java index 9532e65bb..97f6b58c2 100644 --- a/src/main/java/com/prowidesoftware/swift/model/field/Field34K.java +++ b/src/main/java/com/prowidesoftware/swift/model/field/Field34K.java @@ -191,14 +191,12 @@ public String getValueDisplay(int component, Locale locale) { // default format (as is) return getComponent(1); } - if (component == 2) { - // amount, rate - java.text.NumberFormat f = java.text.NumberFormat.getNumberInstance(notNull(locale)); - f.setMaximumFractionDigits(13); - BigDecimal n = getComponent2AsBigDecimal(); - if (n != null) { - return f.format(n); - } + // amount, rate + java.text.NumberFormat f = java.text.NumberFormat.getNumberInstance(notNull(locale)); + f.setMaximumFractionDigits(13); + BigDecimal n = getComponent2AsBigDecimal(); + if (n != null) { + return f.format(n); } return null; } @@ -392,24 +390,6 @@ public Field34K setComponent2(String component2) { return this; } - /** - * Set the component2 from a BigDecimal object. - *
- * Parses the BigDecimal into a SWIFT amount with truncated zero decimals and mandatory decimal separator. - * - * @since 9.2.7 - * - * @param component2 the BigDecimal with the Amount content to set - * @return the field object to enable build pattern - */ - public Field34K setComponent2(java.math.BigDecimal component2) { - setComponent(2, SwiftFormatUtils.getBigDecimal(component2)); - return this; - } /** * Alternative method setter for field's Amount (component 2) as as Number * @@ -417,7 +397,6 @@ public Field34K setComponent2(java.math.BigDecimal component2) { * * @param component2 the Number with the Amount content to set * @return the field object to enable build pattern - * @see #setAmount(java.math.BigDecimal) */ public Field34K setComponent2(java.lang.Number component2) { @@ -449,19 +428,6 @@ public Field34K setAmount(String component2) { return setComponent2(component2); } - /** - * Set the Amount (component 2) from a BigDecimal object. - * - * @see #setComponent2(java.math.BigDecimal) - * - * @param component2 BigDecimal with the Amount content to set - * @return the field object to enable build pattern - * @since 9.2.7 - */ - public Field34K setAmount(java.math.BigDecimal component2) { - return setComponent2(component2); - } - /** * Alternative method setter for field's Amount (component 2) as as Number * @@ -469,7 +435,6 @@ public Field34K setAmount(java.math.BigDecimal component2) { * * @param component2 the Number with the Amount content to set * @return the field object to enable build pattern - * @see #setAmount(java.math.BigDecimal) */ public Field34K setAmount(java.lang.Number component2) { return setComponent2(component2); @@ -491,6 +456,7 @@ public List amounts() { * @return the first amount as BigDecimal value. Can be null * @see AmountResolver#amount(Field) */ + @Override public BigDecimal amount() { return AmountResolver.amount(this); } @@ -558,7 +524,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field34K(f)); } diff --git a/src/main/java/com/prowidesoftware/swift/model/field/Field34L.java b/src/main/java/com/prowidesoftware/swift/model/field/Field34L.java index d42f6ace6..73ffdf2d7 100644 --- a/src/main/java/com/prowidesoftware/swift/model/field/Field34L.java +++ b/src/main/java/com/prowidesoftware/swift/model/field/Field34L.java @@ -191,14 +191,12 @@ public String getValueDisplay(int component, Locale locale) { // default format (as is) return getComponent(1); } - if (component == 2) { - // amount, rate - java.text.NumberFormat f = java.text.NumberFormat.getNumberInstance(notNull(locale)); - f.setMaximumFractionDigits(13); - BigDecimal n = getComponent2AsBigDecimal(); - if (n != null) { - return f.format(n); - } + // amount, rate + java.text.NumberFormat f = java.text.NumberFormat.getNumberInstance(notNull(locale)); + f.setMaximumFractionDigits(13); + BigDecimal n = getComponent2AsBigDecimal(); + if (n != null) { + return f.format(n); } return null; } @@ -392,24 +390,6 @@ public Field34L setComponent2(String component2) { return this; } - /** - * Set the component2 from a BigDecimal object. - *
- * Parses the BigDecimal into a SWIFT amount with truncated zero decimals and mandatory decimal separator. - *
    - *
  • Example: 1234.00 -> 1234,
  • - *
  • Example: 1234 -> 1234,
  • - *
  • Example: 1234.56 -> 1234,56
  • - *
- * @since 9.2.7 - * - * @param component2 the BigDecimal with the Amount content to set - * @return the field object to enable build pattern - */ - public Field34L setComponent2(java.math.BigDecimal component2) { - setComponent(2, SwiftFormatUtils.getBigDecimal(component2)); - return this; - } /** * Alternative method setter for field's Amount (component 2) as as Number * @@ -417,7 +397,6 @@ public Field34L setComponent2(java.math.BigDecimal component2) { * * @param component2 the Number with the Amount content to set * @return the field object to enable build pattern - * @see #setAmount(java.math.BigDecimal) */ public Field34L setComponent2(java.lang.Number component2) { @@ -449,19 +428,6 @@ public Field34L setAmount(String component2) { return setComponent2(component2); } - /** - * Set the Amount (component 2) from a BigDecimal object. - * - * @see #setComponent2(java.math.BigDecimal) - * - * @param component2 BigDecimal with the Amount content to set - * @return the field object to enable build pattern - * @since 9.2.7 - */ - public Field34L setAmount(java.math.BigDecimal component2) { - return setComponent2(component2); - } - /** * Alternative method setter for field's Amount (component 2) as as Number * @@ -469,7 +435,6 @@ public Field34L setAmount(java.math.BigDecimal component2) { * * @param component2 the Number with the Amount content to set * @return the field object to enable build pattern - * @see #setAmount(java.math.BigDecimal) */ public Field34L setAmount(java.lang.Number component2) { return setComponent2(component2); @@ -491,6 +456,7 @@ public List amounts() { * @return the first amount as BigDecimal value. Can be null * @see AmountResolver#amount(Field) */ + @Override public BigDecimal amount() { return AmountResolver.amount(this); } @@ -558,7 +524,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field34L(f)); } diff --git a/src/main/java/com/prowidesoftware/swift/model/field/Field34M.java b/src/main/java/com/prowidesoftware/swift/model/field/Field34M.java index dbe754b53..1deca7060 100644 --- a/src/main/java/com/prowidesoftware/swift/model/field/Field34M.java +++ b/src/main/java/com/prowidesoftware/swift/model/field/Field34M.java @@ -191,14 +191,12 @@ public String getValueDisplay(int component, Locale locale) { // default format (as is) return getComponent(1); } - if (component == 2) { - // amount, rate - java.text.NumberFormat f = java.text.NumberFormat.getNumberInstance(notNull(locale)); - f.setMaximumFractionDigits(13); - BigDecimal n = getComponent2AsBigDecimal(); - if (n != null) { - return f.format(n); - } + // amount, rate + java.text.NumberFormat f = java.text.NumberFormat.getNumberInstance(notNull(locale)); + f.setMaximumFractionDigits(13); + BigDecimal n = getComponent2AsBigDecimal(); + if (n != null) { + return f.format(n); } return null; } @@ -392,24 +390,6 @@ public Field34M setComponent2(String component2) { return this; } - /** - * Set the component2 from a BigDecimal object. - *
- * Parses the BigDecimal into a SWIFT amount with truncated zero decimals and mandatory decimal separator. - *
    - *
  • Example: 1234.00 -> 1234,
  • - *
  • Example: 1234 -> 1234,
  • - *
  • Example: 1234.56 -> 1234,56
  • - *
- * @since 9.2.7 - * - * @param component2 the BigDecimal with the Amount content to set - * @return the field object to enable build pattern - */ - public Field34M setComponent2(java.math.BigDecimal component2) { - setComponent(2, SwiftFormatUtils.getBigDecimal(component2)); - return this; - } /** * Alternative method setter for field's Amount (component 2) as as Number * @@ -417,7 +397,6 @@ public Field34M setComponent2(java.math.BigDecimal component2) { * * @param component2 the Number with the Amount content to set * @return the field object to enable build pattern - * @see #setAmount(java.math.BigDecimal) */ public Field34M setComponent2(java.lang.Number component2) { @@ -449,19 +428,6 @@ public Field34M setAmount(String component2) { return setComponent2(component2); } - /** - * Set the Amount (component 2) from a BigDecimal object. - * - * @see #setComponent2(java.math.BigDecimal) - * - * @param component2 BigDecimal with the Amount content to set - * @return the field object to enable build pattern - * @since 9.2.7 - */ - public Field34M setAmount(java.math.BigDecimal component2) { - return setComponent2(component2); - } - /** * Alternative method setter for field's Amount (component 2) as as Number * @@ -469,7 +435,6 @@ public Field34M setAmount(java.math.BigDecimal component2) { * * @param component2 the Number with the Amount content to set * @return the field object to enable build pattern - * @see #setAmount(java.math.BigDecimal) */ public Field34M setAmount(java.lang.Number component2) { return setComponent2(component2); @@ -491,6 +456,7 @@ public List amounts() { * @return the first amount as BigDecimal value. Can be null * @see AmountResolver#amount(Field) */ + @Override public BigDecimal amount() { return AmountResolver.amount(this); } @@ -558,7 +524,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field34M(f)); } diff --git a/src/main/java/com/prowidesoftware/swift/model/field/Field34S.java b/src/main/java/com/prowidesoftware/swift/model/field/Field34S.java index 6bdbb6c0d..90a084e17 100644 --- a/src/main/java/com/prowidesoftware/swift/model/field/Field34S.java +++ b/src/main/java/com/prowidesoftware/swift/model/field/Field34S.java @@ -19,17 +19,14 @@ import com.google.gson.JsonParser; import com.prowidesoftware.deprecation.ProwideDeprecated; import com.prowidesoftware.deprecation.TargetYear; -import com.prowidesoftware.swift.model.*; +import com.prowidesoftware.swift.model.SwiftMessage; +import com.prowidesoftware.swift.model.SwiftTagListBlock; import com.prowidesoftware.swift.model.Tag; import com.prowidesoftware.swift.utils.SwiftFormatUtils; import java.io.Serializable; import java.math.BigDecimal; import java.math.BigInteger; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Locale; -import java.util.Map; +import java.util.*; import org.apache.commons.lang3.StringUtils; /** @@ -191,14 +188,12 @@ public String getValueDisplay(int component, Locale locale) { // default format (as is) return getComponent(1); } - if (component == 2) { - // amount, rate - java.text.NumberFormat f = java.text.NumberFormat.getNumberInstance(notNull(locale)); - f.setMaximumFractionDigits(13); - BigDecimal n = getComponent2AsBigDecimal(); - if (n != null) { - return f.format(n); - } + // amount, rate + java.text.NumberFormat f = java.text.NumberFormat.getNumberInstance(notNull(locale)); + f.setMaximumFractionDigits(13); + BigDecimal n = getComponent2AsBigDecimal(); + if (n != null) { + return f.format(n); } return null; } @@ -392,24 +387,6 @@ public Field34S setComponent2(String component2) { return this; } - /** - * Set the component2 from a BigDecimal object. - *
- * Parses the BigDecimal into a SWIFT amount with truncated zero decimals and mandatory decimal separator. - *
    - *
  • Example: 1234.00 -> 1234,
  • - *
  • Example: 1234 -> 1234,
  • - *
  • Example: 1234.56 -> 1234,56
  • - *
- * @since 9.2.7 - * - * @param component2 the BigDecimal with the Amount content to set - * @return the field object to enable build pattern - */ - public Field34S setComponent2(java.math.BigDecimal component2) { - setComponent(2, SwiftFormatUtils.getBigDecimal(component2)); - return this; - } /** * Alternative method setter for field's Amount (component 2) as as Number * @@ -417,7 +394,6 @@ public Field34S setComponent2(java.math.BigDecimal component2) { * * @param component2 the Number with the Amount content to set * @return the field object to enable build pattern - * @see #setAmount(java.math.BigDecimal) */ public Field34S setComponent2(java.lang.Number component2) { @@ -449,19 +425,6 @@ public Field34S setAmount(String component2) { return setComponent2(component2); } - /** - * Set the Amount (component 2) from a BigDecimal object. - * - * @see #setComponent2(java.math.BigDecimal) - * - * @param component2 BigDecimal with the Amount content to set - * @return the field object to enable build pattern - * @since 9.2.7 - */ - public Field34S setAmount(java.math.BigDecimal component2) { - return setComponent2(component2); - } - /** * Alternative method setter for field's Amount (component 2) as as Number * @@ -469,7 +432,6 @@ public Field34S setAmount(java.math.BigDecimal component2) { * * @param component2 the Number with the Amount content to set * @return the field object to enable build pattern - * @see #setAmount(java.math.BigDecimal) */ public Field34S setAmount(java.lang.Number component2) { return setComponent2(component2); @@ -491,6 +453,7 @@ public List amounts() { * @return the first amount as BigDecimal value. Can be null * @see AmountResolver#amount(Field) */ + @Override public BigDecimal amount() { return AmountResolver.amount(this); } @@ -558,7 +521,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field34S(f)); } diff --git a/src/main/java/com/prowidesoftware/swift/model/field/Field34T.java b/src/main/java/com/prowidesoftware/swift/model/field/Field34T.java index d2097605f..ca505aa08 100644 --- a/src/main/java/com/prowidesoftware/swift/model/field/Field34T.java +++ b/src/main/java/com/prowidesoftware/swift/model/field/Field34T.java @@ -191,14 +191,12 @@ public String getValueDisplay(int component, Locale locale) { // default format (as is) return getComponent(1); } - if (component == 2) { - // amount, rate - java.text.NumberFormat f = java.text.NumberFormat.getNumberInstance(notNull(locale)); - f.setMaximumFractionDigits(13); - BigDecimal n = getComponent2AsBigDecimal(); - if (n != null) { - return f.format(n); - } + // amount, rate + java.text.NumberFormat f = java.text.NumberFormat.getNumberInstance(notNull(locale)); + f.setMaximumFractionDigits(13); + BigDecimal n = getComponent2AsBigDecimal(); + if (n != null) { + return f.format(n); } return null; } @@ -392,24 +390,6 @@ public Field34T setComponent2(String component2) { return this; } - /** - * Set the component2 from a BigDecimal object. - *
- * Parses the BigDecimal into a SWIFT amount with truncated zero decimals and mandatory decimal separator. - *
    - *
  • Example: 1234.00 -> 1234,
  • - *
  • Example: 1234 -> 1234,
  • - *
  • Example: 1234.56 -> 1234,56
  • - *
- * @since 9.2.7 - * - * @param component2 the BigDecimal with the Amount content to set - * @return the field object to enable build pattern - */ - public Field34T setComponent2(java.math.BigDecimal component2) { - setComponent(2, SwiftFormatUtils.getBigDecimal(component2)); - return this; - } /** * Alternative method setter for field's Amount (component 2) as as Number * @@ -417,7 +397,6 @@ public Field34T setComponent2(java.math.BigDecimal component2) { * * @param component2 the Number with the Amount content to set * @return the field object to enable build pattern - * @see #setAmount(java.math.BigDecimal) */ public Field34T setComponent2(java.lang.Number component2) { @@ -449,19 +428,6 @@ public Field34T setAmount(String component2) { return setComponent2(component2); } - /** - * Set the Amount (component 2) from a BigDecimal object. - * - * @see #setComponent2(java.math.BigDecimal) - * - * @param component2 BigDecimal with the Amount content to set - * @return the field object to enable build pattern - * @since 9.2.7 - */ - public Field34T setAmount(java.math.BigDecimal component2) { - return setComponent2(component2); - } - /** * Alternative method setter for field's Amount (component 2) as as Number * @@ -469,7 +435,6 @@ public Field34T setAmount(java.math.BigDecimal component2) { * * @param component2 the Number with the Amount content to set * @return the field object to enable build pattern - * @see #setAmount(java.math.BigDecimal) */ public Field34T setAmount(java.lang.Number component2) { return setComponent2(component2); @@ -491,6 +456,7 @@ public List amounts() { * @return the first amount as BigDecimal value. Can be null * @see AmountResolver#amount(Field) */ + @Override public BigDecimal amount() { return AmountResolver.amount(this); } @@ -558,7 +524,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field34T(f)); } diff --git a/src/main/java/com/prowidesoftware/swift/model/field/Field34U.java b/src/main/java/com/prowidesoftware/swift/model/field/Field34U.java index bc3660599..d9ae38b68 100644 --- a/src/main/java/com/prowidesoftware/swift/model/field/Field34U.java +++ b/src/main/java/com/prowidesoftware/swift/model/field/Field34U.java @@ -191,14 +191,12 @@ public String getValueDisplay(int component, Locale locale) { // default format (as is) return getComponent(1); } - if (component == 2) { - // amount, rate - java.text.NumberFormat f = java.text.NumberFormat.getNumberInstance(notNull(locale)); - f.setMaximumFractionDigits(13); - BigDecimal n = getComponent2AsBigDecimal(); - if (n != null) { - return f.format(n); - } + // amount, rate + java.text.NumberFormat f = java.text.NumberFormat.getNumberInstance(notNull(locale)); + f.setMaximumFractionDigits(13); + BigDecimal n = getComponent2AsBigDecimal(); + if (n != null) { + return f.format(n); } return null; } @@ -392,24 +390,6 @@ public Field34U setComponent2(String component2) { return this; } - /** - * Set the component2 from a BigDecimal object. - *
- * Parses the BigDecimal into a SWIFT amount with truncated zero decimals and mandatory decimal separator. - *
    - *
  • Example: 1234.00 -> 1234,
  • - *
  • Example: 1234 -> 1234,
  • - *
  • Example: 1234.56 -> 1234,56
  • - *
- * @since 9.2.7 - * - * @param component2 the BigDecimal with the Amount content to set - * @return the field object to enable build pattern - */ - public Field34U setComponent2(java.math.BigDecimal component2) { - setComponent(2, SwiftFormatUtils.getBigDecimal(component2)); - return this; - } /** * Alternative method setter for field's Amount (component 2) as as Number * @@ -417,7 +397,6 @@ public Field34U setComponent2(java.math.BigDecimal component2) { * * @param component2 the Number with the Amount content to set * @return the field object to enable build pattern - * @see #setAmount(java.math.BigDecimal) */ public Field34U setComponent2(java.lang.Number component2) { @@ -449,19 +428,6 @@ public Field34U setAmount(String component2) { return setComponent2(component2); } - /** - * Set the Amount (component 2) from a BigDecimal object. - * - * @see #setComponent2(java.math.BigDecimal) - * - * @param component2 BigDecimal with the Amount content to set - * @return the field object to enable build pattern - * @since 9.2.7 - */ - public Field34U setAmount(java.math.BigDecimal component2) { - return setComponent2(component2); - } - /** * Alternative method setter for field's Amount (component 2) as as Number * @@ -469,7 +435,6 @@ public Field34U setAmount(java.math.BigDecimal component2) { * * @param component2 the Number with the Amount content to set * @return the field object to enable build pattern - * @see #setAmount(java.math.BigDecimal) */ public Field34U setAmount(java.lang.Number component2) { return setComponent2(component2); @@ -491,6 +456,7 @@ public List amounts() { * @return the first amount as BigDecimal value. Can be null * @see AmountResolver#amount(Field) */ + @Override public BigDecimal amount() { return AmountResolver.amount(this); } @@ -558,7 +524,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field34U(f)); } diff --git a/src/main/java/com/prowidesoftware/swift/model/field/Field34V.java b/src/main/java/com/prowidesoftware/swift/model/field/Field34V.java index ad9558948..89b0b9b52 100644 --- a/src/main/java/com/prowidesoftware/swift/model/field/Field34V.java +++ b/src/main/java/com/prowidesoftware/swift/model/field/Field34V.java @@ -191,14 +191,12 @@ public String getValueDisplay(int component, Locale locale) { // default format (as is) return getComponent(1); } - if (component == 2) { - // amount, rate - java.text.NumberFormat f = java.text.NumberFormat.getNumberInstance(notNull(locale)); - f.setMaximumFractionDigits(13); - BigDecimal n = getComponent2AsBigDecimal(); - if (n != null) { - return f.format(n); - } + // amount, rate + java.text.NumberFormat f = java.text.NumberFormat.getNumberInstance(notNull(locale)); + f.setMaximumFractionDigits(13); + BigDecimal n = getComponent2AsBigDecimal(); + if (n != null) { + return f.format(n); } return null; } @@ -392,24 +390,6 @@ public Field34V setComponent2(String component2) { return this; } - /** - * Set the component2 from a BigDecimal object. - *
- * Parses the BigDecimal into a SWIFT amount with truncated zero decimals and mandatory decimal separator. - *
    - *
  • Example: 1234.00 -> 1234,
  • - *
  • Example: 1234 -> 1234,
  • - *
  • Example: 1234.56 -> 1234,56
  • - *
- * @since 9.2.7 - * - * @param component2 the BigDecimal with the Amount content to set - * @return the field object to enable build pattern - */ - public Field34V setComponent2(java.math.BigDecimal component2) { - setComponent(2, SwiftFormatUtils.getBigDecimal(component2)); - return this; - } /** * Alternative method setter for field's Amount (component 2) as as Number * @@ -417,7 +397,6 @@ public Field34V setComponent2(java.math.BigDecimal component2) { * * @param component2 the Number with the Amount content to set * @return the field object to enable build pattern - * @see #setAmount(java.math.BigDecimal) */ public Field34V setComponent2(java.lang.Number component2) { @@ -449,19 +428,6 @@ public Field34V setAmount(String component2) { return setComponent2(component2); } - /** - * Set the Amount (component 2) from a BigDecimal object. - * - * @see #setComponent2(java.math.BigDecimal) - * - * @param component2 BigDecimal with the Amount content to set - * @return the field object to enable build pattern - * @since 9.2.7 - */ - public Field34V setAmount(java.math.BigDecimal component2) { - return setComponent2(component2); - } - /** * Alternative method setter for field's Amount (component 2) as as Number * @@ -469,7 +435,6 @@ public Field34V setAmount(java.math.BigDecimal component2) { * * @param component2 the Number with the Amount content to set * @return the field object to enable build pattern - * @see #setAmount(java.math.BigDecimal) */ public Field34V setAmount(java.lang.Number component2) { return setComponent2(component2); @@ -491,6 +456,7 @@ public List amounts() { * @return the first amount as BigDecimal value. Can be null * @see AmountResolver#amount(Field) */ + @Override public BigDecimal amount() { return AmountResolver.amount(this); } @@ -558,7 +524,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field34V(f)); } diff --git a/src/main/java/com/prowidesoftware/swift/model/field/Field34W.java b/src/main/java/com/prowidesoftware/swift/model/field/Field34W.java index 8d4552140..e20957644 100644 --- a/src/main/java/com/prowidesoftware/swift/model/field/Field34W.java +++ b/src/main/java/com/prowidesoftware/swift/model/field/Field34W.java @@ -191,14 +191,12 @@ public String getValueDisplay(int component, Locale locale) { // default format (as is) return getComponent(1); } - if (component == 2) { - // amount, rate - java.text.NumberFormat f = java.text.NumberFormat.getNumberInstance(notNull(locale)); - f.setMaximumFractionDigits(13); - BigDecimal n = getComponent2AsBigDecimal(); - if (n != null) { - return f.format(n); - } + // amount, rate + java.text.NumberFormat f = java.text.NumberFormat.getNumberInstance(notNull(locale)); + f.setMaximumFractionDigits(13); + BigDecimal n = getComponent2AsBigDecimal(); + if (n != null) { + return f.format(n); } return null; } @@ -392,24 +390,6 @@ public Field34W setComponent2(String component2) { return this; } - /** - * Set the component2 from a BigDecimal object. - *
- * Parses the BigDecimal into a SWIFT amount with truncated zero decimals and mandatory decimal separator. - *
    - *
  • Example: 1234.00 -> 1234,
  • - *
  • Example: 1234 -> 1234,
  • - *
  • Example: 1234.56 -> 1234,56
  • - *
- * @since 9.2.7 - * - * @param component2 the BigDecimal with the Amount content to set - * @return the field object to enable build pattern - */ - public Field34W setComponent2(java.math.BigDecimal component2) { - setComponent(2, SwiftFormatUtils.getBigDecimal(component2)); - return this; - } /** * Alternative method setter for field's Amount (component 2) as as Number * @@ -417,7 +397,6 @@ public Field34W setComponent2(java.math.BigDecimal component2) { * * @param component2 the Number with the Amount content to set * @return the field object to enable build pattern - * @see #setAmount(java.math.BigDecimal) */ public Field34W setComponent2(java.lang.Number component2) { @@ -449,19 +428,6 @@ public Field34W setAmount(String component2) { return setComponent2(component2); } - /** - * Set the Amount (component 2) from a BigDecimal object. - * - * @see #setComponent2(java.math.BigDecimal) - * - * @param component2 BigDecimal with the Amount content to set - * @return the field object to enable build pattern - * @since 9.2.7 - */ - public Field34W setAmount(java.math.BigDecimal component2) { - return setComponent2(component2); - } - /** * Alternative method setter for field's Amount (component 2) as as Number * @@ -469,7 +435,6 @@ public Field34W setAmount(java.math.BigDecimal component2) { * * @param component2 the Number with the Amount content to set * @return the field object to enable build pattern - * @see #setAmount(java.math.BigDecimal) */ public Field34W setAmount(java.lang.Number component2) { return setComponent2(component2); @@ -491,6 +456,7 @@ public List amounts() { * @return the first amount as BigDecimal value. Can be null * @see AmountResolver#amount(Field) */ + @Override public BigDecimal amount() { return AmountResolver.amount(this); } @@ -558,7 +524,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field34W(f)); } diff --git a/src/main/java/com/prowidesoftware/swift/model/field/Field34X.java b/src/main/java/com/prowidesoftware/swift/model/field/Field34X.java index 2377a124b..f6e5c9184 100644 --- a/src/main/java/com/prowidesoftware/swift/model/field/Field34X.java +++ b/src/main/java/com/prowidesoftware/swift/model/field/Field34X.java @@ -191,14 +191,12 @@ public String getValueDisplay(int component, Locale locale) { // default format (as is) return getComponent(1); } - if (component == 2) { - // amount, rate - java.text.NumberFormat f = java.text.NumberFormat.getNumberInstance(notNull(locale)); - f.setMaximumFractionDigits(13); - BigDecimal n = getComponent2AsBigDecimal(); - if (n != null) { - return f.format(n); - } + // amount, rate + java.text.NumberFormat f = java.text.NumberFormat.getNumberInstance(notNull(locale)); + f.setMaximumFractionDigits(13); + BigDecimal n = getComponent2AsBigDecimal(); + if (n != null) { + return f.format(n); } return null; } @@ -392,24 +390,6 @@ public Field34X setComponent2(String component2) { return this; } - /** - * Set the component2 from a BigDecimal object. - *
- * Parses the BigDecimal into a SWIFT amount with truncated zero decimals and mandatory decimal separator. - *
    - *
  • Example: 1234.00 -> 1234,
  • - *
  • Example: 1234 -> 1234,
  • - *
  • Example: 1234.56 -> 1234,56
  • - *
- * @since 9.2.7 - * - * @param component2 the BigDecimal with the Amount content to set - * @return the field object to enable build pattern - */ - public Field34X setComponent2(java.math.BigDecimal component2) { - setComponent(2, SwiftFormatUtils.getBigDecimal(component2)); - return this; - } /** * Alternative method setter for field's Amount (component 2) as as Number * @@ -417,7 +397,6 @@ public Field34X setComponent2(java.math.BigDecimal component2) { * * @param component2 the Number with the Amount content to set * @return the field object to enable build pattern - * @see #setAmount(java.math.BigDecimal) */ public Field34X setComponent2(java.lang.Number component2) { @@ -449,19 +428,6 @@ public Field34X setAmount(String component2) { return setComponent2(component2); } - /** - * Set the Amount (component 2) from a BigDecimal object. - * - * @see #setComponent2(java.math.BigDecimal) - * - * @param component2 BigDecimal with the Amount content to set - * @return the field object to enable build pattern - * @since 9.2.7 - */ - public Field34X setAmount(java.math.BigDecimal component2) { - return setComponent2(component2); - } - /** * Alternative method setter for field's Amount (component 2) as as Number * @@ -469,7 +435,6 @@ public Field34X setAmount(java.math.BigDecimal component2) { * * @param component2 the Number with the Amount content to set * @return the field object to enable build pattern - * @see #setAmount(java.math.BigDecimal) */ public Field34X setAmount(java.lang.Number component2) { return setComponent2(component2); @@ -491,6 +456,7 @@ public List amounts() { * @return the first amount as BigDecimal value. Can be null * @see AmountResolver#amount(Field) */ + @Override public BigDecimal amount() { return AmountResolver.amount(this); } @@ -558,7 +524,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field34X(f)); } diff --git a/src/main/java/com/prowidesoftware/swift/model/field/Field47E.java b/src/main/java/com/prowidesoftware/swift/model/field/Field47E.java index 5eb585b43..7ce7c670c 100644 --- a/src/main/java/com/prowidesoftware/swift/model/field/Field47E.java +++ b/src/main/java/com/prowidesoftware/swift/model/field/Field47E.java @@ -174,14 +174,11 @@ public String getValue() { */ @Override public String getValueDisplay(int component, Locale locale) { - if (component < 1 || component > 1) { + if (component != 1) { throw new IllegalArgumentException("invalid component number " + component + " for field 47E"); } - if (component == 1) { - // default format (as is) - return getComponent(1); - } - return null; + // default format (as is) + return getComponent(1); } /** @@ -387,7 +384,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field47E(f)); } @@ -403,6 +400,7 @@ public static List getAll(final SwiftTagListBlock block) { * @return line content or null if not present or if line number is above the expected * @since 7.7 */ + @Override public String getLine(int line) { return getLine(line, 0); } @@ -416,6 +414,7 @@ public String getLine(int line) { * @return line content or null if not present or if line number is above the expected * @since 7.7 */ + @Override public String getLine(int line, int offset) { Field47E cp = newInstance(this); return getLine(cp, line, null, offset); @@ -428,6 +427,7 @@ public String getLine(int line, int offset) { * @return lines content or empty list if field's value is empty * @since 7.7 */ + @Override public List getLines() { return SwiftParseUtils.getLines(getValue()); } @@ -440,6 +440,7 @@ public List getLines() { * @return found lines or empty list if lines are not present or the offset is invalid * @since 7.7 */ + @Override public List getLines(int offset) { Field47E cp = newInstance(this); return SwiftParseUtils.getLines(getLine(cp, null, null, offset)); @@ -454,6 +455,7 @@ public List getLines(int offset) { * @return found lines or empty list if value is empty * @since 7.7 */ + @Override public List getLinesBetween(int start, int end) { return getLinesBetween(start, end, 0); } @@ -468,6 +470,7 @@ public List getLinesBetween(int start, int end) { * @return found lines or empty list if lines are not present or the offset is invalid * @since 7.7 */ + @Override public List getLinesBetween(int start, int end, int offset) { Field47E cp = newInstance(this); return SwiftParseUtils.getLines(getLine(cp, start, end, offset)); diff --git a/src/main/java/com/prowidesoftware/swift/model/field/Field49D.java b/src/main/java/com/prowidesoftware/swift/model/field/Field49D.java index aa5e2ca30..c68aaf9d5 100644 --- a/src/main/java/com/prowidesoftware/swift/model/field/Field49D.java +++ b/src/main/java/com/prowidesoftware/swift/model/field/Field49D.java @@ -174,14 +174,11 @@ public String getValue() { */ @Override public String getValueDisplay(int component, Locale locale) { - if (component < 1 || component > 1) { + if (component != 1) { throw new IllegalArgumentException("invalid component number " + component + " for field 49D"); } - if (component == 1) { - // default format (as is) - return getComponent(1); - } - return null; + // default format (as is) + return getComponent(1); } /** @@ -387,7 +384,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field49D(f)); } diff --git a/src/main/java/com/prowidesoftware/swift/model/field/Field49F.java b/src/main/java/com/prowidesoftware/swift/model/field/Field49F.java index c9da10c13..2d2fe52cd 100644 --- a/src/main/java/com/prowidesoftware/swift/model/field/Field49F.java +++ b/src/main/java/com/prowidesoftware/swift/model/field/Field49F.java @@ -174,14 +174,11 @@ public String getValue() { */ @Override public String getValueDisplay(int component, Locale locale) { - if (component < 1 || component > 1) { + if (component != 1) { throw new IllegalArgumentException("invalid component number " + component + " for field 49F"); } - if (component == 1) { - // default format (as is) - return getComponent(1); - } - return null; + // default format (as is) + return getComponent(1); } /** @@ -387,7 +384,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field49F(f)); } @@ -403,6 +400,7 @@ public static List getAll(final SwiftTagListBlock block) { * @return line content or null if not present or if line number is above the expected * @since 7.7 */ + @Override public String getLine(int line) { return getLine(line, 0); } @@ -416,6 +414,7 @@ public String getLine(int line) { * @return line content or null if not present or if line number is above the expected * @since 7.7 */ + @Override public String getLine(int line, int offset) { Field49F cp = newInstance(this); return getLine(cp, line, null, offset); @@ -428,6 +427,7 @@ public String getLine(int line, int offset) { * @return lines content or empty list if field's value is empty * @since 7.7 */ + @Override public List getLines() { return SwiftParseUtils.getLines(getValue()); } @@ -440,6 +440,7 @@ public List getLines() { * @return found lines or empty list if lines are not present or the offset is invalid * @since 7.7 */ + @Override public List getLines(int offset) { Field49F cp = newInstance(this); return SwiftParseUtils.getLines(getLine(cp, null, null, offset)); @@ -454,6 +455,7 @@ public List getLines(int offset) { * @return found lines or empty list if value is empty * @since 7.7 */ + @Override public List getLinesBetween(int start, int end) { return getLinesBetween(start, end, 0); } @@ -468,6 +470,7 @@ public List getLinesBetween(int start, int end) { * @return found lines or empty list if lines are not present or the offset is invalid * @since 7.7 */ + @Override public List getLinesBetween(int start, int end, int offset) { Field49F cp = newInstance(this); return SwiftParseUtils.getLines(getLine(cp, start, end, offset)); diff --git a/src/main/java/com/prowidesoftware/swift/model/field/Field49J.java b/src/main/java/com/prowidesoftware/swift/model/field/Field49J.java index 4ab57daee..aebb753aa 100644 --- a/src/main/java/com/prowidesoftware/swift/model/field/Field49J.java +++ b/src/main/java/com/prowidesoftware/swift/model/field/Field49J.java @@ -174,14 +174,12 @@ public String getValue() { */ @Override public String getValueDisplay(int component, Locale locale) { - if (component < 1 || component > 1) { + if (component != 1) { throw new IllegalArgumentException("invalid component number " + component + " for field 49J"); } - if (component == 1) { - // default format (as is) - return getComponent(1); - } - return null; + + // default format (as is) + return getComponent(1); } /** @@ -387,7 +385,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field49J(f)); } @@ -403,6 +401,7 @@ public static List getAll(final SwiftTagListBlock block) { * @return line content or null if not present or if line number is above the expected * @since 7.7 */ + @Override public String getLine(int line) { return getLine(line, 0); } @@ -416,6 +415,7 @@ public String getLine(int line) { * @return line content or null if not present or if line number is above the expected * @since 7.7 */ + @Override public String getLine(int line, int offset) { Field49J cp = newInstance(this); return getLine(cp, line, null, offset); @@ -428,6 +428,7 @@ public String getLine(int line, int offset) { * @return lines content or empty list if field's value is empty * @since 7.7 */ + @Override public List getLines() { return SwiftParseUtils.getLines(getValue()); } @@ -440,6 +441,7 @@ public List getLines() { * @return found lines or empty list if lines are not present or the offset is invalid * @since 7.7 */ + @Override public List getLines(int offset) { Field49J cp = newInstance(this); return SwiftParseUtils.getLines(getLine(cp, null, null, offset)); @@ -454,6 +456,7 @@ public List getLines(int offset) { * @return found lines or empty list if value is empty * @since 7.7 */ + @Override public List getLinesBetween(int start, int end) { return getLinesBetween(start, end, 0); } @@ -468,6 +471,7 @@ public List getLinesBetween(int start, int end) { * @return found lines or empty list if lines are not present or the offset is invalid * @since 7.7 */ + @Override public List getLinesBetween(int start, int end, int offset) { Field49J cp = newInstance(this); return SwiftParseUtils.getLines(getLine(cp, start, end, offset)); diff --git a/src/main/java/com/prowidesoftware/swift/model/field/Field49K.java b/src/main/java/com/prowidesoftware/swift/model/field/Field49K.java index 6d5e46fa8..ce1bd9fc3 100644 --- a/src/main/java/com/prowidesoftware/swift/model/field/Field49K.java +++ b/src/main/java/com/prowidesoftware/swift/model/field/Field49K.java @@ -174,14 +174,11 @@ public String getValue() { */ @Override public String getValueDisplay(int component, Locale locale) { - if (component < 1 || component > 1) { + if (component != 1) { throw new IllegalArgumentException("invalid component number " + component + " for field 49K"); } - if (component == 1) { - // default format (as is) - return getComponent(1); - } - return null; + // default format (as is) + return getComponent(1); } /** @@ -387,7 +384,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field49K(f)); } @@ -403,6 +400,7 @@ public static List getAll(final SwiftTagListBlock block) { * @return line content or null if not present or if line number is above the expected * @since 7.7 */ + @Override public String getLine(int line) { return getLine(line, 0); } @@ -416,6 +414,7 @@ public String getLine(int line) { * @return line content or null if not present or if line number is above the expected * @since 7.7 */ + @Override public String getLine(int line, int offset) { Field49K cp = newInstance(this); return getLine(cp, line, null, offset); @@ -428,6 +427,7 @@ public String getLine(int line, int offset) { * @return lines content or empty list if field's value is empty * @since 7.7 */ + @Override public List getLines() { return SwiftParseUtils.getLines(getValue()); } @@ -440,6 +440,7 @@ public List getLines() { * @return found lines or empty list if lines are not present or the offset is invalid * @since 7.7 */ + @Override public List getLines(int offset) { Field49K cp = newInstance(this); return SwiftParseUtils.getLines(getLine(cp, null, null, offset)); @@ -454,6 +455,7 @@ public List getLines(int offset) { * @return found lines or empty list if value is empty * @since 7.7 */ + @Override public List getLinesBetween(int start, int end) { return getLinesBetween(start, end, 0); } @@ -468,6 +470,7 @@ public List getLinesBetween(int start, int end) { * @return found lines or empty list if lines are not present or the offset is invalid * @since 7.7 */ + @Override public List getLinesBetween(int start, int end, int offset) { Field49K cp = newInstance(this); return SwiftParseUtils.getLines(getLine(cp, start, end, offset)); diff --git a/src/main/java/com/prowidesoftware/swift/model/field/Field49L.java b/src/main/java/com/prowidesoftware/swift/model/field/Field49L.java index 14b1b569c..ea6415d47 100644 --- a/src/main/java/com/prowidesoftware/swift/model/field/Field49L.java +++ b/src/main/java/com/prowidesoftware/swift/model/field/Field49L.java @@ -174,14 +174,11 @@ public String getValue() { */ @Override public String getValueDisplay(int component, Locale locale) { - if (component < 1 || component > 1) { + if (component != 1) { throw new IllegalArgumentException("invalid component number " + component + " for field 49L"); } - if (component == 1) { - // default format (as is) - return getComponent(1); - } - return null; + // default format (as is) + return getComponent(1); } /** @@ -387,7 +384,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field49L(f)); } @@ -403,6 +400,7 @@ public static List getAll(final SwiftTagListBlock block) { * @return line content or null if not present or if line number is above the expected * @since 7.7 */ + @Override public String getLine(int line) { return getLine(line, 0); } @@ -416,6 +414,7 @@ public String getLine(int line) { * @return line content or null if not present or if line number is above the expected * @since 7.7 */ + @Override public String getLine(int line, int offset) { Field49L cp = newInstance(this); return getLine(cp, line, null, offset); @@ -428,6 +427,7 @@ public String getLine(int line, int offset) { * @return lines content or empty list if field's value is empty * @since 7.7 */ + @Override public List getLines() { return SwiftParseUtils.getLines(getValue()); } @@ -440,6 +440,7 @@ public List getLines() { * @return found lines or empty list if lines are not present or the offset is invalid * @since 7.7 */ + @Override public List getLines(int offset) { Field49L cp = newInstance(this); return SwiftParseUtils.getLines(getLine(cp, null, null, offset)); @@ -454,6 +455,7 @@ public List getLines(int offset) { * @return found lines or empty list if value is empty * @since 7.7 */ + @Override public List getLinesBetween(int start, int end) { return getLinesBetween(start, end, 0); } @@ -468,6 +470,7 @@ public List getLinesBetween(int start, int end) { * @return found lines or empty list if lines are not present or the offset is invalid * @since 7.7 */ + @Override public List getLinesBetween(int start, int end, int offset) { Field49L cp = newInstance(this); return SwiftParseUtils.getLines(getLine(cp, start, end, offset)); diff --git a/src/main/java/com/prowidesoftware/swift/model/field/Field49Z.java b/src/main/java/com/prowidesoftware/swift/model/field/Field49Z.java index 5f8b59480..750d4f100 100644 --- a/src/main/java/com/prowidesoftware/swift/model/field/Field49Z.java +++ b/src/main/java/com/prowidesoftware/swift/model/field/Field49Z.java @@ -174,14 +174,11 @@ public String getValue() { */ @Override public String getValueDisplay(int component, Locale locale) { - if (component < 1 || component > 1) { + if (component != 1) { throw new IllegalArgumentException("invalid component number " + component + " for field 49Z"); } - if (component == 1) { - // default format (as is) - return getComponent(1); - } - return null; + // default format (as is) + return getComponent(1); } /** @@ -387,7 +384,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field49Z(f)); } @@ -403,6 +400,7 @@ public static List getAll(final SwiftTagListBlock block) { * @return line content or null if not present or if line number is above the expected * @since 7.7 */ + @Override public String getLine(int line) { return getLine(line, 0); } @@ -416,6 +414,7 @@ public String getLine(int line) { * @return line content or null if not present or if line number is above the expected * @since 7.7 */ + @Override public String getLine(int line, int offset) { Field49Z cp = newInstance(this); return getLine(cp, line, null, offset); @@ -428,6 +427,7 @@ public String getLine(int line, int offset) { * @return lines content or empty list if field's value is empty * @since 7.7 */ + @Override public List getLines() { return SwiftParseUtils.getLines(getValue()); } @@ -440,6 +440,7 @@ public List getLines() { * @return found lines or empty list if lines are not present or the offset is invalid * @since 7.7 */ + @Override public List getLines(int offset) { Field49Z cp = newInstance(this); return SwiftParseUtils.getLines(getLine(cp, null, null, offset)); @@ -454,6 +455,7 @@ public List getLines(int offset) { * @return found lines or empty list if value is empty * @since 7.7 */ + @Override public List getLinesBetween(int start, int end) { return getLinesBetween(start, end, 0); } @@ -468,6 +470,7 @@ public List getLinesBetween(int start, int end) { * @return found lines or empty list if lines are not present or the offset is invalid * @since 7.7 */ + @Override public List getLinesBetween(int start, int end, int offset) { Field49Z cp = newInstance(this); return SwiftParseUtils.getLines(getLine(cp, start, end, offset)); diff --git a/src/main/java/com/prowidesoftware/swift/model/field/Field71E.java b/src/main/java/com/prowidesoftware/swift/model/field/Field71E.java index cd3388ab9..d79fc3106 100644 --- a/src/main/java/com/prowidesoftware/swift/model/field/Field71E.java +++ b/src/main/java/com/prowidesoftware/swift/model/field/Field71E.java @@ -232,7 +232,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field71E(f)); } @@ -248,6 +248,7 @@ public static List getAll(final SwiftTagListBlock block) { * @return line content or null if not present or if line number is above the expected * @since 7.7 */ + @Override public String getLine(int line) { return getLine(line, 0); } @@ -261,6 +262,7 @@ public String getLine(int line) { * @return line content or null if not present or if line number is above the expected * @since 7.7 */ + @Override public String getLine(int line, int offset) { Field71E cp = newInstance(this); return getLine(cp, line, null, offset); @@ -273,6 +275,7 @@ public String getLine(int line, int offset) { * @return lines content or empty list if field's value is empty * @since 7.7 */ + @Override public List getLines() { return SwiftParseUtils.getLines(getValue()); } @@ -285,6 +288,7 @@ public List getLines() { * @return found lines or empty list if lines are not present or the offset is invalid * @since 7.7 */ + @Override public List getLines(int offset) { Field71E cp = newInstance(this); return SwiftParseUtils.getLines(getLine(cp, null, null, offset)); @@ -299,6 +303,7 @@ public List getLines(int offset) { * @return found lines or empty list if value is empty * @since 7.7 */ + @Override public List getLinesBetween(int start, int end) { return getLinesBetween(start, end, 0); } @@ -313,6 +318,7 @@ public List getLinesBetween(int start, int end) { * @return found lines or empty list if lines are not present or the offset is invalid * @since 7.7 */ + @Override public List getLinesBetween(int start, int end, int offset) { Field71E cp = newInstance(this); return SwiftParseUtils.getLines(getLine(cp, start, end, offset)); diff --git a/src/main/java/com/prowidesoftware/swift/model/field/Field78B.java b/src/main/java/com/prowidesoftware/swift/model/field/Field78B.java index 42924c35c..0b6808bb1 100644 --- a/src/main/java/com/prowidesoftware/swift/model/field/Field78B.java +++ b/src/main/java/com/prowidesoftware/swift/model/field/Field78B.java @@ -174,14 +174,11 @@ public String getValue() { */ @Override public String getValueDisplay(int component, Locale locale) { - if (component < 1 || component > 1) { + if (component != 1) { throw new IllegalArgumentException("invalid component number " + component + " for field 78B"); } - if (component == 1) { - // default format (as is) - return getComponent(1); - } - return null; + // default format (as is) + return getComponent(1); } /** @@ -387,7 +384,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field78B(f)); } @@ -403,6 +400,7 @@ public static List getAll(final SwiftTagListBlock block) { * @return line content or null if not present or if line number is above the expected * @since 7.7 */ + @Override public String getLine(int line) { return getLine(line, 0); } @@ -416,6 +414,7 @@ public String getLine(int line) { * @return line content or null if not present or if line number is above the expected * @since 7.7 */ + @Override public String getLine(int line, int offset) { Field78B cp = newInstance(this); return getLine(cp, line, null, offset); @@ -428,6 +427,7 @@ public String getLine(int line, int offset) { * @return lines content or empty list if field's value is empty * @since 7.7 */ + @Override public List getLines() { return SwiftParseUtils.getLines(getValue()); } @@ -440,6 +440,7 @@ public List getLines() { * @return found lines or empty list if lines are not present or the offset is invalid * @since 7.7 */ + @Override public List getLines(int offset) { Field78B cp = newInstance(this); return SwiftParseUtils.getLines(getLine(cp, null, null, offset)); @@ -454,6 +455,7 @@ public List getLines(int offset) { * @return found lines or empty list if value is empty * @since 7.7 */ + @Override public List getLinesBetween(int start, int end) { return getLinesBetween(start, end, 0); } @@ -468,6 +470,7 @@ public List getLinesBetween(int start, int end) { * @return found lines or empty list if lines are not present or the offset is invalid * @since 7.7 */ + @Override public List getLinesBetween(int start, int end, int offset) { Field78B cp = newInstance(this); return SwiftParseUtils.getLines(getLine(cp, start, end, offset)); diff --git a/src/main/java/com/prowidesoftware/swift/model/field/NarrativeFragment.java b/src/main/java/com/prowidesoftware/swift/model/field/NarrativeFragment.java index 82ea95ffd..e0e1530a1 100644 --- a/src/main/java/com/prowidesoftware/swift/model/field/NarrativeFragment.java +++ b/src/main/java/com/prowidesoftware/swift/model/field/NarrativeFragment.java @@ -81,6 +81,7 @@ public int getLineLength() { return lineLength; } + @Override public String toString() { return text; } diff --git a/src/main/java/com/prowidesoftware/swift/model/field/OptionCPartyField.java b/src/main/java/com/prowidesoftware/swift/model/field/OptionCPartyField.java index bd98f3782..4df95038d 100644 --- a/src/main/java/com/prowidesoftware/swift/model/field/OptionCPartyField.java +++ b/src/main/java/com/prowidesoftware/swift/model/field/OptionCPartyField.java @@ -101,7 +101,7 @@ public String getValue() { */ @Override public String getValueDisplay(int component, Locale locale) { - if (component < 1 || component > 1) { + if (component != 1) { throw new IllegalArgumentException("invalid component number " + component + " for field " + getName()); } // default format (as is) diff --git a/src/main/java/com/prowidesoftware/swift/model/field/OptionJPartyField.java b/src/main/java/com/prowidesoftware/swift/model/field/OptionJPartyField.java index dc76fe9ee..11f333c35 100644 --- a/src/main/java/com/prowidesoftware/swift/model/field/OptionJPartyField.java +++ b/src/main/java/com/prowidesoftware/swift/model/field/OptionJPartyField.java @@ -101,7 +101,7 @@ public String getValue() { */ @Override public String getValueDisplay(int component, Locale locale) { - if (component < 1 || component > 1) { + if (component != 1) { throw new IllegalArgumentException("invalid component number " + component + " for field " + getName()); } // default format (as is) diff --git a/src/main/java/com/prowidesoftware/swift/model/field/OptionLPartyField.java b/src/main/java/com/prowidesoftware/swift/model/field/OptionLPartyField.java index 5670afe48..f347c34a5 100644 --- a/src/main/java/com/prowidesoftware/swift/model/field/OptionLPartyField.java +++ b/src/main/java/com/prowidesoftware/swift/model/field/OptionLPartyField.java @@ -100,7 +100,7 @@ public String getValue() { */ @Override public String getValueDisplay(int component, Locale locale) { - if (component < 1 || component > 1) { + if (component != 1) { throw new IllegalArgumentException("invalid component number " + component + " for field " + getName()); } // default format (as is) diff --git a/src/main/java/com/prowidesoftware/swift/utils/ConstraintUtils.java b/src/main/java/com/prowidesoftware/swift/utils/ConstraintUtils.java new file mode 100644 index 000000000..16a9d3561 --- /dev/null +++ b/src/main/java/com/prowidesoftware/swift/utils/ConstraintUtils.java @@ -0,0 +1,485 @@ +package com.prowidesoftware.swift.utils; + +import java.io.IOException; +import java.io.StringWriter; +import java.io.UncheckedIOException; +import java.io.Writer; +import java.security.InvalidParameterException; +import java.util.*; +import java.util.stream.Stream; +import org.apache.commons.lang3.Validate; + +/** + * Utility class for escaping EcmaScript and Java control characters. + * This class provides methods for translating characters into their + * escaped equivalents, specifically for EcmaScript. + */ +public class ConstraintUtils { + + // Map for Java control characters that need to be escaped + private static final Map JAVA_CTRL_CHARS_ESCAPE; + + static { + final Map initialMap = new HashMap<>(); + initialMap.put("\b", "\\b"); + initialMap.put("\n", "\\n"); + initialMap.put("\t", "\\t"); + initialMap.put("\f", "\\f"); + initialMap.put("\r", "\\r"); + JAVA_CTRL_CHARS_ESCAPE = Collections.unmodifiableMap(initialMap); + } + + /** + * Escapes the given input string using EcmaScript rules. + * The method escapes control characters and symbols such as single quotes, double quotes, + * backslashes, and forward slashes, making the string safe for use in EcmaScript contexts. + * + * @param input the string to escape, may be null + * @return the escaped string or null if the input is null + */ + public static String escapeEcmaScript(final String input) { + if (input == null) { + return null; + } + + Map escapeEcmaScriptMap = new HashMap<>(); + escapeEcmaScriptMap.put("'", "\\'"); + escapeEcmaScriptMap.put("\"", "\\\""); + escapeEcmaScriptMap.put("\\", "\\\\"); + escapeEcmaScriptMap.put("/", "\\/"); + + CharSequenceTranslator translator = new AggregateTranslator( + new LookupTranslator(Collections.unmodifiableMap(escapeEcmaScriptMap)), + new LookupTranslator(JAVA_CTRL_CHARS_ESCAPE), + JavaUnicodeEscaper.outsideOf(32, 0x7f)); + + return translator.translate(input); + } +} + +abstract class CharSequenceTranslator { + + /** + * Array containing the hexadecimal alphabet. + */ + static final char[] HEX_DIGITS = {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F'}; + + /** + * Returns an upper case hexadecimal {@code String} for the given + * character. + * + * @param codePoint The code point to convert. + * @return An upper case hexadecimal {@code String} + */ + static String hex(final int codePoint) { + return Integer.toHexString(codePoint).toUpperCase(Locale.ENGLISH); + } + + /** + * Helper for non-Writer usage. + * @param input CharSequence to be translated + * @return String output of translation + */ + final String translate(final CharSequence input) { + if (input == null) { + return null; + } + try { + final StringWriter writer = new StringWriter(input.length() * 2); + translate(input, writer); + return writer.toString(); + } catch (final IOException ioe) { + // this should never ever happen while writing to a StringWriter + throw new UncheckedIOException(ioe); + } + } + + /** + * Translate a set of code points, represented by an int index into a CharSequence, + * into another set of code points. The number of code points consumed must be returned, + * and the only IOExceptions thrown must be from interacting with the Writer so that + * the top level API may reliably ignore StringWriter IOExceptions. + * + * @param input CharSequence that is being translated + * @param index int representing the current point of translation + * @param writer Writer to translate the text to + * @return int count of code points consumed + * @throws IOException if and only if the Writer produces an IOException + */ + abstract int translate(CharSequence input, int index, Writer writer) throws IOException; + + /** + * Translate an input onto a Writer. This is intentionally final as its algorithm is + * tightly coupled with the abstract method of this class. + * + * @param input CharSequence that is being translated + * @param writer Writer to translate the text to + * @throws IOException if and only if the Writer produces an IOException + */ + final void translate(final CharSequence input, final Writer writer) throws IOException { + Validate.isTrue(writer != null, "The Writer must not be null"); + if (input == null) { + return; + } + int pos = 0; + final int len = input.length(); + while (pos < len) { + final int consumed = translate(input, pos, writer); + if (consumed == 0) { + // inlined implementation of Character.toChars(Character.codePointAt(input, pos)) + // avoids allocating temp char arrays and duplicate checks + final char c1 = input.charAt(pos); + writer.write(c1); + pos++; + if (Character.isHighSurrogate(c1) && pos < len) { + final char c2 = input.charAt(pos); + if (Character.isLowSurrogate(c2)) { + writer.write(c2); + pos++; + } + } + continue; + } + // contract with translators is that they have to understand code points + // and they just took care of a surrogate pair + for (int pt = 0; pt < consumed; pt++) { + pos += Character.charCount(Character.codePointAt(input, pos)); + } + } + } + + /** + * Helper method to create a merger of this translator with another set of + * translators. Useful in customizing the standard functionality. + * + * @param translators CharSequenceTranslator array of translators to merge with this one + * @return CharSequenceTranslator merging this translator with the others + */ + final CharSequenceTranslator with(final CharSequenceTranslator... translators) { + final CharSequenceTranslator[] newArray = new CharSequenceTranslator[translators.length + 1]; + newArray[0] = this; + System.arraycopy(translators, 0, newArray, 1, translators.length); + return new AggregateTranslator(newArray); + } +} + +class AggregateTranslator extends CharSequenceTranslator { + + /** + * Translator list. + */ + private final List translators = new ArrayList<>(); + + /** + * Specify the translators to be used at creation time. + * + * @param translators CharSequenceTranslator array to aggregate + */ + AggregateTranslator(final CharSequenceTranslator... translators) { + if (translators != null) { + Stream.of(translators).filter(Objects::nonNull).forEach(this.translators::add); + } + } + + /** + * The first translator to consume code points from the input is the 'winner'. + * Execution stops with the number of consumed code points being returned. + * {@inheritDoc} + */ + @Override + int translate(final CharSequence input, final int index, final Writer writer) throws IOException { + for (final CharSequenceTranslator translator : translators) { + final int consumed = translator.translate(input, index, writer); + if (consumed != 0) { + return consumed; + } + } + return 0; + } +} + +class LookupTranslator extends CharSequenceTranslator { + + /** The mapping to be used in translation. */ + private final Map lookupMap; + + /** The first character of each key in the lookupMap. */ + private final BitSet prefixSet; + + /** The length of the shortest key in the lookupMap. */ + private final int shortest; + + /** The length of the longest key in the lookupMap. */ + private final int longest; + + /** + * Constructs the lookup table to be used in translation + * + * Note that, as of Lang 3.1 (the origin of this code), the key to the lookup + * table is converted to a java.lang.String. This is because we need the key + * to support hashCode and equals(Object), allowing it to be the key for a + * HashMap. See LANG-882. + * + * @param lookupMap Map<CharSequence, CharSequence> table of translator + * mappings + */ + LookupTranslator(final Map lookupMap) { + if (lookupMap == null) { + throw new InvalidParameterException("lookupMap cannot be null"); + } + this.lookupMap = new HashMap<>(); + this.prefixSet = new BitSet(); + int currentShortest = Integer.MAX_VALUE; + int currentLongest = 0; + + for (final Map.Entry pair : lookupMap.entrySet()) { + this.lookupMap.put(pair.getKey().toString(), pair.getValue().toString()); + this.prefixSet.set(pair.getKey().charAt(0)); + final int sz = pair.getKey().length(); + if (sz < currentShortest) { + currentShortest = sz; + } + if (sz > currentLongest) { + currentLongest = sz; + } + } + this.shortest = currentShortest; + this.longest = currentLongest; + } + + /** + * {@inheritDoc} + */ + @Override + int translate(final CharSequence input, final int index, final Writer writer) throws IOException { + // check if translation exists for the input at position index + if (prefixSet.get(input.charAt(index))) { + int max = longest; + if (index + longest > input.length()) { + max = input.length() - index; + } + // implement greedy algorithm by trying maximum match first + for (int i = max; i >= shortest; i--) { + final CharSequence subSeq = input.subSequence(index, index + i); + final String result = lookupMap.get(subSeq.toString()); + + if (result != null) { + writer.write(result); + return Character.codePointCount(subSeq, 0, subSeq.length()); + } + } + } + return 0; + } +} + +abstract class CodePointTranslator extends CharSequenceTranslator { + + @Override + final int translate(final CharSequence input, final int index, final Writer writer) throws IOException { + final int codePoint = Character.codePointAt(input, index); + final boolean consumed = translate(codePoint, writer); + return consumed ? 1 : 0; + } + + /** + * Translates the specified code point into another. + * + * @param codePoint int character input to translate + * @param writer Writer to optionally push the translated output to + * @return boolean as to whether translation occurred or not + * @throws IOException if and only if the Writer produces an IOException + */ + abstract boolean translate(int codePoint, Writer writer) throws IOException; +} + +class UnicodeEscaper extends CodePointTranslator { + + /** + * Constructs a {@code UnicodeEscaper} above the specified value (exclusive). + * + * @param codePoint above which to escape + * @return The newly created {@code UnicodeEscaper} instance + */ + static UnicodeEscaper above(final int codePoint) { + return outsideOf(0, codePoint); + } + /** + * Constructs a {@code UnicodeEscaper} below the specified value (exclusive). + * + * @param codePoint below which to escape + * @return The newly created {@code UnicodeEscaper} instance + */ + static UnicodeEscaper below(final int codePoint) { + return outsideOf(codePoint, Integer.MAX_VALUE); + } + /** + * Constructs a {@code UnicodeEscaper} between the specified values (inclusive). + * + * @param codePointLow above which to escape + * @param codePointHigh below which to escape + * @return The newly created {@code UnicodeEscaper} instance + */ + static UnicodeEscaper between(final int codePointLow, final int codePointHigh) { + return new UnicodeEscaper(codePointLow, codePointHigh, true); + } + + /** + * Constructs a {@code UnicodeEscaper} outside of the specified values (exclusive). + * + * @param codePointLow below which to escape + * @param codePointHigh above which to escape + * @return The newly created {@code UnicodeEscaper} instance + */ + static UnicodeEscaper outsideOf(final int codePointLow, final int codePointHigh) { + return new UnicodeEscaper(codePointLow, codePointHigh, false); + } + + /** The lowest code point boundary. */ + private final int below; + + /** The highest code point boundary. */ + private final int above; + + /** Whether to escape between the boundaries or outside them. */ + private final boolean between; + + /** + * Constructs a {@code UnicodeEscaper} for all characters. + */ + UnicodeEscaper() { + this(0, Integer.MAX_VALUE, true); + } + + /** + * Constructs a {@code UnicodeEscaper} for the specified range. This is + * the underlying method for the other constructors/builders. The {@code below} + * and {@code above} boundaries are inclusive when {@code between} is + * {@code true} and exclusive when it is {@code false}. + * + * @param below int value representing the lowest code point boundary + * @param above int value representing the highest code point boundary + * @param between whether to escape between the boundaries or outside them + */ + protected UnicodeEscaper(final int below, final int above, final boolean between) { + this.below = below; + this.above = above; + this.between = between; + } + + /** + * Converts the given code point to a hexadecimal string of the form {@code "\\uXXXX"}. + * + * @param codePoint + * a Unicode code point + * @return The hexadecimal string for the given code point + */ + protected String toUtf16Escape(final int codePoint) { + return "\\u" + hex(codePoint); + } + + /** + * {@inheritDoc} + */ + @Override + boolean translate(final int codePoint, final Writer writer) throws IOException { + if (between) { + if (codePoint < below || codePoint > above) { + return false; + } + } else if (codePoint >= below && codePoint <= above) { + return false; + } + + if (codePoint > 0xffff) { + writer.write(toUtf16Escape(codePoint)); + } else { + writer.write("\\u"); + writer.write(HEX_DIGITS[codePoint >> 12 & 15]); + writer.write(HEX_DIGITS[codePoint >> 8 & 15]); + writer.write(HEX_DIGITS[codePoint >> 4 & 15]); + writer.write(HEX_DIGITS[codePoint & 15]); + } + return true; + } +} + +class JavaUnicodeEscaper extends UnicodeEscaper { + + /** + * Constructs a {@code JavaUnicodeEscaper} above the specified value (exclusive). + * + * @param codePoint + * above which to escape + * @return The newly created {@code UnicodeEscaper} instance + */ + static JavaUnicodeEscaper above(final int codePoint) { + return outsideOf(0, codePoint); + } + + /** + * Constructs a {@code JavaUnicodeEscaper} below the specified value (exclusive). + * + * @param codePoint + * below which to escape + * @return The newly created {@code UnicodeEscaper} instance + */ + static JavaUnicodeEscaper below(final int codePoint) { + return outsideOf(codePoint, Integer.MAX_VALUE); + } + + /** + * Constructs a {@code JavaUnicodeEscaper} between the specified values (inclusive). + * + * @param codePointLow + * above which to escape + * @param codePointHigh + * below which to escape + * @return The newly created {@code UnicodeEscaper} instance + */ + static JavaUnicodeEscaper between(final int codePointLow, final int codePointHigh) { + return new JavaUnicodeEscaper(codePointLow, codePointHigh, true); + } + + /** + * Constructs a {@code JavaUnicodeEscaper} outside of the specified values (exclusive). + * + * @param codePointLow + * below which to escape + * @param codePointHigh + * above which to escape + * @return The newly created {@code UnicodeEscaper} instance + */ + static JavaUnicodeEscaper outsideOf(final int codePointLow, final int codePointHigh) { + return new JavaUnicodeEscaper(codePointLow, codePointHigh, false); + } + + /** + * Constructs a {@code JavaUnicodeEscaper} for the specified range. This is the underlying method for the + * other constructors/builders. The {@code below} and {@code above} boundaries are inclusive when + * {@code between} is {@code true} and exclusive when it is {@code false}. + * + * @param below + * int value representing the lowest code point boundary + * @param above + * int value representing the highest code point boundary + * @param between + * whether to escape between the boundaries or outside them + */ + JavaUnicodeEscaper(final int below, final int above, final boolean between) { + super(below, above, between); + } + + /** + * Converts the given code point to a hexadecimal string of the form {@code "\\uXXXX\\uXXXX"}. + * + * @param codePoint + * a Unicode code point + * @return The hexadecimal string for the given code point + */ + @Override + protected String toUtf16Escape(final int codePoint) { + final char[] surrogatePair = Character.toChars(codePoint); + return "\\u" + hex(surrogatePair[0]) + "\\u" + hex(surrogatePair[1]); + } +} diff --git a/src/main/java/com/prowidesoftware/swift/utils/IsoUtils.java b/src/main/java/com/prowidesoftware/swift/utils/IsoUtils.java index ff3d75f9d..5eaea97e5 100644 --- a/src/main/java/com/prowidesoftware/swift/utils/IsoUtils.java +++ b/src/main/java/com/prowidesoftware/swift/utils/IsoUtils.java @@ -56,7 +56,7 @@ public static IsoUtils getInstance() { } public Set getCurrencies() { - return currencies; + return Collections.unmodifiableSet(currencies); } public void setCurrencies(Set currencies) { @@ -64,7 +64,7 @@ public void setCurrencies(Set currencies) { } public Set getCountries() { - return countries; + return Collections.unmodifiableSet(countries); } public void setCountries(Set countries) { @@ -115,6 +115,20 @@ public void addCountry(final String countryCode) { countries.add(countryCode); } + /** + * Removes the given country code from the current list of codes. + * + * @param countryCode a two capital letters country code, for example: XK + * @throws IllegalArgumentException if the parameter code is null or not two uppercase letters + * @since 9.4.18 + */ + public void removeCountry(final String countryCode) { + Validate.isTrue( + countryCode != null && countryCode.length() == 2 && countryCode.matches("[A-Z]*"), + "The country code must be indicated with two uppercase letters"); + countries.remove(countryCode); + } + /** * Adds the given currency code to the current list of codes, verifying that it does not exist previously. * @@ -128,4 +142,18 @@ public void addCurrency(final String currencyCode) { "The currency code must by indicated with three uppercase letters"); currencies.add(currencyCode); } + + /** + * Removes the given currency code from the current list of codes. + * + * @param currencyCode a three capital letters currency code, for example: ARS + * @throws IllegalArgumentException if the parameter code is null or not three uppercase letters + * @since 9.4.18 + */ + public void removeCurrency(final String currencyCode) { + Validate.isTrue( + currencyCode != null && currencyCode.length() == 3 && currencyCode.matches("[A-Z]*"), + "The currency code must be indicated with three uppercase letters"); + currencies.remove(currencyCode); + } } diff --git a/src/test/java/com/prowidesoftware/issues/Issue95.java b/src/test/java/com/prowidesoftware/issues/Issue95.java index e8cf28f69..779b3ce33 100644 --- a/src/test/java/com/prowidesoftware/issues/Issue95.java +++ b/src/test/java/com/prowidesoftware/issues/Issue95.java @@ -13,7 +13,7 @@ public void testInheritance() { assertEquals("121212USD1234,FOO", f.getValue()); } - public class MyField32A extends Field32A { + public static class MyField32A extends Field32A { public MyField32A(String value) { super(value); diff --git a/src/test/java/com/prowidesoftware/issues/JapaneseCharactersTest.java b/src/test/java/com/prowidesoftware/issues/JapaneseCharactersTest.java index 5185b74d2..8f1879fe9 100644 --- a/src/test/java/com/prowidesoftware/issues/JapaneseCharactersTest.java +++ b/src/test/java/com/prowidesoftware/issues/JapaneseCharactersTest.java @@ -21,8 +21,8 @@ import com.prowidesoftware.swift.io.RJEReader; import com.prowidesoftware.swift.model.field.Field86; import com.prowidesoftware.swift.model.mt.mt9xx.MT940; -import com.prowidesoftware.swift.utils.Lib; import java.io.IOException; +import java.io.InputStream; import java.nio.charset.StandardCharsets; import org.junit.jupiter.api.Test; @@ -33,33 +33,40 @@ public class JapaneseCharactersTest { @Test public void testRJEFromFile() throws IOException { - RJEReader reader = - new RJEReader(this.getClass().getResourceAsStream("/sample_JPchar.txt"), StandardCharsets.UTF_8); - MT940 mt = (MT940) reader.nextMT(); - assertNotNull(mt); - Field86 field86 = mt.getField86().get(0); - // System.out.println(mt.message()); - assertEquals("゙アタイヘイヨウセンタ- AFEISEOHFIOSEIOIRT", field86.getComponent2()); + try (InputStream inputStream = JapaneseCharactersTest.class.getResourceAsStream("/sample_JPchar.txt")) { + RJEReader reader = new RJEReader(inputStream, StandardCharsets.UTF_8); + MT940 mt = (MT940) reader.nextMT(); + assertNotNull(mt); + Field86 field86 = mt.getField86().get(0); + // System.out.println(mt.message()); + assertEquals("゙アタイヘイヨウセンタ- AFEISEOHFIOSEIOIRT", field86.getComponent2()); + } } @Test public void testRJEFromFile2() throws IOException { - RJEReader reader = new RJEReader( - Lib.readStream(this.getClass().getResourceAsStream("/sample_JPchar.txt"), StandardCharsets.UTF_8)); - MT940 mt = (MT940) reader.nextMT(); - assertNotNull(mt); - Field86 field86 = mt.getField86().get(0); - // System.out.println(mt.message()); - assertEquals("゙アタイヘイヨウセンタ- AFEISEOHFIOSEIOIRT", field86.getComponent2()); + try (InputStream inputStream = JapaneseCharactersTest.class.getResourceAsStream("/sample_JPchar.txt")) { + RJEReader reader = new RJEReader(inputStream, StandardCharsets.UTF_8); + MT940 mt = (MT940) reader.nextMT(); + assertNotNull(mt); + Field86 field86 = mt.getField86().get(0); + // System.out.println(mt.message()); + assertEquals("゙アタイヘイヨウセンタ- AFEISEOHFIOSEIOIRT", field86.getComponent2()); + } } @Test public void testMTFromFile() throws IOException { - MT940 mt = new MT940(this.getClass().getResourceAsStream("/sample_JPchar.txt")); - assertNotNull(mt); - Field86 field86 = mt.getField86().get(0); - // System.out.println(mt.message()); - assertEquals("゙アタイヘイヨウセンタ- AFEISEOHFIOSEIOIRT", field86.getComponent2()); + try (InputStream resourceStream = JapaneseCharactersTest.class.getResourceAsStream("/sample_JPchar.txt")) { + if (resourceStream == null) { + throw new IOException("Resource not found: MT101.fin"); + } + MT940 mt = new MT940(resourceStream); + assertNotNull(mt); + Field86 field86 = mt.getField86().get(0); + // System.out.println(mt.message()); + assertEquals("゙アタイヘイヨウセンタ- AFEISEOHFIOSEIOIRT", field86.getComponent2()); + } } @Test diff --git a/src/test/java/com/prowidesoftware/swift/constraints/IbanValidatorTest.java b/src/test/java/com/prowidesoftware/swift/constraints/IbanValidatorTest.java new file mode 100644 index 000000000..861e51b31 --- /dev/null +++ b/src/test/java/com/prowidesoftware/swift/constraints/IbanValidatorTest.java @@ -0,0 +1,266 @@ +package com.prowidesoftware.swift.constraints; + +import static org.junit.jupiter.api.Assertions.*; + +import com.prowidesoftware.swift.model.IBAN; +import com.prowidesoftware.swift.model.IbanValidationResult; +import javax.validation.ClockProvider; +import javax.validation.ConstraintValidatorContext; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +public class IbanValidatorTest { + + private IbanValidator validator; + private TestConstraintValidatorContext context; + + @BeforeEach + public void setUp() { + validator = new IbanValidator(); + context = new TestConstraintValidatorContext(); + } + + @Test + public void testValidIban() { + String validIban = "ES9121000418450200051332"; // A valid IBAN + assertEquals(IbanValidationResult.OK, new IBAN(validIban).validate()); + assertTrue(validator.isValid(validIban, context)); + assertFalse(context.isViolationOccurred()); + } + + @Test + public void testIbanIsNull() { + String nullIban = null; + assertEquals(IbanValidationResult.IBAN_IS_NULL, new IBAN(nullIban).validate()); + assertTrue(validator.isValid(nullIban, context)); + assertFalse(context.isViolationOccurred()); + assertNull(context.getViolationMessage()); + } + + @Test + public void testIbanIsEmpty() { + String emptyIban = ""; + assertEquals(IbanValidationResult.IBAN_IS_EMPTY, new IBAN(emptyIban).validate()); + assertTrue(validator.isValid(emptyIban, context)); + assertFalse(context.isViolationOccurred()); + assertNull(context.getViolationMessage()); + } + + @Test + public void testMissingCountryCode() { + String missingCountryCodeIban = "1"; + assertEquals(IbanValidationResult.MISSING_COUNTRY_CODE, new IBAN(missingCountryCodeIban).validate()); + assertFalse(validator.isValid(missingCountryCodeIban, context)); + assertTrue(context.isViolationOccurred()); + assertEquals("The IBAN must start with the two letters ISO country code", context.getViolationMessage()); + } + + @Test + public void testInvalidCountryCodeCharset() { + String invalidCountryCodeIban = "es123456789"; // Lowercase 'es' instead of uppercase + assertEquals(IbanValidationResult.INVALID_COUNTRY_CODE_CHARSET, new IBAN(invalidCountryCodeIban).validate()); + assertFalse(validator.isValid(invalidCountryCodeIban, context)); + assertTrue(context.isViolationOccurred()); + assertEquals( + "The country code must contain upper case letters and es was found", context.getViolationMessage()); + } + + @Test + public void testInvalidCountry() { + String invalidCountryCodeIban = "ZZ123456789"; + assertEquals(IbanValidationResult.INVALID_COUNTRY_CODE, new IBAN(invalidCountryCodeIban).validate()); + assertFalse(validator.isValid(invalidCountryCodeIban, context)); + assertTrue(context.isViolationOccurred()); + assertEquals( + "The country code ZZ is not a valid ISO country code or the country code is not configured for IBAN validations", + context.getViolationMessage()); + } + + @Test + public void testMissingCheckDigits() { + String missingCheckDigitsIban = "ESX"; + assertEquals(IbanValidationResult.MISSING_CHECK_DIGITS, new IBAN(missingCheckDigitsIban).validate()); + assertFalse(validator.isValid(missingCheckDigitsIban, context)); + assertTrue(context.isViolationOccurred()); + assertEquals("Missing check digits", context.getViolationMessage()); + } + + @Test + public void testInvalidCheckDigitsFormat() { + String invalidCheckDigitsFormatIban = "ESAB123456789"; // Non-numeric check digits + assertEquals( + IbanValidationResult.INVALID_CHECK_DIGITS_FORMAT, new IBAN(invalidCheckDigitsFormatIban).validate()); + assertFalse(validator.isValid(invalidCheckDigitsFormatIban, context)); + assertTrue(context.isViolationOccurred()); + assertEquals("Expected 2 check digits and found AB", context.getViolationMessage()); + } + + @Test + public void testMissingBban() { + String missingBbanIban = "ES64"; // Country code + check digits, but no BBAN + assertEquals(IbanValidationResult.MISSING_BBAN, new IBAN(missingBbanIban).validate()); + assertFalse(validator.isValid(missingBbanIban, context)); + assertTrue(context.isViolationOccurred()); + assertEquals("Missing custom account number (BBAN)", context.getViolationMessage()); + } + + @Test + public void testBbanMaxLengthExceeded() { + String bbanMaxLengthExceededIban = "ES640123456789012345678901234567890"; // Exceeding max BBAN length + assertEquals(IbanValidationResult.BBAN_MAX_LENGTH, new IBAN(bbanMaxLengthExceededIban).validate()); + assertFalse(validator.isValid(bbanMaxLengthExceededIban, context)); + assertTrue(context.isViolationOccurred()); + assertEquals( + "The max length for the custom account number (BBAN) is 30 and found 31", + context.getViolationMessage()); + } + + @Test + public void testMissingBbanConfiguration() { + String missingBbanConfigIban = "FK64123456789"; + assertEquals(IbanValidationResult.MISSING_BBAN_CONFIGURATION, new IBAN(missingBbanConfigIban).validate()); + assertFalse(validator.isValid(missingBbanConfigIban, context)); + assertTrue(context.isViolationOccurred()); + assertEquals( + "Missing custom account number (BBAN) configuration for country FK", context.getViolationMessage()); + } + + @Test + public void testInvalidBbanLength() { + String invalidBbanLengthIban = "ES6401234"; // Invalid BBAN length + assertEquals(IbanValidationResult.BBAN_INVALID_LENGTH, new IBAN(invalidBbanLengthIban).validate()); + assertFalse(validator.isValid(invalidBbanLengthIban, context)); + assertTrue(context.isViolationOccurred()); + assertEquals( + "Expected a 20 characters length for the custom account number (BBAN) and found 5 in 01234", + context.getViolationMessage()); + } + + @Test + public void testBbanInvalidUpperCaseLetters() { + String invalidUpperCaseIban = "GI75nWBK000000007099453"; // BBAN with lowercase letters + assertEquals(IbanValidationResult.BBAN_INVALID_UPPER_CASE_LETTERS, new IBAN(invalidUpperCaseIban).validate()); + assertFalse(validator.isValid(invalidUpperCaseIban, context)); + assertTrue(context.isViolationOccurred()); + assertEquals("The BANK_CODE nWBK must contain only upper case letters", context.getViolationMessage()); + } + + @Test + public void testBbanInvalidDigitsOrLetters() { + String invalidDigitsOrLettersIban = "GI75NWBK00000000709t453"; // BBAN with invalid characters + assertEquals( + IbanValidationResult.BBAN_INVALID_DIGITS_OR_LETTERS, new IBAN(invalidDigitsOrLettersIban).validate()); + assertFalse(validator.isValid(invalidDigitsOrLettersIban, context)); + assertTrue(context.isViolationOccurred()); + assertEquals( + "The ACCOUNT_NUMBER 00000000709t453 must contain only digits or upper case letters", + context.getViolationMessage()); + } + + @Test + public void testBbanInvalidDigits() { + String invalidDigitsIban = "ES640abcd100041845024502"; // BBAN with letters where digits expected + assertEquals(IbanValidationResult.BBAN_INVALID_DIGITS, new IBAN(invalidDigitsIban).validate()); + assertFalse(validator.isValid(invalidDigitsIban, context)); + assertTrue(context.isViolationOccurred()); + assertEquals("The BANK_CODE 0abc must contain only digits", context.getViolationMessage()); + } + + @Disabled + @Test + public void testInvalidCharacters() { + // TODO: find a input that can produce this result + String invalidCharactersIban = "ES0X1234000000007094532"; + assertEquals(IbanValidationResult.INVALID_CHARACTERS, new IBAN(invalidCharactersIban).validate()); + assertFalse(validator.isValid(invalidCharactersIban, context)); + assertTrue(context.isViolationOccurred()); + assertEquals("Invalid character '@' found", context.getViolationMessage()); + } + + @Test + public void testInvalidCheckDigits() { + String invalidCheckDigitsIban = "ES0012345678901234567890"; // Invalid computed check digits + assertEquals(IbanValidationResult.IVALID_CHECK_DIGITS, new IBAN(invalidCheckDigitsIban).validate()); + assertFalse(validator.isValid(invalidCheckDigitsIban, context)); + assertTrue(context.isViolationOccurred()); + assertEquals("The expected computed check digit is 98 and 00 was found", context.getViolationMessage()); + } + + /** + * Simulated implementation of ConstraintValidatorContext for testing + */ + static class TestConstraintValidatorContext implements ConstraintValidatorContext { + + private boolean violationOccurred = false; + private String violationMessage = null; + + @Override + public void disableDefaultConstraintViolation() { + violationOccurred = true; + } + + @Override + public String getDefaultConstraintMessageTemplate() { + return null; + } + + @Override + public ClockProvider getClockProvider() { + return null; + } + + @Override + public ConstraintViolationBuilder buildConstraintViolationWithTemplate(String messageTemplate) { + this.violationMessage = messageTemplate; + return new TestConstraintViolationBuilder(); + } + + public boolean isViolationOccurred() { + return violationOccurred; + } + + public String getViolationMessage() { + return violationMessage; + } + + @Override + public T unwrap(Class type) { + return null; + } + + // Simulated ConstraintViolationBuilder implementation + class TestConstraintViolationBuilder implements ConstraintViolationBuilder { + @Override + public NodeBuilderDefinedContext addNode(String name) { + return null; + } + + @Override + public NodeBuilderCustomizableContext addPropertyNode(String name) { + return null; + } + + @Override + public LeafNodeBuilderCustomizableContext addBeanNode() { + return null; + } + + @Override + public ContainerElementNodeBuilderCustomizableContext addContainerElementNode( + String name, Class containerType, Integer index) { + return null; + } + + @Override + public NodeBuilderDefinedContext addParameterNode(int index) { + return null; + } + + @Override + public ConstraintValidatorContext addConstraintViolation() { + return TestConstraintValidatorContext.this; + } + } + } +} diff --git a/src/test/java/com/prowidesoftware/swift/io/RJEReaderTest.java b/src/test/java/com/prowidesoftware/swift/io/RJEReaderTest.java index 85bf77c06..b23518491 100644 --- a/src/test/java/com/prowidesoftware/swift/io/RJEReaderTest.java +++ b/src/test/java/com/prowidesoftware/swift/io/RJEReaderTest.java @@ -20,6 +20,7 @@ import com.prowidesoftware.swift.model.SwiftMessage; import com.prowidesoftware.swift.model.mt.AbstractMT; import java.io.IOException; +import java.io.InputStream; import java.nio.charset.StandardCharsets; import org.junit.jupiter.api.Test; @@ -32,16 +33,17 @@ public class RJEReaderTest { @Test - public void testIterator() { - RJEReader r = - new RJEReader(this.getClass().getResourceAsStream("/MT103-out-ack.rje"), StandardCharsets.US_ASCII); - int count = 0; - for (String m : r) { - assertNotNull(m); - // System.out.println("msg "+(count)); - count++; + public void testIterator() throws IOException { + try (InputStream inputStream = RJEReaderTest.class.getResourceAsStream("/MT103-out-ack.rje")) { + RJEReader r = new RJEReader(inputStream, StandardCharsets.US_ASCII); + int count = 0; + for (String m : r) { + assertNotNull(m); + // System.out.println("msg "+(count)); + count++; + } + assertEquals(13, count); } - assertEquals(13, count); } @Test @@ -69,13 +71,14 @@ public void testIteratorNotReentrant() { @Test public void testIterableWithNextMT() throws IOException { - RJEReader r = - new RJEReader(this.getClass().getResourceAsStream("/MT103-out-ack.rje"), StandardCharsets.US_ASCII); - assertTrue(r.hasNext()); - AbstractMT mt = r.nextMT(); - assertNotNull(mt); - // System.out.println(mt.message()); - assertEquals("103", mt.getMessageType()); + try (InputStream inputStream = RJEReaderTest.class.getResourceAsStream("/MT103-out-ack.rje")) { + RJEReader r = new RJEReader(inputStream, StandardCharsets.US_ASCII); + assertTrue(r.hasNext()); + AbstractMT mt = r.nextMT(); + assertNotNull(mt); + // System.out.println(mt.message()); + assertEquals("103", mt.getMessageType()); + } } @Test @@ -98,19 +101,23 @@ public void testDeliveryNotification() throws IOException { @Test public void testBulkFileWithAcks() throws IOException { - RJEReader r = new RJEReader( - this.getClass().getResourceAsStream("/MT103-bulk-with-ack.rje"), StandardCharsets.US_ASCII); - int count = 0; - while (r.hasNext()) { - SwiftMessage ack = r.nextSwiftMessage(); - assertNotNull(ack); - assertTrue(ack.isServiceMessage21()); - SwiftMessage mt = SwiftMessage.parse(ack.getUnparsedTexts().getAsFINString()); - assertNotNull(mt); - assertTrue(mt.isType(103)); - // System.out.println(mt.getBlock4().getTagValue("20")); - count++; + try (InputStream inputStream = RJEReaderTest.class.getResourceAsStream("/MT103-bulk-with-ack.rje")) { + RJEReader r = new RJEReader(inputStream, StandardCharsets.US_ASCII); + assertNotNull(inputStream, "The input stream could not be found"); + + int count = 0; + while (r.hasNext()) { + SwiftMessage ack = r.nextSwiftMessage(); + assertNotNull(ack); + assertTrue(ack.isServiceMessage21()); + + SwiftMessage mt = SwiftMessage.parse(ack.getUnparsedTexts().getAsFINString()); + assertNotNull(mt); + assertTrue(mt.isType(103)); + // System.out.println(mt.getBlock4().getTagValue("20")); + count++; + } + assertEquals(3, count); } - assertEquals(3, count); } } diff --git a/src/test/java/com/prowidesoftware/swift/io/parser/BaseMessageTestcase.java b/src/test/java/com/prowidesoftware/swift/io/parser/BaseMessageTestcase.java index 9c3cde2c2..593129adb 100644 --- a/src/test/java/com/prowidesoftware/swift/io/parser/BaseMessageTestcase.java +++ b/src/test/java/com/prowidesoftware/swift/io/parser/BaseMessageTestcase.java @@ -46,11 +46,15 @@ protected SwiftParser buildParser(String filename) { } protected InputStream getInputStream(String filename) { - InputStream is = getClass().getResourceAsStream(filename); - if (is == null) { + try (InputStream is = BaseMessageTestcase.class.getResourceAsStream(filename)) { + if (is == null) { + fail(filename + " not found in classpath"); + } + return is; + } catch (IOException e) { fail(filename + " not found in classpath"); + return null; } - return is; } protected String readMessageFromInputStream(InputStream is) { diff --git a/src/test/java/com/prowidesoftware/swift/io/parser/ParserTest.java b/src/test/java/com/prowidesoftware/swift/io/parser/ParserTest.java index b3afd3ba7..00154f4e6 100644 --- a/src/test/java/com/prowidesoftware/swift/io/parser/ParserTest.java +++ b/src/test/java/com/prowidesoftware/swift/io/parser/ParserTest.java @@ -53,9 +53,14 @@ public void testParse101() { */ @Test public void testParse101Stream() throws IOException { - MT101 mt = MT101.parse(getClass().getResourceAsStream("/MT101.fin")); - SwiftMessage msg = mt.getSwiftMessage(); - assertMT101(msg); + try (InputStream resourceStream = ParserTest.class.getResourceAsStream("/MT101.fin")) { + if (resourceStream == null) { + throw new IOException("Resource not found: MT101.fin"); + } + MT101 mt = MT101.parse(resourceStream); + SwiftMessage msg = mt.getSwiftMessage(); + assertMT101(msg); + } } /* diff --git a/src/test/java/com/prowidesoftware/swift/io/parser/SwiftParserConsumeBlockLenientTest.java b/src/test/java/com/prowidesoftware/swift/io/parser/SwiftParserConsumeBlockLenientTest.java index 3c9fe34da..10c17d900 100644 --- a/src/test/java/com/prowidesoftware/swift/io/parser/SwiftParserConsumeBlockLenientTest.java +++ b/src/test/java/com/prowidesoftware/swift/io/parser/SwiftParserConsumeBlockLenientTest.java @@ -238,7 +238,6 @@ public void testSimpleBlockConsumerBlock3_1() throws IOException { parser.setData("{3:{108:00112233}}"); final SwiftBlock3 b3 = (SwiftBlock3) parser.consumeBlock(null); assertNotNull(b3); - assertTrue(b3 instanceof SwiftBlock); assertTrue(b3.containsTag("108")); assertEquals("00112233", b3.getTagValue("108")); } @@ -248,7 +247,6 @@ public void testSimpleBlockConsumerBlock3_2() throws IOException { parser.setData("{3:{108:00112233}{4:foobar}}"); final SwiftBlock3 b3 = (SwiftBlock3) parser.consumeBlock(null); assertNotNull(b3); - assertTrue(b3 instanceof SwiftBlock); assertTrue(b3.containsTag("108")); assertEquals("00112233", b3.getTagValue("108")); assertTrue(b3.containsTag("4")); @@ -260,7 +258,6 @@ public void testSimpleBlockConsumerBlock5_1() throws IOException { parser.setData("{5:{108:00112233}}"); final SwiftBlock5 b = (SwiftBlock5) parser.consumeBlock(null); assertNotNull(b); - assertTrue(b instanceof SwiftBlock); assertTrue(b.containsTag("108")); assertEquals("00112233", b.getTagValue("108")); } @@ -270,7 +267,6 @@ public void testSimpleBlockConsumerBlock5_2() throws IOException { parser.setData("{5:{108:00112233}{4:foobar}}"); final SwiftBlock5 b = (SwiftBlock5) parser.consumeBlock(null); assertNotNull(b); - assertTrue(b instanceof SwiftBlock); assertTrue(b.containsTag("108")); assertEquals("00112233", b.getTagValue("108")); assertTrue(b.containsTag("4")); @@ -283,8 +279,6 @@ public void testBug1539324() throws IOException { parser.setData(fin); final SwiftBlock1 b1 = (SwiftBlock1) parser.consumeBlock(null); final SwiftBlock3 b3 = (SwiftBlock3) parser.consumeBlock(null); - assertTrue(b1 instanceof SwiftBlock1); - assertTrue(b3 instanceof SwiftBlock3); assertEquals(Constants.B1_DATA, b1.getValue()); assertEquals(1, b3.countAll()); assertEquals("n", b3.getTag(0).getName()); @@ -299,12 +293,11 @@ public void testSimpleBlockConsumerBlock3_3_KnownToFail() throws IOException { parser.setData("{3:blockdata{108:00112233}{4:foobar}}"); final SwiftBlock3 b = (SwiftBlock3) parser.consumeBlock(null); assertNotNull(b); - assertTrue(b instanceof SwiftBlock); assertTrue(b.containsTag("108")); assertEquals("00112233", b.getTagValue("108")); assertTrue(b.containsTag("4")); assertEquals("foobar", b.getTagValue("4")); - assertEquals(b.getUnparsedTextsSize(), new Integer(1)); + assertEquals(b.getUnparsedTextsSize(), Integer.valueOf(1)); assertEquals(b.unparsedTextGetText(0), "blockdata"); } diff --git a/src/test/java/com/prowidesoftware/swift/io/parser/SwiftParserTest.java b/src/test/java/com/prowidesoftware/swift/io/parser/SwiftParserTest.java index 8a90ec53b..f2a971667 100644 --- a/src/test/java/com/prowidesoftware/swift/io/parser/SwiftParserTest.java +++ b/src/test/java/com/prowidesoftware/swift/io/parser/SwiftParserTest.java @@ -54,14 +54,6 @@ public void test103_1() throws IOException { SwiftMessage m = new SwiftParser(messageToParse).message(); - // get a simple value tag - @SuppressWarnings("unused") - String val32a = m.getBlock3().getTagValue("32A"); - - // get a repeated value tag - @SuppressWarnings("unused") - String[] list71 = m.getBlock3().getTagValues("71F"); - assertEquals("103", m.getType()); // check b1 diff --git a/src/test/java/com/prowidesoftware/swift/io/writer/FINWriterVisitorTest.java b/src/test/java/com/prowidesoftware/swift/io/writer/FINWriterVisitorTest.java index ddf41e4ca..05973f602 100644 --- a/src/test/java/com/prowidesoftware/swift/io/writer/FINWriterVisitorTest.java +++ b/src/test/java/com/prowidesoftware/swift/io/writer/FINWriterVisitorTest.java @@ -43,12 +43,7 @@ public void setUp() { this.visitor = new FINWriterVisitor(this.io); } - @SuppressWarnings("unused") private String getResult() { - return this.getResult(""); - } - - private String getResult(String testName) { return this.io.toString(); } @@ -60,7 +55,7 @@ public void testWriteBlock1() { this.visitor.startBlock1(msg.getBlock1()); this.visitor.value(msg.getBlock1(), msg.getBlock1().getValue()); this.visitor.endBlock1(msg.getBlock1()); - assertEquals("{1:" + Constants.B1_DATA + "}", getResult("testWriteBlock1")); + assertEquals("{1:" + Constants.B1_DATA + "}", getResult()); } /** @@ -72,7 +67,7 @@ public void testWriteBlock1_2() { msg.getBlock1().setValue(Constants.B1_DATA); msg.visit(this.visitor); - assertEquals("{1:" + Constants.B1_DATA + "}{2:IN}{3:}{4:\r\n-}{5:}", getResult("testWriteBlock1_2")); + assertEquals("{1:" + Constants.B1_DATA + "}{2:IN}{3:}{4:\r\n-}{5:}", getResult()); } @Test @@ -83,7 +78,7 @@ public void testWriteBlock1_3() { msg.setBlock3(null); msg.visit(this.visitor); - assertEquals("{1:" + Constants.B1_DATA + "}{4:\r\n-}{5:}", getResult("testWriteBlock1_3")); + assertEquals("{1:" + Constants.B1_DATA + "}{4:\r\n-}{5:}", getResult()); } @Test @@ -95,7 +90,7 @@ public void testBug1690027_1() { msg.getBlock3().append(new Tag("2:val2")); msg.visit(this.visitor); - assertEquals("{3:{1:val1}{2:val2}}{4:\r\n-}{5:}", getResult("testBug1690027_1")); + assertEquals("{3:{1:val1}{2:val2}}{4:\r\n-}{5:}", getResult()); } @Test @@ -110,7 +105,7 @@ public void testWriteBlock4() { msg.getBlock4().append(new Tag("2:val2")); msg.visit(this.visitor); - assertEquals("{4:\r\n:1:val1\r\n:2:val2\r\n-}", getResult("testWriteBlock4")); + assertEquals("{4:\r\n:1:val1\r\n:2:val2\r\n-}", getResult()); } @Test @@ -125,7 +120,7 @@ public void testWriteBlock4_2() { msg.getBlock4().append(new Tag("2:val2")); msg.visit(this.visitor); - assertEquals("{2:I028BBBBUSC0XXXXN}{4:{1:val1}{2:val2}}", getResult("testWriteBlock4_2")); + assertEquals("{2:I028BBBBUSC0XXXXN}{4:{1:val1}{2:val2}}", getResult()); } @Test @@ -140,9 +135,7 @@ public void testWriteBlock4_3() { msg.getBlock4().append(new Tag("2:val2")); msg.visit(this.visitor); - assertEquals( - "{1:F01VNDZBET2AXXX0027000580}{2:I028BBBBUSC0XXXXN}{4:{1:val1}{2:val2}}", - getResult("testWriteBlock4_3")); + assertEquals("{1:F01VNDZBET2AXXX0027000580}{2:I028BBBBUSC0XXXXN}{4:{1:val1}{2:val2}}", getResult()); } @Test @@ -157,6 +150,6 @@ public void testBug1601122_1() { msg.getBlock5().append(new Tag("CHK:valchk")); msg.visit(this.visitor); - assertEquals("{5:{MAC:valmac}{CHK:valchk}}", getResult("testBug1601122_1")); + assertEquals("{5:{MAC:valmac}{CHK:valchk}}", getResult()); } } diff --git a/src/test/java/com/prowidesoftware/swift/io/writer/XMLWriterVisitorTest.java b/src/test/java/com/prowidesoftware/swift/io/writer/XMLWriterVisitorTest.java index 5649882ac..1c25e3c0c 100644 --- a/src/test/java/com/prowidesoftware/swift/io/writer/XMLWriterVisitorTest.java +++ b/src/test/java/com/prowidesoftware/swift/io/writer/XMLWriterVisitorTest.java @@ -53,10 +53,6 @@ public void setUp() { @SuppressWarnings("unused") private String getResult() { - return this.getResult(""); - } - - private String getResult(String testName) { msg.visit(visitor); return this.io.toString(); } @@ -69,7 +65,7 @@ public void testEmpty() { msg.setBlock4(null); msg.setBlock5(null); - assertXmlEqual("", getResult("testEmpty")); + assertXmlEqual("", getResult()); } @Test @@ -86,7 +82,7 @@ public void testEmptyBlocks() { msg.setBlock5(new SwiftBlock5()); String xml = "\n\n\n\n\n"; - assertXmlEqual(xml, getResult("testEmptyBlocks")); + assertXmlEqual(xml, getResult()); } @Test @@ -106,7 +102,7 @@ public void testWithTags() { b4.append(new Tag("t1:v1")); msg.setBlock1(b1); msg.setBlock4(b4); - assertXmlEqual(xml, getResult("testWithTags")); + assertXmlEqual(xml, getResult()); } @Test @@ -120,7 +116,7 @@ public void testBug1539324_1() { msg.setBlock2(b2); String xml = "\n" + Constants.B1_DATA_XML + Constants.B2_INPUT_XML + ""; - assertXmlEqual(xml, getResult("testBug1539324_1")); + assertXmlEqual(xml, getResult()); } @Test @@ -149,7 +145,7 @@ public void testBug1539324_2() { + "\n\n" + "\n\n" + "\n"; - assertXmlEqual(xml, getResult("testBug1539324_2")); + assertXmlEqual(xml, getResult()); } @Test @@ -171,7 +167,7 @@ public void testBug1540294_1() { + "\n\t" + "\n" + ""; - assertXmlEqual(xml, getResult("testBug1540294_1")); + assertXmlEqual(xml, getResult()); } @Test @@ -186,7 +182,7 @@ public void testBlock2Output_1() { msg.setBlock2(b2); String xml = "\n" + Constants.B1_DATA_XML + Constants.B2_OUTPUT_XML + ""; - assertXmlEqual(xml, getResult("testBlock2Output_1")); + assertXmlEqual(xml, getResult()); } @Test @@ -198,7 +194,7 @@ public void testBlock2Output() { msg.setBlock2(b2); String xml = "\n" + Constants.B2_OUTPUT_XML + ""; - String got = getResult("testBlock2Output"); + String got = getResult(); assertXmlEqual(xml, got); } @@ -216,7 +212,7 @@ public void testTagSerialization() { + "\n\t" + "\n" + ""; - assertXmlEqual(xml, getResult("testTagSerialization")); + assertXmlEqual(xml, getResult()); } @Test @@ -235,7 +231,7 @@ public void testFieldSerialization() { + "\n\t" + "\n" + ""; - assertXmlEqual(xml, getResult("testFieldSerialization")); + assertXmlEqual(xml, getResult()); } @Test @@ -256,6 +252,6 @@ public void testWithTags_asField() { msg.setBlock1(b1); msg.setBlock4(b4); this.visitor = new XMLWriterVisitor(this.io, true); - assertXmlEqual(xml, getResult("testWithTags")); + assertXmlEqual(xml, getResult()); } } diff --git a/src/test/java/com/prowidesoftware/swift/model/IBANValidateTest.java b/src/test/java/com/prowidesoftware/swift/model/IBANValidateTest.java new file mode 100644 index 000000000..9d85778e9 --- /dev/null +++ b/src/test/java/com/prowidesoftware/swift/model/IBANValidateTest.java @@ -0,0 +1,224 @@ +/* + * Copyright 2006-2023 Prowide + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.prowidesoftware.swift.model; + +import static org.junit.jupiter.api.Assertions.*; + +import org.junit.jupiter.api.Test; + +public class IBANValidateTest { + + @Test + public void testIsValidFoooo() { + assertFalse(IbanValidationResult.OK == IBAN.validate("fooo")); + } + + @Test + public void testIsValidFo00() { + assertFalse(IbanValidationResult.OK == IBAN.validate("fo00")); + } + + @Test + public void testReportedBad() { + assertTrue(IbanValidationResult.OK == IBAN.validate("CH10002300A1023502601")); + } + + @Test + public void testOkAustrian() { + assertEquals(IbanValidationResult.OK, IBAN.validate("AT611904300234573201")); + } + + @Test + public void testInvalidBbanAustrian() { + assertFalse(IbanValidationResult.OK == IBAN.validate("AT32010000000173363")); + } + + @Test + public void testOKSeychelles() { + assertEquals(IbanValidationResult.OK, IBAN.validate("SC52BAHL01031234567890123456USD")); + } + + @Test + public void testOKItaly() { + assertEquals(IbanValidationResult.OK, IBAN.validate("IT40S0542811101000000123456")); + } + + @Test + public void testOKBelgiumOK() { + assertEquals(IbanValidationResult.OK, IBAN.validate("BE62510007547061")); + } + + @Test + public void testOKLuxembourg() { + assertEquals(IbanValidationResult.OK, IBAN.validate("LU280019400644750000")); + } + + @Test + public void testOKDenmark() { + assertEquals(IbanValidationResult.OK, IBAN.validate("DK5000400440116243")); + } + + @Test + public void testOKNetherlands() { + assertEquals(IbanValidationResult.OK, IBAN.validate("NL39RABO0300065264")); + } + + @Test + public void testOKFinland() { + assertEquals(IbanValidationResult.OK, IBAN.validate("FI2112345600000785")); + } + + @Test + public void testOKNorway() { + assertEquals(IbanValidationResult.OK, IBAN.validate("NO9386011117947")); + } + + @Test + public void testOKFrance() { + assertEquals(IbanValidationResult.OK, IBAN.validate("FR1420041010050500013M02606")); + } + + @Test + public void testOKPoland() { + assertEquals(IbanValidationResult.OK, IBAN.validate("PL60102010260000042270201111")); + } + + @Test + public void testOKGermany() { + assertEquals(IbanValidationResult.OK, IBAN.validate("DE89370400440532013000")); + } + + @Test + public void testOKPortugal() { + assertEquals(IbanValidationResult.OK, IBAN.validate("PT50000201231234567890154")); + } + + @Test + public void testOKGibraltar() { + assertEquals(IbanValidationResult.OK, IBAN.validate("GI75NWBK000000007099453")); + } + + @Test + public void testOKSpain() { + assertEquals(IbanValidationResult.OK, IBAN.validate("ES0700120345030000067890")); + } + + @Test + public void testOKGreece() { + assertEquals(IbanValidationResult.OK, IBAN.validate("GR1601101250000000012300695")); + } + + @Test + public void testOKSweden() { + assertEquals(IbanValidationResult.OK, IBAN.validate("SE3550000000054910000003")); + } + + @Test + public void testOKIceland() { + assertEquals(IbanValidationResult.OK, IBAN.validate("IS140159260076545510730339")); + } + + @Test + public void testOKSwitzerland() { + assertEquals(IbanValidationResult.OK, IBAN.validate("CH9300762011623852957")); + } + + @Test + public void testOKIreland() { + assertEquals(IbanValidationResult.OK, IBAN.validate("IE29AIBK93115212345678")); + } + + @Test + public void testSpaceGreatBritain() { + assertTrue(IBAN.validate(" GB51 LOYD 3092 0700 7195 88.") == IbanValidationResult.INVALID_COUNTRY_CODE_CHARSET); + } + + @Test + public void testErrorEmpty() { + assertTrue(IBAN.validate("") == IbanValidationResult.IBAN_IS_EMPTY); + } + + @Test + public void testErrorNull() { + assertTrue(IBAN.validate(null) == IbanValidationResult.IBAN_IS_NULL); + } + + @Test + public void testErrorMissingBban() { + assertTrue(IBAN.validate("IE99") == IbanValidationResult.MISSING_BBAN); + } + + @Test + public void testErrorBbanMaxLength() { + assertTrue(IBAN.validate("IE991234567890123456789012345678901") == IbanValidationResult.BBAN_MAX_LENGTH); + } + + @Test + public void testErrorBbanLength() { + IbanValidationResult result = IBAN.validate("AT32010000000173363"); + assertTrue(result == IbanValidationResult.BBAN_INVALID_LENGTH); + // System.out.println(result.message()); + } + + @Test + public void testErrorCountry() { + IbanValidationResult result = IBAN.validate("aa17002001280000001200527600"); + assertTrue(result == IbanValidationResult.INVALID_COUNTRY_CODE_CHARSET); + // System.out.println(result.message()); + result = IBAN.validate("ZZ17002001280000001200527600"); + assertTrue(result == IbanValidationResult.INVALID_COUNTRY_CODE); + // System.out.println(result.message()); + } + + @Test + public void testValidateCheckDigitPresence() { + IbanValidationResult result = IBAN.validate("AT1"); + assertTrue(result == IbanValidationResult.MISSING_CHECK_DIGITS); + } + + @Test + public void testValidateBbanInvalidDigits() { + IbanValidationResult result = IBAN.validate("DK5000400T40116243"); + assertTrue(result == IbanValidationResult.BBAN_INVALID_DIGITS); + } + + @Test + public void testValidateBbanInvalidDigitsOrLetters() { + IbanValidationResult result = IBAN.validate("GI75NWBK00000000709t453"); + assertTrue(result == IbanValidationResult.BBAN_INVALID_DIGITS_OR_LETTERS); + // System.out.println(result.message()); + } + + @Test + public void testValidateBbanInvalidUpperCaseLetters() { + IbanValidationResult result = IBAN.validate("GI75nWBK000000007099453"); + assertTrue(result == IbanValidationResult.BBAN_INVALID_UPPER_CASE_LETTERS); + // System.out.println(result.message()); + } + + @Test + public void testCodes() { + assertEquals(IbanValidationResult.OK, IBAN.validate("CY17002001280000001200527600")); + assertEquals(IbanValidationResult.OK, IBAN.validate("IE62BOFI90381614262992")); + assertEquals(IbanValidationResult.OK, IBAN.validate("GB61CHAS60924232466601")); + assertEquals(IbanValidationResult.OK, IBAN.validate("EG389004000100300074201200001")); + assertEquals(IbanValidationResult.BBAN_INVALID_LENGTH, IBAN.validate("GB45-LOYD-3092-0711-1072-32")); + assertEquals(IbanValidationResult.BBAN_INVALID_LENGTH, IBAN.validate("SE76 8000.08105903-7676/5343")); + assertEquals(IbanValidationResult.BBAN_INVALID_LENGTH, IBAN.validate("GB97CHAS60924232684106*&^%()!@")); + assertEquals(IbanValidationResult.INVALID_COUNTRY_CODE_CHARSET, IBAN.validate(" NL76 FTSB 084.47.26.494")); + assertEquals(IbanValidationResult.INVALID_COUNTRY_CODE_CHARSET, IBAN.validate(" FI8916603000104953")); + } +} diff --git a/src/test/java/com/prowidesoftware/swift/model/SwiftMessageTest.java b/src/test/java/com/prowidesoftware/swift/model/SwiftMessageTest.java index 5b8667b83..9faafe9ef 100644 --- a/src/test/java/com/prowidesoftware/swift/model/SwiftMessageTest.java +++ b/src/test/java/com/prowidesoftware/swift/model/SwiftMessageTest.java @@ -97,22 +97,22 @@ public void testDefaultConstructor() { final SwiftMessage m = new SwiftMessage(true); assertNotNull(m.getBlock1()); - assertTrue(m.getBlock1() instanceof SwiftBlock1); + assertInstanceOf(SwiftBlock1.class, m.getBlock1()); assertNotNull(m.getBlock2()); - assertTrue(m.getBlock2() instanceof SwiftBlock2); + assertInstanceOf(SwiftBlock2.class, m.getBlock2()); assertNotNull(m.getBlock3()); - assertTrue(m.getBlock3() instanceof SwiftBlock3); + assertInstanceOf(SwiftBlock3.class, m.getBlock3()); assertNotNull(m.getBlock4()); - assertTrue(m.getBlock4() instanceof SwiftBlock4); + assertInstanceOf(SwiftBlock4.class, m.getBlock4()); assertNotNull(m.getBlock5()); - assertTrue(m.getBlock5() instanceof SwiftBlock5); + assertInstanceOf(SwiftBlock5.class, m.getBlock5()); assertNotNull(m.getUserBlocks()); - assertTrue(m.getUserBlocks() instanceof List); + assertInstanceOf(List.class, m.getUserBlocks()); // expected 2 because empty blocks are not counted and block 1 and 2 have default attribute values assertEquals(2, m.getBlockCount()); diff --git a/src/test/java/com/prowidesoftware/swift/model/UnparsedTextListTest.java b/src/test/java/com/prowidesoftware/swift/model/UnparsedTextListTest.java index 79d6f052d..9cb43f69a 100644 --- a/src/test/java/com/prowidesoftware/swift/model/UnparsedTextListTest.java +++ b/src/test/java/com/prowidesoftware/swift/model/UnparsedTextListTest.java @@ -57,7 +57,7 @@ public void test_staticIsMessage() { @Test public void test_addText() { t.addText(someText); - assertEquals(t.size(), new Integer(1)); + assertEquals(t.size(), Integer.valueOf(1)); assertEquals(t.getText(0), someText); } @@ -71,9 +71,9 @@ public void test_isMessage() { @Test public void test_size() { - assertEquals(t.size(), new Integer(0)); + assertEquals(t.size(), Integer.valueOf(0)); t.addText(someText); - assertEquals(t.size(), new Integer(1)); + assertEquals(t.size(), Integer.valueOf(1)); } @Test @@ -111,7 +111,7 @@ public void test_addTextMessage() { t.addText(msg); // check things out - assertEquals(t.size(), new Integer(1)); + assertEquals(t.size(), Integer.valueOf(1)); assertEquals(t.getText(0), msgString); } @@ -121,7 +121,7 @@ public void test_removeIndexOK() { t.addText(someMsg); t.removeText(0); assertEquals(t.getText(0), someMsg); - assertEquals(t.size(), new Integer(1)); + assertEquals(t.size(), Integer.valueOf(1)); } @Test @@ -135,7 +135,7 @@ public void test_removeText() { t.addText(someMsg); t.removeText(someText); assertEquals(t.getText(0), someMsg); - assertEquals(t.size(), new Integer(1)); + assertEquals(t.size(), Integer.valueOf(1)); } @Test @@ -174,10 +174,7 @@ public void test_bug2822350() throws IOException { SwiftMessage msg = SwiftMessage.parse(sb.toString()); - @SuppressWarnings("unused") - SwiftMessage m2 = SwiftMessage.parse(msg.getUnparsedTexts().getText(0)); - - @SuppressWarnings("unused") - SwiftMessage m3 = SwiftMessage.parse(msg.getUnparsedTexts().getText(1)); + assertNotNull(SwiftMessage.parse(msg.getUnparsedTexts().getText(0))); + assertNotNull(SwiftMessage.parse(msg.getUnparsedTexts().getText(1))); } } diff --git a/src/test/java/com/prowidesoftware/swift/model/field/ContainerInterfacesTest.java b/src/test/java/com/prowidesoftware/swift/model/field/ContainerInterfacesTest.java index a1741967b..a6db6e8e8 100644 --- a/src/test/java/com/prowidesoftware/swift/model/field/ContainerInterfacesTest.java +++ b/src/test/java/com/prowidesoftware/swift/model/field/ContainerInterfacesTest.java @@ -16,7 +16,6 @@ package com.prowidesoftware.swift.model.field; import static org.junit.jupiter.api.Assertions.assertFalse; -import static org.junit.jupiter.api.Assertions.assertTrue; import org.junit.jupiter.api.Test; @@ -24,19 +23,12 @@ public class ContainerInterfacesTest { @Test public void testInstanceOf() { - // both currency and amount - assertTrue(new Field32A() instanceof MonetaryAmountContainer); - assertTrue(new Field32A() instanceof CurrencyContainer); - assertTrue(new Field32A() instanceof AmountContainer); - // only amount assertFalse(new Field33B() instanceof MonetaryAmountContainer); assertFalse(new Field33B() instanceof CurrencyContainer); - assertTrue(new Field33B() instanceof AmountContainer); // only currencies assertFalse(new Field32Q() instanceof MonetaryAmountContainer); - assertTrue(new Field32Q() instanceof CurrencyContainer); assertFalse(new Field32Q() instanceof AmountContainer); } } diff --git a/src/test/java/com/prowidesoftware/swift/model/field/FieldComponentLabelsCompatibilityTest.java b/src/test/java/com/prowidesoftware/swift/model/field/FieldComponentLabelsCompatibilityTest.java index 7ddbf17cb..46b63c110 100644 --- a/src/test/java/com/prowidesoftware/swift/model/field/FieldComponentLabelsCompatibilityTest.java +++ b/src/test/java/com/prowidesoftware/swift/model/field/FieldComponentLabelsCompatibilityTest.java @@ -16,6 +16,7 @@ package com.prowidesoftware.swift.model.field; import java.io.BufferedReader; +import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.net.URL; @@ -33,14 +34,19 @@ public static List getClasses(ClassLoader cl, String pack) throws Excepti String dottedPackage = pack.replaceAll("[/]", "."); List classes = new ArrayList<>(); URL upackage = cl.getResource(pack); - BufferedReader reader = new BufferedReader(new InputStreamReader((InputStream) upackage.getContent())); - String line = null; - while ((line = reader.readLine()) != null) { - if (line.endsWith(".class") - && line.startsWith("Field") - && !line.contains("Test") - && !line.equals("Field.class")) { - classes.add(Class.forName(dottedPackage + "." + line.substring(0, line.lastIndexOf('.')))); + if (upackage == null) { + throw new IOException("Package not found: " + pack); + } + + try (BufferedReader reader = new BufferedReader(new InputStreamReader((InputStream) upackage.getContent()))) { + String line; + while ((line = reader.readLine()) != null) { + if (line.endsWith(".class") + && line.startsWith("Field") + && !line.contains("Test") + && !line.equals("Field.class")) { + classes.add(Class.forName(dottedPackage + "." + line.substring(0, line.lastIndexOf('.')))); + } } } return classes; diff --git a/src/test/java/com/prowidesoftware/swift/model/mt/AbstractMTTest.java b/src/test/java/com/prowidesoftware/swift/model/mt/AbstractMTTest.java index 88726c765..697091362 100644 --- a/src/test/java/com/prowidesoftware/swift/model/mt/AbstractMTTest.java +++ b/src/test/java/com/prowidesoftware/swift/model/mt/AbstractMTTest.java @@ -303,11 +303,11 @@ public void testMTClassParse() { } @Test - public void testAbstractMt() throws IOException { - Integer type = 9; + public void testAbstractMt() { + int type = 9; try { - AbstractMT aMt = AbstractMT.create(type); + AbstractMT.create(type); } catch (Exception e) { fail("No exception expected"); } diff --git a/src/test/java/com/prowidesoftware/swift/utils/ConstraintUtilsTest.java b/src/test/java/com/prowidesoftware/swift/utils/ConstraintUtilsTest.java new file mode 100644 index 000000000..1ff4a4d1c --- /dev/null +++ b/src/test/java/com/prowidesoftware/swift/utils/ConstraintUtilsTest.java @@ -0,0 +1,18 @@ +package com.prowidesoftware.swift.utils; + +import static org.junit.jupiter.api.Assertions.*; + +import org.junit.jupiter.api.Test; + +class ConstraintUtilsTest { + + @Test + public void testEscapeEcmaScript() { + assertNull(ConstraintUtils.escapeEcmaScript(null)); + assertEquals("He didn\\'t say, \\\"stop!\\\"", ConstraintUtils.escapeEcmaScript("He didn't say, \"stop!\"")); + assertEquals( + "document.getElementById(\\\"test\\\").value = \\'';")); + } +} diff --git a/src/test/java/com/prowidesoftware/swift/utils/IsoUtilsTest.java b/src/test/java/com/prowidesoftware/swift/utils/IsoUtilsTest.java index 93278070f..e7cfea1a6 100644 --- a/src/test/java/com/prowidesoftware/swift/utils/IsoUtilsTest.java +++ b/src/test/java/com/prowidesoftware/swift/utils/IsoUtilsTest.java @@ -44,9 +44,10 @@ public void testCurrencies() { assertFalse(IsoUtils.getInstance().isValidISOCurrency(null)); assertFalse(IsoUtils.getInstance().isValidISOCurrency("XYZ")); - IsoUtils.getInstance().getCurrencies().add("XYZ"); + IsoUtils.getInstance().addCurrency("XYZ"); assertTrue(IsoUtils.getInstance().isValidISOCurrency("XYZ")); - IsoUtils.getInstance().getCurrencies().remove("XYZ"); + IsoUtils.getInstance().removeCurrency("XYZ"); + assertFalse(IsoUtils.getInstance().isValidISOCurrency("XYZ")); } @Test @@ -126,7 +127,8 @@ public void testAddCountry_4() { public void testAddCountry_5() { IsoUtils.getInstance().addCountry("SZ"); assertTrue(IsoUtils.getInstance().isValidISOCountry("SZ")); - IsoUtils.getInstance().getCountries().remove("SZ"); + IsoUtils.getInstance().removeCountry("SZ"); + assertFalse(IsoUtils.getInstance().isValidISOCountry("SZ")); } @Test @@ -157,6 +159,7 @@ public void testAddCurrency_4() { public void testAddCurrency_5() { IsoUtils.getInstance().addCurrency("DSZ"); assertTrue(IsoUtils.getInstance().isValidISOCurrency("DSZ")); - IsoUtils.getInstance().getCurrencies().remove("DSZ"); + IsoUtils.getInstance().removeCurrency("DSZ"); + assertFalse(IsoUtils.getInstance().isValidISOCurrency("DSZ")); } } diff --git a/src/test/java/com/prowidesoftware/swift/utils/SwiftFormatUtilsTest.java b/src/test/java/com/prowidesoftware/swift/utils/SwiftFormatUtilsTest.java index a69a27c82..3b3f1a2cc 100644 --- a/src/test/java/com/prowidesoftware/swift/utils/SwiftFormatUtilsTest.java +++ b/src/test/java/com/prowidesoftware/swift/utils/SwiftFormatUtilsTest.java @@ -44,29 +44,33 @@ public void testGetNumber() { assertNotNull(SwiftFormatUtils.getNumber("1,2")); assertEquals( - new Double(1.2), new Double(SwiftFormatUtils.getNumber("1,2").doubleValue())); + Double.valueOf(1.2), + Double.valueOf(SwiftFormatUtils.getNumber("1,2").doubleValue())); assertNotNull(SwiftFormatUtils.getNumber("12,34")); assertEquals( - new Double(12.34), - new Double(SwiftFormatUtils.getNumber("12,34").doubleValue())); + Double.valueOf(12.34), + Double.valueOf(SwiftFormatUtils.getNumber("12,34").doubleValue())); assertNotNull(SwiftFormatUtils.getNumber("12,3456")); assertEquals( - new Double(12.3456), - new Double(SwiftFormatUtils.getNumber("12,3456").doubleValue())); + Double.valueOf(12.3456), + Double.valueOf(SwiftFormatUtils.getNumber("12,3456").doubleValue())); assertNotNull(SwiftFormatUtils.getNumber("0,")); - assertEquals(new Double(0), new Double(SwiftFormatUtils.getNumber("0,").doubleValue())); + assertEquals( + Double.valueOf(0), + Double.valueOf(SwiftFormatUtils.getNumber("0,").doubleValue())); assertNotNull(SwiftFormatUtils.getNumber("299000,34")); assertEquals( - new Double(299000.34), - new Double(SwiftFormatUtils.getNumber("299000,34").doubleValue())); + Double.valueOf(299000.34), + Double.valueOf(SwiftFormatUtils.getNumber("299000,34").doubleValue())); assertNotNull(SwiftFormatUtils.getNumber(",34")); assertEquals( - new Double(0.34), new Double(SwiftFormatUtils.getNumber(",34").doubleValue())); + Double.valueOf(0.34), + Double.valueOf(SwiftFormatUtils.getNumber(",34").doubleValue())); } @Test