diff --git a/CHANGELOG.md b/CHANGELOG.md index f4c7b98e9..7e2070014 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ #### 9.4.18 - SNAPSHOT * Added new `FieldEnum` with all the available field names + * Code security improvements as per CodeQL recommendations #### 9.4.17 - June 2024 * (PW-1913) Added IBAN validation for Egypt local account structure diff --git a/build.gradle b/build.gradle index 79dc56ecb..c94374e0b 100644 --- a/build.gradle +++ b/build.gradle @@ -59,6 +59,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.8.2') testImplementation group: 'org.assertj', name: 'assertj-core', version: '3.22.0' 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 d57c46a98..7153b4785 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; @@ -204,14 +201,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 101"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** @@ -226,7 +220,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -429,7 +423,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 3bbe53977..b8029047c 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; @@ -205,14 +202,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 102"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** @@ -227,7 +221,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type 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,7 +464,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 59cc859bc..27f295b48 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; @@ -204,14 +201,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 103"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** @@ -226,7 +220,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -429,7 +423,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 2958e5d3e..5bb0ae040 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; @@ -204,14 +201,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 104"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** @@ -226,7 +220,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -429,7 +423,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 4a0933a96..e264fa5a4 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; @@ -206,14 +203,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 105"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** @@ -228,7 +222,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -394,32 +388,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) { @@ -449,27 +425,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); @@ -540,7 +502,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 b6109fd6e..118b7b4d4 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; @@ -204,14 +201,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 106"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** @@ -226,7 +220,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -429,7 +423,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 ce085fc63..c0c49bfc4 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; @@ -204,14 +201,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 107"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** @@ -226,7 +220,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -429,7 +423,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 7a8fbda13..37402f498 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; @@ -204,14 +201,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 108"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** @@ -226,7 +220,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -429,7 +423,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 cd5b2b1e7..d9bed01c3 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; @@ -248,11 +245,9 @@ 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); } /** @@ -267,7 +262,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -571,6 +566,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); } @@ -648,7 +644,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 e84db9d2b..cff061b44 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; @@ -206,14 +203,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 110"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** @@ -228,7 +222,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -394,32 +388,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) { @@ -449,27 +425,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); @@ -540,7 +502,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 7da76c56c..a16d788ff 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; @@ -206,14 +203,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 111"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** @@ -228,7 +222,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -394,32 +388,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) { @@ -449,27 +425,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); @@ -540,7 +502,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 a03bcf530..f1e42ed0d 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; @@ -204,14 +201,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 113"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** @@ -226,7 +220,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -429,7 +423,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 f17e8a29f..52085a4bc 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; @@ -204,14 +201,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 114"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** @@ -226,7 +220,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -429,7 +423,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 07396899d..329819e1b 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; @@ -204,14 +201,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 115"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** @@ -226,7 +220,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -429,7 +423,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 c757e1c6f..1212a0b0e 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; @@ -204,14 +201,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 116"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** @@ -226,7 +220,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type 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,7 +463,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 20cf9796d..55ccab6df 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; @@ -204,14 +201,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 117"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** @@ -226,7 +220,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -429,7 +423,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 527aac845..67e19bb85 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; @@ -204,14 +201,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 118"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** @@ -226,7 +220,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type 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,7 +463,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 17d471264..fff42e15c 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; @@ -204,14 +201,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 119"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** @@ -226,7 +220,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -429,7 +423,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 3bdb1348f..129bf63f9 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; @@ -232,11 +229,9 @@ 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); } /** @@ -251,7 +246,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type 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,26 +505,32 @@ public Field11A setCurrency(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); } @@ -541,6 +542,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; } @@ -551,6 +553,7 @@ public String getDSS() { * @see #getDSS() * @return true if DSS is present, false otherwise. */ + @Override public boolean isDSSPresent() { return false; } @@ -565,6 +568,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); } @@ -632,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 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 2cc498cf7..93cb9ac8f 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; @@ -280,11 +277,9 @@ 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); } /** @@ -299,7 +294,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -670,32 +665,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) { @@ -725,27 +702,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); @@ -762,32 +725,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) { @@ -817,27 +762,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); @@ -849,6 +780,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); } @@ -926,7 +858,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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)); } @@ -942,6 +874,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); } @@ -955,6 +888,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); @@ -967,6 +901,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()); } @@ -979,6 +914,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)); @@ -993,6 +929,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); } @@ -1007,6 +944,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 5877397bd..84b723011 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; @@ -280,11 +277,9 @@ 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); } /** @@ -299,7 +294,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -670,32 +665,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) { @@ -725,27 +702,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); @@ -762,32 +725,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) { @@ -817,27 +762,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); @@ -849,6 +780,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); } @@ -926,7 +858,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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)); } @@ -942,6 +874,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); } @@ -955,6 +888,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); @@ -967,6 +901,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()); } @@ -979,6 +914,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)); @@ -993,6 +929,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); } @@ -1007,6 +944,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 7cdf9b1dc..3c353f6ec 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; @@ -206,14 +203,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 12"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** @@ -228,7 +222,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -394,32 +388,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) { @@ -449,27 +425,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); @@ -540,7 +502,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 87ea6d68a..5361a050e 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; @@ -206,14 +203,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 120"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** @@ -228,7 +222,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -394,32 +388,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) { @@ -449,27 +425,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); @@ -540,7 +502,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 52a5f6355..7b481b2eb 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; @@ -204,14 +201,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 121"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** @@ -226,7 +220,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -429,7 +423,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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/Field122.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field122.java index 2debe8c65..fbcd34453 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field122.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field122.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,14 +203,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 122"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** @@ -228,7 +222,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -425,32 +419,14 @@ public Field122 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 Of Messages content to set - * @return the field object to enable build pattern - */ - public Field122 setComponent1(java.lang.Long component1) { - setComponent(1, SwiftFormatUtils.getLong(component1)); - return this; - } /** * Alternative method setter for field's Number Of Messages (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 Of Messages content to set * @return the field object to enable build pattern - * @see #setNumberOfMessages(java.lang.Long) */ public Field122 setComponent1(java.lang.Number component1) { @@ -480,27 +456,13 @@ public Field122 setNumberOfMessages(String component1) { return setComponent1(component1); } - /** - * Set the Number Of Messages (component 1) from a Long object. - * - * @see #setComponent1(java.lang.Long) - * - * @param component1 Long with the Number Of Messages content to set - * @return the field object to enable build pattern - * @since 9.2.7 - */ - public Field122 setNumberOfMessages(java.lang.Long component1) { - return setComponent1(component1); - } - /** * Alternative method setter for field's Number Of Messages (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 Of Messages content to set * @return the field object to enable build pattern - * @see #setNumberOfMessages(java.lang.Long) */ public Field122 setNumberOfMessages(java.lang.Number component1) { return setComponent1(component1); @@ -515,16 +477,6 @@ public Field122 setNumberofMessages(String component1) { return setNumberOfMessages(component1); } - /** - * @deprecated use #setComponent1(java.lang.Long) instead - * @since 9.2.7 - */ - @Deprecated - @ProwideDeprecated(phase4 = TargetYear.SRU2024) - public Field122 setNumberofMessages(java.lang.Long component1) { - return setNumberOfMessages(component1); - } - /** * @deprecated use #setNumberOfMessages(java.lang.Long) instead */ @@ -599,7 +551,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field122(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 0a7c5fc3c..4e00f72d6 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; @@ -204,14 +201,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 123"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** @@ -226,7 +220,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -429,7 +423,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 6c3c61278..14b47755a 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; @@ -206,14 +203,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 124"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** @@ -228,7 +222,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -431,7 +425,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 363093e25..f7827ce8e 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; @@ -206,14 +203,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 125"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** @@ -228,7 +222,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -394,32 +388,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) { @@ -449,27 +425,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); @@ -540,7 +502,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 bf7ef458b..d55cee7c7 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; @@ -206,14 +203,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 126"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** @@ -228,7 +222,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -394,32 +388,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) { @@ -449,27 +425,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); @@ -540,7 +502,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 254361ea1..5b0a1372a 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; @@ -204,14 +201,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 127"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** @@ -226,7 +220,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -429,7 +423,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 204220f8e..f095f46fe 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; @@ -223,11 +220,9 @@ 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); } /** @@ -242,7 +237,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -461,10 +456,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); } @@ -533,7 +530,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 c047b861b..ff8964280 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; @@ -222,11 +219,9 @@ 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); } /** @@ -241,7 +236,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -464,32 +459,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) { @@ -519,27 +496,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); @@ -556,32 +519,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) { @@ -611,27 +556,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); @@ -702,7 +633,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 030748293..1af9f6266 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; @@ -242,11 +239,9 @@ 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); } /** @@ -261,7 +256,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -512,6 +507,7 @@ public Field12A setInstrumentCode(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(); } @@ -522,6 +518,7 @@ public String getDSS() { * @see #getDSS() * @return true if DSS is present, false otherwise. */ + @Override public boolean isDSSPresent() { return getComponent2() != null; } @@ -536,6 +533,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); } @@ -603,7 +601,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 d4286ba8d..d2c770840 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; @@ -241,11 +238,9 @@ 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); } /** @@ -260,7 +255,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type 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 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(); } @@ -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 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 df7992918..c833fefef 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; @@ -222,11 +219,9 @@ 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); } /** @@ -241,7 +236,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -427,6 +422,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; } @@ -437,6 +433,7 @@ public String getDSS() { * @see #getDSS() * @return true if DSS is present, false otherwise. */ + @Override public boolean isDSSPresent() { return false; } @@ -451,6 +448,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); } @@ -518,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 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 343b895d6..96e86be85 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; @@ -204,14 +201,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 12D"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** @@ -226,7 +220,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -429,7 +423,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 5797b406c..73e44836f 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; @@ -217,14 +214,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 12E"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** @@ -239,7 +233,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -482,7 +476,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 4fdcdcb80..e2155cbba 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; @@ -204,14 +201,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 12F"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** @@ -226,7 +220,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -429,7 +423,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 948087f34..2a1d3dc72 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; @@ -204,14 +201,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 12G"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** @@ -226,7 +220,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -429,7 +423,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 232e4abb4..f69e0e879 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; @@ -258,11 +255,9 @@ 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); } /** @@ -277,7 +272,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -538,32 +533,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) { @@ -593,27 +570,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); @@ -651,32 +614,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) { @@ -706,27 +651,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); @@ -818,7 +749,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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)); } @@ -834,6 +765,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); } @@ -847,6 +779,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); @@ -859,6 +792,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()); } @@ -871,6 +805,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)); @@ -885,6 +820,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); } @@ -899,6 +835,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 c5669dbf1..664fe0adf 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; @@ -220,11 +217,9 @@ 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); } /** @@ -239,7 +234,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -448,32 +443,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) { @@ -503,27 +480,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); @@ -594,7 +557,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 41adf2d0d..30c426856 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; @@ -255,11 +252,9 @@ 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); } /** @@ -274,7 +269,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -560,32 +555,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) { @@ -615,27 +592,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); @@ -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 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 36f947632..34682adde 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; @@ -240,11 +237,9 @@ 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); } /** @@ -259,7 +254,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type 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,10 +513,12 @@ public Field134 setBroadcastRequesterCity(String component3) { } + @Override public List bics() { return BICResolver.bics(this); } + @Override public List bicStrings () { return BICResolver.bicStrings(this); } @@ -590,7 +587,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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)); } @@ -606,6 +603,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); } @@ -619,6 +617,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); @@ -631,6 +630,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()); } @@ -643,6 +643,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)); @@ -657,6 +658,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); } @@ -671,6 +673,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 618d9118b..dbe064e4d 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; @@ -204,14 +201,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 135"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** @@ -226,7 +220,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -429,7 +423,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 0681fa123..9c9754224 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; @@ -220,11 +217,9 @@ 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); } /** @@ -239,7 +234,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type 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,32 +440,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) { @@ -500,27 +477,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); @@ -591,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 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 289cf62ea..47e5282b0 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; @@ -255,11 +252,9 @@ 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); } /** @@ -274,7 +269,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -560,32 +555,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) { @@ -615,27 +592,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); @@ -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 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 d4b42f975..e109df9e5 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; @@ -228,11 +225,9 @@ 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); } /** @@ -247,7 +242,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type 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,6 +446,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; } @@ -461,6 +457,7 @@ public String getDSS() { * @see #getDSS() * @return true if DSS is present, false otherwise. */ + @Override public boolean isDSSPresent() { return false; } @@ -475,6 +472,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 +540,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 ba91c7b57..1a28c0f4e 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; @@ -235,11 +232,9 @@ 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); } /** @@ -254,7 +249,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -483,6 +478,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(); } @@ -493,6 +489,7 @@ public String getDSS() { * @see #getDSS() * @return true if DSS is present, false otherwise. */ + @Override public boolean isDSSPresent() { return getComponent2() != null; } @@ -507,6 +504,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); } @@ -574,7 +572,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 a935203db..2bae39eef 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; @@ -273,11 +270,9 @@ 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); } /** @@ -292,7 +287,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -775,7 +770,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 ac9f4a9ce..8966998a0 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; @@ -261,11 +258,9 @@ 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); } /** @@ -280,7 +275,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -664,6 +659,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); } @@ -741,7 +737,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 74e268389..50b521c41 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; @@ -229,11 +226,9 @@ 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); } /** @@ -248,7 +243,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type 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 Field13J setCode(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; } @@ -466,6 +462,7 @@ public String getDSS() { * @see #getDSS() * @return true if DSS is present, false otherwise. */ + @Override public boolean isDSSPresent() { return false; } @@ -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 Field13J(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field13K.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field13K.java index 00262ceec..b101aba63 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field13K.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field13K.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; @@ -247,14 +244,13 @@ 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; } @@ -271,7 +267,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -547,32 +543,13 @@ public Field13K 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 Field13K 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 Field13K setComponent3(java.lang.Number component3) { @@ -604,27 +581,13 @@ public Field13K 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 Field13K 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 Field13K setQuantity(java.lang.Number component3) { return setComponent3(component3); @@ -639,16 +602,6 @@ public Field13K setAmount(String component3) { return setQuantity(component3); } - /** - * @deprecated use #setComponent3(java.math.BigDecimal) instead - * @since 9.2.7 - */ - @Deprecated - @ProwideDeprecated(phase4 = TargetYear.SRU2024) - public Field13K setAmount(java.math.BigDecimal component3) { - return setQuantity(component3); - } - /** * @deprecated use #setQuantity(java.math.BigDecimal) instead */ @@ -675,6 +628,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); } @@ -686,6 +640,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; } @@ -696,6 +651,7 @@ public String getDSS() { * @see #getDSS() * @return true if DSS is present, false otherwise. */ + @Override public boolean isDSSPresent() { return false; } @@ -710,6 +666,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); } @@ -777,7 +734,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field13K(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 de411e41d..1181d47b6 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; @@ -206,14 +203,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 140"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** @@ -228,7 +222,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -394,32 +388,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) { @@ -449,27 +425,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); @@ -540,7 +502,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 4d428b048..f656cfeae 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; @@ -204,14 +201,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 141"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** @@ -226,7 +220,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -429,7 +423,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 8353a7f3f..3f30664e7 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; @@ -207,17 +204,15 @@ public String getValue() { */ @Override 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; } @@ -234,7 +229,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -419,6 +414,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); } @@ -497,7 +493,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 22c1e7e5c..9967814df 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; @@ -207,17 +204,15 @@ public String getValue() { */ @Override 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; } @@ -234,7 +229,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -419,6 +414,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); } @@ -497,7 +493,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 923e02d66..90af770f8 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; @@ -206,14 +203,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 144"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** @@ -228,7 +222,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -394,32 +388,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) { @@ -449,27 +425,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); @@ -540,7 +502,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 5824585e2..0fe6caa63 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; @@ -204,14 +201,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 14A"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** @@ -226,7 +220,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -429,7 +423,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 5b6130ac5..19695cf8f 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; @@ -204,14 +201,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 14B"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** @@ -226,7 +220,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -429,7 +423,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 638aed8b3..9780b5cb2 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; @@ -206,14 +203,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 14C"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** @@ -228,7 +222,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -394,32 +388,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) { @@ -449,27 +425,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); @@ -540,7 +502,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 d140cd364..ed8053330 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; @@ -204,14 +201,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 14D"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** @@ -226,7 +220,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -429,7 +423,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 edd6fda1e..7c6ff7a89 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; @@ -204,14 +201,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 14E"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** @@ -226,7 +220,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -429,7 +423,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 d18b5af7d..afc80ac19 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; @@ -204,14 +201,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 14F"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** @@ -226,7 +220,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -429,7 +423,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 74b4e290a..603e29021 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; @@ -220,11 +217,9 @@ 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); } /** @@ -239,7 +234,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -482,7 +477,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 4389da7a3..4b79ee34d 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; @@ -204,14 +201,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 14H"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** @@ -226,7 +220,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -429,7 +423,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 c1f9898cd..31985442f 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; @@ -204,14 +201,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 14J"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** @@ -226,7 +220,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -429,7 +423,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 78e81ca64..a2731ee1b 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; @@ -204,14 +201,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 14K"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** @@ -226,7 +220,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -429,7 +423,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 e63deb482..e7f26bcb0 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; @@ -204,14 +201,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 14L"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** @@ -226,7 +220,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -429,7 +423,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 745c3d43c..5da9d8b1a 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; @@ -204,14 +201,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 14M"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** @@ -226,7 +220,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -429,7 +423,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 1c05f05d7..55357c953 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; @@ -204,14 +201,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 14N"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** @@ -226,7 +220,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -429,7 +423,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 2df65e579..4a7e703b1 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; @@ -204,14 +201,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 14O"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** @@ -226,7 +220,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -429,7 +423,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 22d51802e..d9c635df6 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; @@ -267,11 +264,9 @@ 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); } /** @@ -286,7 +281,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -553,32 +548,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) { @@ -608,27 +585,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); @@ -764,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 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 5e867942a..6b6c86829 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; @@ -206,14 +203,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 151"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** @@ -228,7 +222,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -394,32 +388,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) { @@ -449,27 +425,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); @@ -540,7 +502,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 233c4e491..691dbf446 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; @@ -206,14 +203,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 152"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** @@ -228,7 +222,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -394,32 +388,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) { @@ -449,27 +425,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); @@ -540,7 +502,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 396952f7c..1b9f7ce28 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; @@ -206,14 +203,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 153"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** @@ -228,7 +222,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -394,32 +388,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) { @@ -449,27 +425,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); @@ -540,7 +502,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 3cb2254f1..5cc77e562 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; @@ -199,14 +196,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 15A"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** @@ -221,7 +215,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -404,7 +398,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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)); } @@ -419,13 +413,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 43afdd9ae..6777eaf40 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; @@ -199,14 +196,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 15B"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** @@ -221,7 +215,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -404,7 +398,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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)); } @@ -419,13 +413,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 48827bf76..02968b461 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; @@ -199,14 +196,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 15C"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** @@ -221,7 +215,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -404,7 +398,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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)); } @@ -419,13 +413,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 c58922698..82ad2d5af 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; @@ -199,14 +196,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 15D"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** @@ -221,7 +215,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -404,7 +398,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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)); } @@ -419,13 +413,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 667bceaf6..639e8ce39 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; @@ -199,14 +196,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 15E"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** @@ -221,7 +215,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -404,7 +398,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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)); } @@ -419,13 +413,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 0711f6158..2279132ac 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; @@ -199,14 +196,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 15F"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** @@ -221,7 +215,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -404,7 +398,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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)); } @@ -419,13 +413,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 416a21cf3..4da34fba9 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; @@ -199,14 +196,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 15G"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** @@ -221,7 +215,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -404,7 +398,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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)); } @@ -419,13 +413,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 28b0e7e03..4b91346d3 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; @@ -199,14 +196,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 15H"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** @@ -221,7 +215,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -404,7 +398,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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)); } @@ -419,13 +413,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 7b899fc6a..66a2de441 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; @@ -199,14 +196,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 15I"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** @@ -221,7 +215,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -404,7 +398,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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)); } @@ -419,13 +413,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 4b432d205..78101daed 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; @@ -199,14 +196,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 15J"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** @@ -221,7 +215,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -404,7 +398,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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)); } @@ -419,13 +413,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 a158eabe0..a026968d3 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; @@ -199,14 +196,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 15K"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** @@ -221,7 +215,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -404,7 +398,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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)); } @@ -419,13 +413,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 dfa8f785c..9cbfd59d7 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; @@ -199,14 +196,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 15L"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** @@ -221,7 +215,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -404,7 +398,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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)); } @@ -419,13 +413,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 7942e4abd..7a2da7e56 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; @@ -199,14 +196,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 15M"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** @@ -221,7 +215,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -404,7 +398,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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)); } @@ -419,13 +413,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 7c9068912..3006803e7 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; @@ -199,14 +196,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 15N"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** @@ -221,7 +215,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -404,7 +398,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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)); } @@ -419,13 +413,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 3b1247928..563449c94 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; @@ -199,14 +196,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 15O"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** @@ -221,7 +215,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -404,7 +398,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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)); } @@ -419,13 +413,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 43e72fff7..1d023f935 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; @@ -199,14 +196,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 15P"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** @@ -221,7 +215,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -404,7 +398,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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)); } @@ -419,13 +413,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 7c7042bad..76f8d9d0f 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; @@ -221,11 +218,9 @@ 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); } /** @@ -240,7 +235,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -483,7 +478,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 fe186f556..feeeb084f 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; @@ -206,14 +203,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 16A"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** @@ -228,7 +222,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -394,32 +388,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) { @@ -449,27 +425,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); @@ -540,7 +502,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 ac786a9a8..27a294eec 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; @@ -206,14 +203,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 16C"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** @@ -228,7 +222,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -394,32 +388,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) { @@ -449,27 +425,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); @@ -540,7 +502,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 111a0e36c..b4b9e2541 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; @@ -204,14 +201,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 16R"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** @@ -226,7 +220,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -429,7 +423,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 e14f208f6..3454f030b 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; @@ -204,14 +201,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 16S"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** @@ -226,7 +220,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -429,7 +423,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 b7bb4c110..b082c3a8e 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; @@ -207,16 +204,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 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; } @@ -233,7 +228,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -417,6 +412,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); } @@ -494,7 +490,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 ce1a22779..c4573aa5b 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; @@ -231,13 +228,12 @@ 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; } @@ -254,7 +250,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -519,6 +515,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); } @@ -597,7 +594,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 8a7305478..bcfab069f 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; @@ -207,17 +204,15 @@ public String getValue() { */ @Override 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; } @@ -234,7 +229,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -419,6 +414,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); } @@ -497,7 +493,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 36c491888..ddfdc6435 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; @@ -205,14 +202,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 174"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** @@ -227,7 +221,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type 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,7 +464,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 4a2287910..4ed1f2ae6 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; @@ -205,16 +202,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 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; } @@ -231,7 +226,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -474,7 +469,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 729219d29..dd57a3242 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; @@ -207,17 +204,15 @@ public String getValue() { */ @Override 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; } @@ -234,7 +229,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -419,6 +414,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); } @@ -497,7 +493,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 17a8ca4dc..7bb0fff79 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; @@ -200,16 +197,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 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; } @@ -226,7 +221,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -429,7 +424,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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)); } @@ -444,13 +439,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 a63a7687e..78d1abae3 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; @@ -204,14 +201,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 17A"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** @@ -226,7 +220,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -429,7 +423,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 5e70b8c94..f29287cc6 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; @@ -222,11 +219,9 @@ 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); } /** @@ -241,7 +236,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -427,6 +422,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; } @@ -437,6 +433,7 @@ public String getDSS() { * @see #getDSS() * @return true if DSS is present, false otherwise. */ + @Override public boolean isDSSPresent() { return false; } @@ -451,6 +448,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); } @@ -518,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 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 cee35dc6c..ba3f829b1 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; @@ -204,14 +201,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 17C"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** @@ -226,7 +220,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -429,7 +423,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 5484bdc60..1a6cd5a08 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; @@ -204,14 +201,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 17E"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** @@ -226,7 +220,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -429,7 +423,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 a3263e18a..693d819df 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; @@ -204,14 +201,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 17F"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** @@ -226,7 +220,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -429,7 +423,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 4d4a3e839..a05ac9571 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; @@ -204,14 +201,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 17G"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** @@ -226,7 +220,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -429,7 +423,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 726c5a4ca..387136083 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; @@ -204,14 +201,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 17H"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** @@ -226,7 +220,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -429,7 +423,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 ff1524fcb..e8dc28d32 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; @@ -204,14 +201,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 17I"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** @@ -226,7 +220,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -429,7 +423,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 0bb11d33a..ae3193637 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; @@ -204,14 +201,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 17L"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** @@ -226,7 +220,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -429,7 +423,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 3a96aba8f..804b2af71 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; @@ -204,14 +201,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 17M"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** @@ -226,7 +220,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -429,7 +423,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 9d9abb33e..4fd87a4d1 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; @@ -204,14 +201,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 17N"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** @@ -226,7 +220,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -429,7 +423,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 c412b5092..72dff044a 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; @@ -204,14 +201,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 17O"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** @@ -226,7 +220,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -429,7 +423,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 8b1d44096..1b7a75916 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; @@ -204,14 +201,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 17P"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** @@ -226,7 +220,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -429,7 +423,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 f34ea3a17..5b3fa131a 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; @@ -204,14 +201,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 17Q"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** @@ -226,7 +220,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -429,7 +423,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 d0264bf29..16c2b0868 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; @@ -204,14 +201,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 17R"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** @@ -226,7 +220,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -429,7 +423,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 d74579f42..8e18dec1b 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; @@ -204,14 +201,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 17S"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** @@ -226,7 +220,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -429,7 +423,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 8c66a1f1f..b6b8f7a5b 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; @@ -204,14 +201,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 17T"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** @@ -226,7 +220,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -429,7 +423,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 6ea0abcab..ab3eb5afa 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; @@ -204,14 +201,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 17U"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** @@ -226,7 +220,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -429,7 +423,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 03a06e7b1..5068b05e6 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; @@ -204,14 +201,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 17V"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** @@ -226,7 +220,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -429,7 +423,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 84abe4fd2..59010fc4a 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; @@ -204,14 +201,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 17W"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** @@ -226,7 +220,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -429,7 +423,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 7de5dd9fe..bad1f3677 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; @@ -204,14 +201,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 17X"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** @@ -226,7 +220,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -429,7 +423,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 01b72d439..26f6df6d1 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; @@ -204,14 +201,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 17Y"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** @@ -226,7 +220,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -429,7 +423,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 8cc4a7040..c366773e3 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; @@ -204,14 +201,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 17Z"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** @@ -226,7 +220,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -429,7 +423,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 38ca6fb98..1f15059fe 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; @@ -206,14 +203,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 18A"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** @@ -228,7 +222,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -394,32 +388,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) { @@ -449,27 +425,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); @@ -540,7 +502,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 d48812fb0..9df5cbc42 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; @@ -206,14 +203,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 18B"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** @@ -228,7 +222,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -394,32 +388,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) { @@ -449,27 +425,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); @@ -540,7 +502,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 ebd869fa2..46a64d705 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; @@ -206,14 +203,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 18C"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** @@ -228,7 +222,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -394,32 +388,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) { @@ -449,27 +425,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); @@ -540,7 +502,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 3acf6689f..ff13c0650 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; @@ -206,14 +203,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 18D"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** @@ -228,7 +222,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -394,32 +388,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) { @@ -449,27 +425,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); @@ -540,7 +502,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 ead0f42d3..c61bfc3a2 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; @@ -208,17 +205,15 @@ public String getValue() { */ @Override 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; } @@ -235,7 +230,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type 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,32 +395,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) { @@ -457,27 +433,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); @@ -500,6 +462,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); } @@ -568,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 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 d688f2f60..e3be49b2c 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; @@ -199,14 +196,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 199"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** @@ -221,7 +215,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -404,7 +398,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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)); } @@ -419,13 +413,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 d35961f90..0536f1ad7 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; @@ -267,14 +264,13 @@ 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; } @@ -291,7 +287,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type 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,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) { @@ -716,53 +693,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); } @@ -783,6 +752,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); } @@ -794,6 +764,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; } @@ -804,6 +775,7 @@ public String getDSS() { * @see #getDSS() * @return true if DSS is present, false otherwise. */ + @Override public boolean isDSSPresent() { return false; } @@ -818,6 +790,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); } @@ -885,7 +858,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 24db87ad4..f17a1e952 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; @@ -247,14 +244,13 @@ 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; } @@ -271,7 +267,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -596,32 +592,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) { @@ -653,53 +630,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); } @@ -720,6 +689,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); } @@ -731,6 +701,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; } @@ -741,6 +712,7 @@ public String getDSS() { * @see #getDSS() * @return true if DSS is present, false otherwise. */ + @Override public boolean isDSSPresent() { return false; } @@ -755,6 +727,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); } @@ -822,7 +795,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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/Field19C.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field19C.java index 27b35f17a..642cc4585 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field19C.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field19C.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; @@ -229,14 +226,13 @@ 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; } @@ -253,7 +249,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -492,32 +488,13 @@ public Field19C 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 Adjustment Factor content to set - * @return the field object to enable build pattern - */ - public Field19C setComponent2(java.math.BigDecimal component2) { - setComponent(2, SwiftFormatUtils.getBigDecimal(component2)); - return this; - } /** * Alternative method setter for field's Adjustment Factor (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 Adjustment Factor content to set * @return the field object to enable build pattern - * @see #setAdjustmentFactor(java.math.BigDecimal) */ public Field19C setComponent2(java.lang.Number component2) { @@ -549,27 +526,13 @@ public Field19C setAdjustmentFactor(String component2) { return setComponent2(component2); } - /** - * Set the Adjustment Factor (component 2) from a BigDecimal object. - * - * @see #setComponent2(java.math.BigDecimal) - * - * @param component2 BigDecimal with the Adjustment Factor content to set - * @return the field object to enable build pattern - * @since 9.2.7 - */ - public Field19C setAdjustmentFactor(java.math.BigDecimal component2) { - return setComponent2(component2); - } - /** * Alternative method setter for field's Adjustment Factor (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 Adjustment Factor content to set * @return the field object to enable build pattern - * @see #setAdjustmentFactor(java.math.BigDecimal) */ public Field19C setAdjustmentFactor(java.lang.Number component2) { return setComponent2(component2); @@ -584,16 +547,6 @@ public Field19C setAmount(String component2) { return setAdjustmentFactor(component2); } - /** - * @deprecated use #setComponent2(java.math.BigDecimal) instead - * @since 9.2.7 - */ - @Deprecated - @ProwideDeprecated(phase4 = TargetYear.SRU2024) - public Field19C setAmount(java.math.BigDecimal component2) { - return setAdjustmentFactor(component2); - } - /** * @deprecated use #setAdjustmentFactor(java.math.BigDecimal) instead */ @@ -620,6 +573,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); } @@ -688,7 +642,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field19C(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field19Y.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field19Y.java index 5c5bb9a1b..c19f5af43 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field19Y.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field19Y.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; @@ -215,17 +212,15 @@ public String getValue() { */ @Override public String getValueDisplay(int component, Locale locale) { - if (component < 1 || component > 1) { + if (component != 1) { throw new IllegalArgumentException("invalid component number " + component + " for field 19Y"); } - 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; } @@ -242,7 +237,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type 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,32 +433,13 @@ public Field19Y 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 Weight content to set - * @return the field object to enable build pattern - */ - public Field19Y setComponent1(java.math.BigDecimal component1) { - setComponent(1, SwiftFormatUtils.getBigDecimal(component1)); - return this; - } /** * Alternative method setter for field's Weight (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 Weight content to set * @return the field object to enable build pattern - * @see #setWeight(java.math.BigDecimal) */ public Field19Y setComponent1(java.lang.Number component1) { @@ -495,27 +471,13 @@ public Field19Y setWeight(String component1) { return setComponent1(component1); } - /** - * Set the Weight (component 1) from a BigDecimal object. - * - * @see #setComponent1(java.math.BigDecimal) - * - * @param component1 BigDecimal with the Weight content to set - * @return the field object to enable build pattern - * @since 9.2.7 - */ - public Field19Y setWeight(java.math.BigDecimal component1) { - return setComponent1(component1); - } - /** * Alternative method setter for field's Weight (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 Weight content to set * @return the field object to enable build pattern - * @see #setWeight(java.math.BigDecimal) */ public Field19Y setWeight(java.lang.Number component1) { return setComponent1(component1); @@ -530,16 +492,6 @@ public Field19Y setAmount(String component1) { return setWeight(component1); } - /** - * @deprecated use #setComponent1(java.math.BigDecimal) instead - * @since 9.2.7 - */ - @Deprecated - @ProwideDeprecated(phase4 = TargetYear.SRU2024) - public Field19Y setAmount(java.math.BigDecimal component1) { - return setWeight(component1); - } - /** * @deprecated use #setWeight(java.math.BigDecimal) instead */ @@ -566,6 +518,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); } @@ -634,7 +587,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field19Y(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field19Z.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field19Z.java index ec6624b7c..40a548697 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field19Z.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field19Z.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; @@ -215,17 +212,15 @@ public String getValue() { */ @Override public String getValueDisplay(int component, Locale locale) { - if (component < 1 || component > 1) { + if (component != 1) { throw new IllegalArgumentException("invalid component number " + component + " for field 19Z"); } - 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; } @@ -242,7 +237,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type 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,32 +433,13 @@ public Field19Z 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 Weight content to set - * @return the field object to enable build pattern - */ - public Field19Z setComponent1(java.math.BigDecimal component1) { - setComponent(1, SwiftFormatUtils.getBigDecimal(component1)); - return this; - } /** * Alternative method setter for field's Weight (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 Weight content to set * @return the field object to enable build pattern - * @see #setWeight(java.math.BigDecimal) */ public Field19Z setComponent1(java.lang.Number component1) { @@ -495,27 +471,13 @@ public Field19Z setWeight(String component1) { return setComponent1(component1); } - /** - * Set the Weight (component 1) from a BigDecimal object. - * - * @see #setComponent1(java.math.BigDecimal) - * - * @param component1 BigDecimal with the Weight content to set - * @return the field object to enable build pattern - * @since 9.2.7 - */ - public Field19Z setWeight(java.math.BigDecimal component1) { - return setComponent1(component1); - } - /** * Alternative method setter for field's Weight (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 Weight content to set * @return the field object to enable build pattern - * @see #setWeight(java.math.BigDecimal) */ public Field19Z setWeight(java.lang.Number component1) { return setComponent1(component1); @@ -530,16 +492,6 @@ public Field19Z setAmount(String component1) { return setWeight(component1); } - /** - * @deprecated use #setComponent1(java.math.BigDecimal) instead - * @since 9.2.7 - */ - @Deprecated - @ProwideDeprecated(phase4 = TargetYear.SRU2024) - public Field19Z setAmount(java.math.BigDecimal component1) { - return setWeight(component1); - } - /** * @deprecated use #setWeight(java.math.BigDecimal) instead */ @@ -566,6 +518,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); } @@ -634,7 +587,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field19Z(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 fc57fd941..71c8cd3fc 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; @@ -204,14 +201,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 20"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** @@ -226,7 +220,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -429,7 +423,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 351ac7bc3..0fb54b854 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; @@ -206,14 +203,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 202"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** @@ -228,7 +222,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -394,32 +388,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) { @@ -449,27 +425,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); @@ -540,7 +502,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 28afaf1ab..0aee5326b 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; @@ -206,14 +203,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 203"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** @@ -228,7 +222,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -394,32 +388,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) { @@ -449,27 +425,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); @@ -540,7 +502,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 a9e45c628..319dbaf35 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; @@ -204,14 +201,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 204"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** @@ -226,7 +220,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -429,7 +423,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 36237d297..b95f75981 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; @@ -204,14 +201,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 206"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** @@ -226,7 +220,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type 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,7 +463,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 d3f2cd81b..291d43919 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; @@ -204,14 +201,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 208"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** @@ -226,7 +220,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type 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,7 +463,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 a5680bb22..c7393cbc0 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; @@ -206,14 +203,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 209"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** @@ -228,7 +222,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -394,32 +388,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) { @@ -449,27 +425,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); @@ -540,7 +502,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 f6eb41ca9..d9e04bccb 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; @@ -222,11 +219,9 @@ 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); } /** @@ -241,7 +236,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -427,6 +422,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; } @@ -437,6 +433,7 @@ public String getDSS() { * @see #getDSS() * @return true if DSS is present, false otherwise. */ + @Override public boolean isDSSPresent() { return false; } @@ -451,6 +448,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); } @@ -518,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 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 cb7c9d60d..dcf646dde 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; @@ -222,11 +219,9 @@ 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); } /** @@ -241,7 +236,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -427,6 +422,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; } @@ -437,6 +433,7 @@ public String getDSS() { * @see #getDSS() * @return true if DSS is present, false otherwise. */ + @Override public boolean isDSSPresent() { return false; } @@ -451,6 +448,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); } @@ -518,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 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 c9c816658..75b4c1ce5 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; @@ -222,11 +219,9 @@ 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); } /** @@ -241,7 +236,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -427,6 +422,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; } @@ -437,6 +433,7 @@ public String getDSS() { * @see #getDSS() * @return true if DSS is present, false otherwise. */ + @Override public boolean isDSSPresent() { return false; } @@ -451,6 +448,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); } @@ -518,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 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 6312f84ab..25982d09c 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; @@ -204,14 +201,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 21"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** @@ -226,7 +220,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -429,7 +423,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 eaaf6bfd7..2013a775b 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; @@ -204,14 +201,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 21A"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** @@ -226,7 +220,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -429,7 +423,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 d4a0fc5ad..373a9cc0d 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; @@ -216,14 +213,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 21B"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** @@ -238,7 +232,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -477,7 +471,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 537f495f7..e958a9989 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; @@ -204,14 +201,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 21C"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** @@ -226,7 +220,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -429,7 +423,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 96f1ecafb..f694b0556 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; @@ -204,14 +201,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 21D"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** @@ -226,7 +220,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -429,7 +423,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 b7726ae2d..f1a911451 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; @@ -204,14 +201,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 21E"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** @@ -226,7 +220,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -429,7 +423,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 f5a098d48..23d7e6563 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; @@ -204,14 +201,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 21F"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** @@ -226,7 +220,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -429,7 +423,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 c9d5c1342..9812b1583 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; @@ -204,14 +201,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 21G"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** @@ -226,7 +220,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -429,7 +423,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 5eb3e53f7..80e99042d 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; @@ -227,11 +224,9 @@ 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); } /** @@ -246,7 +241,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -511,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 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 9332bf084..8be6469b6 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; @@ -216,14 +213,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 21N"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** @@ -238,7 +232,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -477,7 +471,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 b59bb9092..b6bbf205b 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; @@ -204,14 +201,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 21P"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** @@ -226,7 +220,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -429,7 +423,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 bd2e9c0d7..1912a8fa3 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; @@ -204,14 +201,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 21R"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** @@ -226,7 +220,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -429,7 +423,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 fbd5d858c..4da003193 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; @@ -220,11 +217,9 @@ 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); } /** @@ -239,7 +234,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -482,7 +477,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 7268ec99a..2bfb09d52 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; @@ -216,14 +213,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 22A"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** @@ -238,7 +232,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -477,7 +471,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 feb723af9..263f84ee3 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; @@ -216,14 +213,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 22B"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** @@ -238,7 +232,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -477,7 +471,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 b7884ff17..6ba019698 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; @@ -265,11 +262,9 @@ 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); } /** @@ -284,7 +279,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -568,32 +563,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) { @@ -623,27 +600,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); @@ -756,7 +719,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 cfd3e0717..51db77ce2 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; @@ -216,14 +213,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 22D"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** @@ -238,7 +232,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -477,7 +471,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 48ddd757a..cfede4bee 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; @@ -210,14 +207,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 22E"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** @@ -232,7 +226,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type 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 +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 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 bcfa3fe33..944aa9d2a 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; @@ -235,11 +232,9 @@ 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); } /** @@ -254,7 +249,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -483,6 +478,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(); } @@ -493,6 +489,7 @@ public String getDSS() { * @see #getDSS() * @return true if DSS is present, false otherwise. */ + @Override public boolean isDSSPresent() { return getComponent2() != null; } @@ -507,6 +504,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); } @@ -574,7 +572,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 eee71a303..8083646b9 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; @@ -216,14 +213,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 22G"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** @@ -238,7 +232,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -477,7 +471,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 7674c3790..34579204f 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; @@ -229,11 +226,9 @@ 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); } /** @@ -248,7 +243,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type 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 Field22H setCode(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; } @@ -466,6 +462,7 @@ public String getDSS() { * @see #getDSS() * @return true if DSS is present, false otherwise. */ + @Override public boolean isDSSPresent() { return false; } @@ -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 Field22H(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field22J.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field22J.java index 6f92e8168..df03220a2 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field22J.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field22J.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; @@ -211,14 +208,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 22J"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** @@ -233,7 +227,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type 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,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 Field22J(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 342399a26..b7e041493 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; @@ -227,11 +224,9 @@ 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); } /** @@ -246,7 +241,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type 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,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 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 7ac2d901c..569bbe070 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; @@ -211,14 +208,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 22L"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** @@ -233,7 +227,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type 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,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 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 5f805cd38..4c30e7cd9 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; @@ -223,14 +220,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 22M"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** @@ -245,7 +239,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -506,7 +500,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 ec2c22c4c..1881f9f31 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; @@ -204,14 +201,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 22N"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** @@ -226,7 +220,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -429,7 +423,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 40f2a20ba..89fea3620 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; @@ -223,14 +220,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 22P"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** @@ -245,7 +239,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -506,7 +500,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 9d0b32c84..793181af2 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; @@ -211,14 +208,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 22Q"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** @@ -233,7 +227,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type 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,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 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 852c8011c..8cb996075 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; @@ -204,14 +201,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 22R"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** @@ -226,7 +220,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -429,7 +423,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 0dc4052dc..e826dcf4c 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; @@ -220,11 +217,9 @@ 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); } /** @@ -239,7 +234,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -482,7 +477,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 7e193ffe2..ef42fd790 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; @@ -204,14 +201,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 22T"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** @@ -226,7 +220,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -429,7 +423,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 23a0ac510..294c2fe0d 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; @@ -204,14 +201,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 22U"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** @@ -226,7 +220,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -429,7 +423,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 4e2e8f8eb..0fabded26 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; @@ -204,14 +201,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 22V"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** @@ -226,7 +220,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -429,7 +423,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 09ce255a7..047ec0e96 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; @@ -204,14 +201,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 22W"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** @@ -226,7 +220,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -429,7 +423,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 989dc494b..a05c61596 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; @@ -204,14 +201,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 22X"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** @@ -226,7 +220,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -429,7 +423,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 e16b1c7ee..cbfb03c09 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; @@ -217,14 +214,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 22Y"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** @@ -239,7 +233,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -482,7 +476,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 5cded64e8..cd1772c77 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; @@ -204,14 +201,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 22Z"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** @@ -226,7 +220,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -429,7 +423,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 d2998a428..75d6432db 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; @@ -286,11 +283,9 @@ 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); } /** @@ -305,7 +300,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -700,26 +695,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); } @@ -788,7 +789,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 9e9593e44..de2397866 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; @@ -234,11 +231,9 @@ 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); } /** @@ -253,7 +248,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type 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,7 +535,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 916a79d56..fe4c3d8b9 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; @@ -204,14 +201,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 23B"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** @@ -226,7 +220,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -429,7 +423,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 a772d718b..387ec1cc3 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; @@ -211,14 +208,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 23C"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** @@ -233,7 +227,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type 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,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 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 db07575cb..27b668100 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; @@ -204,14 +201,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 23D"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** @@ -226,7 +220,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -429,7 +423,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 7d4b92ddf..a47c0b070 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; @@ -240,11 +237,9 @@ 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); } /** @@ -259,7 +254,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -563,7 +558,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 594b1b497..86205423f 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; @@ -221,11 +218,9 @@ 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); } /** @@ -240,7 +235,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -486,7 +481,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 d8c273640..f7e109645 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; @@ -221,11 +218,9 @@ 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); } /** @@ -240,7 +235,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -486,7 +481,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 4c54b496c..e797832f6 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; @@ -204,14 +201,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 23H"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** @@ -226,7 +220,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -429,7 +423,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 efeb71582..6819ef5f8 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; @@ -244,11 +241,9 @@ 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); } /** @@ -263,7 +258,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -764,7 +759,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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)); } @@ -780,6 +775,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); } @@ -793,6 +789,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); @@ -805,6 +802,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()); } @@ -817,6 +815,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)); @@ -831,6 +830,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); } @@ -845,6 +845,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 77a580d2d..935153ba9 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; @@ -204,14 +201,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 23S"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** @@ -226,7 +220,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -429,7 +423,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 9a4cc6830..ded878ffc 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; @@ -220,11 +217,9 @@ 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); } /** @@ -239,7 +234,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -482,7 +477,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 b305ad454..0af3c9539 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; @@ -204,14 +201,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 242"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** @@ -226,7 +220,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -429,7 +423,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 85e1e501c..ab98e40e8 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; @@ -206,14 +203,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 243"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** @@ -228,7 +222,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -394,32 +388,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) { @@ -449,27 +425,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); @@ -540,7 +502,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 1585bd2c8..41823ac21 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; @@ -235,11 +232,9 @@ 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); } /** @@ -254,7 +249,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -483,6 +478,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(); } @@ -493,6 +489,7 @@ public String getDSS() { * @see #getDSS() * @return true if DSS is present, false otherwise. */ + @Override public boolean isDSSPresent() { return getComponent2() != null; } @@ -507,6 +504,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); } @@ -574,7 +572,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 6e42505e7..0c0b2b7a6 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; @@ -227,11 +224,9 @@ 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); } /** @@ -246,7 +241,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type 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,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 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 a73a34d32..991956c7b 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; @@ -221,11 +218,9 @@ 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); } /** @@ -240,7 +235,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -486,7 +481,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 d1d8c105f..ff923a792 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; @@ -281,11 +278,9 @@ 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); } /** @@ -300,7 +295,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -1350,7 +1345,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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)); } @@ -1366,6 +1361,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); } @@ -1379,6 +1375,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); @@ -1391,6 +1388,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()); } @@ -1403,6 +1401,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)); @@ -1417,6 +1416,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); } @@ -1431,6 +1431,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 2a09c4694..231a3c9c1 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; @@ -204,14 +201,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 25"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** @@ -226,7 +220,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type 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 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 2321b9c86..06d2c088f 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; @@ -205,14 +202,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 251"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** @@ -227,7 +221,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type 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,7 +464,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 918b2b248..3dbc5c2ef 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; @@ -259,13 +256,12 @@ 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; } @@ -282,7 +278,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -765,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 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 59d8c849e..784f7c5d0 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; @@ -205,14 +202,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 253"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** @@ -227,7 +221,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type 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,7 +464,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 1bc86c9cf..a106db500 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; @@ -259,13 +256,12 @@ 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; } @@ -282,7 +278,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -765,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 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 48d3f4aa0..09867c0b4 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; @@ -295,13 +292,12 @@ 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; } @@ -318,7 +314,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type 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,32 +687,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) { @@ -746,27 +724,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); @@ -931,6 +895,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); } @@ -1008,7 +973,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 4d8056bb9..c971dd64f 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; @@ -295,13 +292,12 @@ 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; } @@ -318,7 +314,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -729,32 +725,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) { @@ -784,27 +762,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); @@ -821,32 +785,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) { @@ -876,27 +822,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); @@ -1040,6 +972,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); } @@ -1117,7 +1050,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 1f5e01a55..b2c5debb8 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; @@ -285,11 +282,9 @@ 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); } /** @@ -304,7 +299,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -790,32 +785,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) { @@ -845,27 +822,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); @@ -877,6 +840,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); } @@ -954,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 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 d52f818e9..896c90d2e 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; @@ -295,13 +292,12 @@ 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; } @@ -318,7 +314,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type 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,32 +687,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) { @@ -746,27 +724,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); @@ -931,6 +895,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); } @@ -1008,7 +973,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 459f61244..094d63132 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; @@ -290,13 +287,12 @@ 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; } @@ -313,7 +309,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -724,32 +720,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) { @@ -779,27 +757,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); @@ -816,32 +780,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) { @@ -871,27 +817,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); @@ -1035,6 +967,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); } @@ -1112,7 +1045,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 e89f971e3..2500da0d3 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; @@ -205,14 +202,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 25A"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** @@ -227,7 +221,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type 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 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 9d30f1025..e2e6738c5 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; @@ -242,11 +239,9 @@ 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); } /** @@ -261,7 +256,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -512,6 +507,7 @@ public Field25D setCode(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(); } @@ -522,6 +518,7 @@ public String getDSS() { * @see #getDSS() * @return true if DSS is present, false otherwise. */ + @Override public boolean isDSSPresent() { return getComponent2() != null; } @@ -536,6 +533,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); } @@ -603,7 +601,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 87612f949..6a1edceec 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; @@ -234,11 +231,9 @@ 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); } /** @@ -253,7 +248,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -524,10 +519,12 @@ public Field25P setBIC(com.prowidesoftware.swift.model.BIC component2) { } + @Override public List bics() { return BICResolver.bics(this); } + @Override public List bicStrings () { return BICResolver.bicStrings(this); } @@ -596,7 +593,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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)); } @@ -612,6 +609,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); } @@ -625,6 +623,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); @@ -637,6 +636,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()); } @@ -649,6 +649,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)); @@ -663,6 +664,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); } @@ -677,6 +679,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 718ac8b32..b84e974a3 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; @@ -285,11 +282,9 @@ 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); } /** @@ -304,7 +299,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -790,32 +785,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) { @@ -845,27 +822,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); @@ -877,6 +840,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); } @@ -954,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 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 e69c8b6cf..d2ab08e5f 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; @@ -285,11 +282,9 @@ 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); } /** @@ -304,7 +299,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -790,32 +785,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) { @@ -845,27 +822,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); @@ -877,6 +840,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); } @@ -954,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 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 860d0a3f8..0303dbf88 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; @@ -285,11 +282,9 @@ 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); } /** @@ -304,7 +299,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -790,32 +785,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) { @@ -845,27 +822,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); @@ -877,6 +840,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); } @@ -954,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 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 8a4f61de6..7a0c6b4a1 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; @@ -221,11 +218,9 @@ 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); } /** @@ -240,7 +235,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -486,7 +481,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 7facd7c15..e812cbf77 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; @@ -204,14 +201,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 26B"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** @@ -226,7 +220,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -429,7 +423,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 56f476bd3..346ed9efb 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; @@ -291,11 +288,9 @@ 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); } /** @@ -310,7 +305,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -722,7 +717,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 477e4d369..83c88d5a0 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; @@ -354,11 +351,9 @@ 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); } /** @@ -373,7 +368,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -1863,7 +1858,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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)); } @@ -1879,6 +1874,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); } @@ -1892,6 +1888,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); @@ -1904,6 +1901,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()); } @@ -1916,6 +1914,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)); @@ -1930,6 +1929,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); } @@ -1944,6 +1944,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/Field26E.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field26E.java index 8b6b355c8..69e5b52ba 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field26E.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field26E.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; @@ -219,14 +216,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 26E"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** @@ -241,7 +235,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type 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,32 +460,14 @@ public Field26E 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 Of Amendment content to set - * @return the field object to enable build pattern - */ - public Field26E setComponent1(java.lang.Long component1) { - setComponent(1, SwiftFormatUtils.getLong(component1)); - return this; - } /** * Alternative method setter for field's Number Of Amendment (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 Of Amendment content to set * @return the field object to enable build pattern - * @see #setNumberOfAmendment(java.lang.Long) */ public Field26E setComponent1(java.lang.Number component1) { @@ -521,27 +497,13 @@ public Field26E setNumberOfAmendment(String component1) { return setComponent1(component1); } - /** - * Set the Number Of Amendment (component 1) from a Long object. - * - * @see #setComponent1(java.lang.Long) - * - * @param component1 Long with the Number Of Amendment content to set - * @return the field object to enable build pattern - * @since 9.2.7 - */ - public Field26E setNumberOfAmendment(java.lang.Long component1) { - return setComponent1(component1); - } - /** * Alternative method setter for field's Number Of Amendment (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 Of Amendment content to set * @return the field object to enable build pattern - * @see #setNumberOfAmendment(java.lang.Long) */ public Field26E setNumberOfAmendment(java.lang.Number component1) { return setComponent1(component1); @@ -554,14 +516,6 @@ public Field26E setAutomaticExtensionNotificationPeriod(String component1) { return setNumberOfAmendment(component1); } - /** - * @deprecated use #setComponent1(java.lang.Long) instead - * @since 9.2.7 - */ - public Field26E setAutomaticExtensionNotificationPeriod(java.lang.Long component1) { - return setNumberOfAmendment(component1); - } - /** * @deprecated use #setNumberOfAmendment(java.lang.Long) instead */ @@ -578,16 +532,6 @@ public Field26E setNumber(String component1) { return setNumberOfAmendment(component1); } - /** - * @deprecated use #setComponent1(java.lang.Long) instead - * @since 9.2.7 - */ - @Deprecated - @ProwideDeprecated(phase4 = TargetYear.SRU2024) - public Field26E setNumber(java.lang.Long component1) { - return setNumberOfAmendment(component1); - } - /** * @deprecated use #setNumberOfAmendment(java.lang.Long) instead */ @@ -662,7 +606,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field26E(f)); } 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 c48be97e0..c3ef3a2f4 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; @@ -204,14 +201,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 26F"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** @@ -226,7 +220,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -429,7 +423,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 8a11e2e97..1ca84f671 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; @@ -217,14 +214,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 26H"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** @@ -239,7 +233,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -482,7 +476,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 3102576a1..137b58bec 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; @@ -204,14 +201,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 26K"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** @@ -226,7 +220,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -429,7 +423,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 ba51687d2..770cd04ad 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; @@ -204,14 +201,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 26T"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** @@ -226,7 +220,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -429,7 +423,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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/Field27.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field27.java index 575f0f8ac..c8556daf0 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field27.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field27.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,11 +231,9 @@ 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); } /** @@ -253,7 +248,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -532,32 +527,14 @@ public Field27 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 Field27 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 Field27 setComponent1(java.lang.Number component1) { @@ -587,27 +564,13 @@ public Field27 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 Field27 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 Field27 setNumber(java.lang.Number component1) { return setComponent1(component1); @@ -620,14 +583,6 @@ public Field27 setMessageNumber(String component1) { return setNumber(component1); } - /** - * @deprecated use #setComponent1(java.lang.Long) instead - * @since 9.2.7 - */ - public Field27 setMessageNumber(java.lang.Long component1) { - return setNumber(component1); - } - /** * @deprecated use #setNumber(java.lang.Long) instead */ @@ -646,32 +601,14 @@ public Field27 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 Field27 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 Field27 setComponent2(java.lang.Number component2) { @@ -701,27 +638,13 @@ public Field27 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 Field27 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 Field27 setTotal(java.lang.Number component2) { return setComponent2(component2); @@ -734,14 +657,6 @@ public Field27 setSequenceNumber(String component2) { return setTotal(component2); } - /** - * @deprecated use #setComponent2(java.lang.Long) instead - * @since 9.2.7 - */ - public Field27 setSequenceNumber(java.lang.Long component2) { - return setTotal(component2); - } - /** * @deprecated use #setTotal(java.lang.Long) instead */ @@ -814,7 +729,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field27(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 6187a8129..9f9c58f43 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; @@ -232,11 +229,9 @@ 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); } /** @@ -251,7 +246,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -476,6 +471,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); } @@ -554,7 +550,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 b12f7a610..209de01fb 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; @@ -232,11 +229,9 @@ 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); } /** @@ -251,7 +246,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -476,6 +471,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); } @@ -554,7 +550,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 e4f76c7a4..530c4f0e9 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; @@ -232,11 +229,9 @@ 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); } /** @@ -251,7 +246,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -476,6 +471,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); } @@ -554,7 +550,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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/Field28.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field28.java index 81d1a5bc3..f71b4b341 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field28.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field28.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; @@ -235,11 +232,9 @@ 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); } /** @@ -254,7 +249,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type 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,32 +531,14 @@ public Field28 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 Field28 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 Field28 setComponent1(java.lang.Number component1) { @@ -591,27 +568,13 @@ public Field28 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 Field28 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 Field28 setStatementNumber(java.lang.Number component1) { return setComponent1(component1); @@ -624,14 +587,6 @@ public Field28 setSettlementNumber(String component1) { return setStatementNumber(component1); } - /** - * @deprecated use #setComponent1(java.lang.Long) instead - * @since 9.2.7 - */ - public Field28 setSettlementNumber(java.lang.Long component1) { - return setStatementNumber(component1); - } - /** * @deprecated use #setStatementNumber(java.lang.Long) instead */ @@ -650,32 +605,14 @@ public Field28 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 Field28 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 Field28 setComponent2(java.lang.Number component2) { @@ -705,27 +642,13 @@ public Field28 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 Field28 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 Field28 setSequenceNumber(java.lang.Number component2) { return setComponent2(component2); @@ -738,14 +661,6 @@ public Field28 setPageNumber(String component2) { return setSequenceNumber(component2); } - /** - * @deprecated use #setComponent2(java.lang.Long) instead - * @since 9.2.7 - */ - public Field28 setPageNumber(java.lang.Long component2) { - return setSequenceNumber(component2); - } - /** * @deprecated use #setSequenceNumber(java.lang.Long) instead */ @@ -818,7 +733,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field28(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 a6ba62e65..ff21248b3 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; @@ -256,11 +253,9 @@ 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); } /** @@ -275,7 +270,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -718,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 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 3559cc055..d74e294c0 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; @@ -256,11 +253,9 @@ 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); } /** @@ -275,7 +270,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -718,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 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 c23b0079e..3371182bd 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; @@ -223,11 +220,9 @@ 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); } /** @@ -242,7 +237,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -468,32 +463,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) { @@ -523,27 +500,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); @@ -560,32 +523,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) { @@ -615,27 +560,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); @@ -706,7 +637,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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/Field28D.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field28D.java index f96bef0d2..fdfd7b3e3 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field28D.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field28D.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; @@ -236,11 +233,9 @@ 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); } /** @@ -255,7 +250,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type 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,32 +535,14 @@ public Field28D 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 Index content to set - * @return the field object to enable build pattern - */ - public Field28D setComponent1(java.lang.Long component1) { - setComponent(1, SwiftFormatUtils.getLong(component1)); - return this; - } /** * Alternative method setter for field's Message Index (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 Index content to set * @return the field object to enable build pattern - * @see #setMessageIndex(java.lang.Long) */ public Field28D setComponent1(java.lang.Number component1) { @@ -595,27 +572,13 @@ public Field28D setMessageIndex(String component1) { return setComponent1(component1); } - /** - * Set the Message Index (component 1) from a Long object. - * - * @see #setComponent1(java.lang.Long) - * - * @param component1 Long with the Message Index content to set - * @return the field object to enable build pattern - * @since 9.2.7 - */ - public Field28D setMessageIndex(java.lang.Long component1) { - return setComponent1(component1); - } - /** * Alternative method setter for field's Message Index (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 Index content to set * @return the field object to enable build pattern - * @see #setMessageIndex(java.lang.Long) */ public Field28D setMessageIndex(java.lang.Number component1) { return setComponent1(component1); @@ -630,16 +593,6 @@ public Field28D setStatementNumber(String component1) { return setMessageIndex(component1); } - /** - * @deprecated use #setComponent1(java.lang.Long) instead - * @since 9.2.7 - */ - @Deprecated - @ProwideDeprecated(phase4 = TargetYear.SRU2024) - public Field28D setStatementNumber(java.lang.Long component1) { - return setMessageIndex(component1); - } - /** * @deprecated use #setMessageIndex(java.lang.Long) instead */ @@ -660,32 +613,14 @@ public Field28D 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 Field28D 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 Field28D setComponent2(java.lang.Number component2) { @@ -715,27 +650,13 @@ public Field28D 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 Field28D 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 Field28D setTotal(java.lang.Number component2) { return setComponent2(component2); @@ -750,16 +671,6 @@ public Field28D setSequenceNumber(String component2) { return setTotal(component2); } - /** - * @deprecated use #setComponent2(java.lang.Long) instead - * @since 9.2.7 - */ - @Deprecated - @ProwideDeprecated(phase4 = TargetYear.SRU2024) - public Field28D setSequenceNumber(java.lang.Long component2) { - return setTotal(component2); - } - /** * @deprecated use #setTotal(java.lang.Long) instead */ @@ -834,7 +745,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field28D(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 f55459248..a423683c0 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; @@ -222,11 +219,9 @@ 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); } /** @@ -241,7 +236,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -426,32 +421,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) { @@ -481,27 +458,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); @@ -593,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 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 941820954..28091e51b 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 d7d3e3a2b..b4af3b993 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; @@ -224,11 +221,9 @@ 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); } /** @@ -243,7 +238,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -615,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 Field29B(f)); } @@ -631,6 +626,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); } @@ -644,6 +640,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); @@ -656,6 +653,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()); } @@ -668,6 +666,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)); @@ -682,6 +681,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); } @@ -696,6 +696,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 c1d458d6c..a1a8499c1 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; @@ -221,13 +218,12 @@ 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; } @@ -244,7 +240,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -527,7 +523,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 5ab8f8c27..54685b00a 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; @@ -204,14 +201,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 29H"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** @@ -226,7 +220,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -429,7 +423,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 294eb8c0b..a28a537dd 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; @@ -204,14 +201,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 29I"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** @@ -226,7 +220,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -429,7 +423,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 5f666a297..0ee0603d2 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; @@ -221,13 +218,12 @@ 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; } @@ -244,7 +240,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -527,7 +523,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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/Field29K.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field29K.java index 6c98d50bb..858e2f961 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field29K.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field29K.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; @@ -221,13 +218,12 @@ 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; } @@ -244,7 +240,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -527,7 +523,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field29K(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 ddeeb3dae..0f59ea2ab 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; @@ -241,13 +238,12 @@ 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; } @@ -264,7 +260,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -568,6 +564,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); } @@ -645,7 +642,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 ca5e1add2..7da49b96a 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; @@ -221,13 +218,12 @@ 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; } @@ -244,7 +240,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -527,7 +523,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 5227cbacb..1ff766e17 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; @@ -241,13 +238,12 @@ 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; } @@ -264,7 +260,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -568,6 +564,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); } @@ -645,7 +642,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 2282e6221..4070e90f0 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; @@ -247,13 +244,12 @@ 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; } @@ -270,7 +266,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type 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,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 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 3a8733798..1c5b8ed0b 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; @@ -207,16 +204,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 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; } @@ -233,7 +228,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -417,6 +412,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); } @@ -494,7 +490,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 4ce5fb508..7a0344619 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; @@ -204,14 +201,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 301"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** @@ -226,7 +220,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -429,7 +423,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 7740ab39a..49a20fc77 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; @@ -204,14 +201,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 302"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** @@ -226,7 +220,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type 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,7 +463,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 9e87f7af7..4502b6965 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; @@ -204,14 +201,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 303"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** @@ -226,7 +220,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -429,7 +423,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 b0eab6aa8..b1abb775a 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; @@ -222,11 +219,9 @@ 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); } /** @@ -241,7 +236,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -484,7 +479,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 2a1be2cc2..ecdd8b24a 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; @@ -204,14 +201,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 305"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** @@ -226,7 +220,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -429,7 +423,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 e902e8b74..647ac7803 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; @@ -204,14 +201,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 307"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** @@ -226,7 +220,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -429,7 +423,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 c11c8f67d..4b6436f44 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; @@ -207,16 +204,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 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; } @@ -233,7 +228,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -417,6 +412,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); } @@ -494,7 +490,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 6856317c7..41751a40d 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; @@ -239,13 +236,12 @@ 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; } @@ -262,7 +258,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -592,6 +588,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); } @@ -669,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 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 b66f926de..3c3c2ea4b 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; @@ -207,16 +204,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 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; } @@ -233,7 +228,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -417,6 +412,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); } @@ -494,7 +490,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 38dde6aaf..7d9ed94f0 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; @@ -235,13 +232,12 @@ 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; } @@ -258,7 +254,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type 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 +558,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); } @@ -639,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 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 376f83040..49fdd9751 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; @@ -220,11 +217,9 @@ 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); } /** @@ -239,7 +234,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type 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,32 +440,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) { @@ -500,27 +477,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); @@ -591,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 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 3ffc3aa75..81b979924 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; @@ -207,16 +204,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 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; } @@ -233,7 +228,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -417,6 +412,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); } @@ -494,7 +490,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 3e226461d..63ea18029 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; @@ -207,16 +204,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 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; } @@ -233,7 +228,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -417,6 +412,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); } @@ -494,7 +490,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 729a97711..f81bc2fbc 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; @@ -207,16 +204,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 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; } @@ -233,7 +228,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -417,6 +412,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); } @@ -494,7 +490,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 8d5c98e93..aa34ae38d 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; @@ -207,16 +204,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 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; } @@ -233,7 +228,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -417,6 +412,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); } @@ -494,7 +490,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 a1437ce19..843c5b055 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; @@ -207,16 +204,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 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; } @@ -233,7 +228,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -417,6 +412,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); } @@ -494,7 +490,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 87df0d0f2..2003ccb44 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; @@ -207,16 +204,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 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; } @@ -233,7 +228,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -417,6 +412,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); } @@ -494,7 +490,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 814b3d7d2..52a5d346e 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; @@ -207,16 +204,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 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; } @@ -233,7 +228,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -417,6 +412,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); } @@ -494,7 +490,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 62dbbb99a..292538714 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; @@ -207,16 +204,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 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; } @@ -233,7 +228,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -417,6 +412,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); } @@ -494,7 +490,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 d4340b3c1..01d4d8217 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; @@ -207,16 +204,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 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; } @@ -233,7 +228,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -417,6 +412,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); } @@ -494,7 +490,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 d7e78020c..bcbf69dd1 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; @@ -207,16 +204,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 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; } @@ -233,7 +228,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -417,6 +412,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); } @@ -494,7 +490,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 7c105f831..76dd2c288 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; @@ -207,16 +204,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 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; } @@ -233,7 +228,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -417,6 +412,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); } @@ -494,7 +490,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 80e03c2f8..a062e12cf 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; @@ -204,14 +201,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 311"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** @@ -226,7 +220,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -429,7 +423,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 767b109ae..3a986ae43 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; @@ -204,14 +201,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 312"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** @@ -226,7 +220,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -429,7 +423,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 dfebf97d9..f66df1ac9 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; @@ -206,14 +203,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 313"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** @@ -228,7 +222,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -394,32 +388,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) { @@ -449,27 +425,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); @@ -540,7 +502,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 f76c5869a..5cf4aa0fe 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; @@ -207,16 +204,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 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; } @@ -233,7 +228,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -417,6 +412,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); } @@ -494,7 +490,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 82a8e764f..599490e02 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; @@ -231,11 +228,9 @@ 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); } /** @@ -250,7 +245,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -474,6 +469,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); } @@ -551,7 +547,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 a0b9e4c70..849247d75 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; @@ -207,16 +204,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 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; } @@ -233,7 +228,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -417,6 +412,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); } @@ -494,7 +490,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 c6f5637fc..e77f7df54 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; @@ -247,11 +244,9 @@ 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); } /** @@ -266,7 +261,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type 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,6 +571,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); } @@ -653,7 +649,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 e932c3dc3..e7b44de48 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; @@ -244,11 +241,9 @@ 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); } /** @@ -263,7 +258,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type 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,6 +562,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); } @@ -644,7 +640,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 8e4401a46..91bb573b8 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; @@ -207,16 +204,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 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; } @@ -233,7 +228,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -417,6 +412,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); } @@ -494,7 +490,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 17ef2a6f1..3471058d7 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; @@ -231,11 +228,9 @@ 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); } /** @@ -250,7 +245,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -477,6 +472,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); } @@ -554,7 +550,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 1de7b0d25..195c73956 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; @@ -228,13 +225,12 @@ 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; } @@ -251,7 +247,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type 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,6 +514,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); } @@ -595,7 +592,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 12781bbc3..7b6ddf7c2 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; @@ -207,16 +204,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 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; } @@ -233,7 +228,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -417,6 +412,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); } @@ -494,7 +490,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 1681f0a52..4fbeebb6a 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; @@ -254,11 +251,9 @@ 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); } /** @@ -273,7 +268,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type 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 Field31X setCode(String component3) { * * @return the list of converted components (a Calendar object or null) */ + @Override public List dates() { return DateResolver.dates(this); } @@ -663,7 +659,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 a6ebf8b8f..d7d7b259e 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; @@ -204,14 +201,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 329"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** @@ -226,7 +220,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type 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,7 +463,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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/Field32A.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field32A.java index b112b43f5..cbc9563c4 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field32A.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field32A.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; @@ -246,14 +243,13 @@ 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; } @@ -270,7 +266,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type 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 +591,13 @@ public Field32A 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 Field32A 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 Field32A setComponent3(java.lang.Number component3) { @@ -652,53 +629,45 @@ public Field32A 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 Field32A 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 Field32A 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); } @@ -719,6 +688,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); } @@ -728,6 +698,7 @@ public BigDecimal amount() { * * @return the list of converted components (a Calendar object or null) */ + @Override public List dates() { return DateResolver.dates(this); } @@ -805,7 +776,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field32A(f)); } @@ -852,7 +823,7 @@ public static Field32A fromJson(final String json) { * @return BigDecimal value of amount attribute or null. */ public java.math.BigDecimal getAmountBigDecimal() { - if (getComponent3AsNumber() == null) { + if (getComponent3AsBigDecimal() == null) { return null; } return (java.math.BigDecimal) getComponentAs(3, java.math.BigDecimal.class); @@ -866,7 +837,7 @@ public String getValueDisplay() { final StringBuilder sb = new StringBuilder(); sb.append(getComponent2()); sb.append(" "); - sb.append(formatNumber(getComponent3AsNumber())); + sb.append(formatNumber(getComponent3AsBigDecimal())); sb.append(" "); String valueDate = format(getComponent1AsCalendar()); sb.append(valueDate); diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field32B.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field32B.java index bb6e42848..f018ec9f4 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field32B.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field32B.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; @@ -229,14 +226,13 @@ 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; } @@ -253,7 +249,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -526,32 +522,13 @@ public Field32B 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 Field32B 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 Field32B setComponent2(java.lang.Number component2) { @@ -583,27 +560,13 @@ public Field32B 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 Field32B 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 Field32B setAmount(java.lang.Number component2) { return setComponent2(component2); @@ -616,14 +579,6 @@ public Field32B setPrice(String component2) { return setAmount(component2); } - /** - * @deprecated use #setComponent2(java.math.BigDecimal) instead - * @since 9.2.7 - */ - public Field32B setPrice(java.math.BigDecimal component2) { - return setAmount(component2); - } - /** * @deprecated use #setAmount(java.math.BigDecimal) instead */ @@ -632,26 +587,32 @@ public Field32B setPrice(java.lang.Number 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); } @@ -672,6 +633,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); } @@ -740,7 +702,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field32B(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 41f9e9c0d..f34002fc1 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; @@ -246,14 +243,13 @@ 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; } @@ -270,7 +266,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type 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 +591,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) { @@ -652,53 +629,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); } @@ -719,6 +688,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); } @@ -728,6 +698,7 @@ public BigDecimal amount() { * * @return the list of converted components (a Calendar object or null) */ + @Override public List dates() { return DateResolver.dates(this); } @@ -805,7 +776,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 67205053f..ac9394f88 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; @@ -246,14 +243,13 @@ 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; } @@ -270,7 +266,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type 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 +591,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) { @@ -652,53 +629,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); } @@ -719,6 +688,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); } @@ -728,6 +698,7 @@ public BigDecimal amount() { * * @return the list of converted components (a Calendar object or null) */ + @Override public List dates() { return DateResolver.dates(this); } @@ -805,7 +776,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 3eb560e46..890894698 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; @@ -207,14 +204,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 32E"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** @@ -229,7 +223,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type 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,26 +402,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); } @@ -496,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 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 e80d159ac..856676edb 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; @@ -222,14 +219,13 @@ 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; } @@ -246,7 +242,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type 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,32 +447,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) { @@ -508,27 +485,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); @@ -551,6 +514,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); } @@ -619,7 +583,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 d14965f7a..bad3aa07d 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; @@ -223,14 +220,13 @@ 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; } @@ -247,7 +243,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -492,32 +488,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) { @@ -549,53 +526,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); } @@ -616,6 +585,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); } @@ -684,7 +654,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 0108e0495..9c19ca2df 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; @@ -241,14 +238,13 @@ 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; } @@ -265,7 +261,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -553,32 +549,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) { @@ -610,53 +587,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); } @@ -677,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); } @@ -745,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 Field32H(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field32K.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field32K.java index 96184d26a..468130987 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field32K.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field32K.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; @@ -284,14 +281,13 @@ 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; } @@ -308,7 +304,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -678,32 +674,14 @@ public Field32K 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 Days/Months content to set - * @return the field object to enable build pattern - */ - public Field32K setComponent2(java.lang.Long component2) { - setComponent(2, SwiftFormatUtils.getLong(component2)); - return this; - } /** * Alternative method setter for field's Number Of Days/Months (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 Days/Months content to set * @return the field object to enable build pattern - * @see #setNumberOfDaysMonths(java.lang.Long) */ public Field32K setComponent2(java.lang.Number component2) { @@ -733,27 +711,13 @@ public Field32K setNumberOfDaysMonths(String component2) { return setComponent2(component2); } - /** - * Set the Number Of Days/Months (component 2) from a Long object. - * - * @see #setComponent2(java.lang.Long) - * - * @param component2 Long with the Number Of Days/Months content to set - * @return the field object to enable build pattern - * @since 9.2.7 - */ - public Field32K setNumberOfDaysMonths(java.lang.Long component2) { - return setComponent2(component2); - } - /** * Alternative method setter for field's Number Of Days/Months (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 Days/Months content to set * @return the field object to enable build pattern - * @see #setNumberOfDaysMonths(java.lang.Long) */ public Field32K setNumberOfDaysMonths(java.lang.Number component2) { return setComponent2(component2); @@ -768,16 +732,6 @@ public Field32K setNumberofDaysMonths(String component2) { return setNumberOfDaysMonths(component2); } - /** - * @deprecated use #setComponent2(java.lang.Long) instead - * @since 9.2.7 - */ - @Deprecated - @ProwideDeprecated(phase4 = TargetYear.SRU2024) - public Field32K setNumberofDaysMonths(java.lang.Long component2) { - return setNumberOfDaysMonths(component2); - } - /** * @deprecated use #setNumberOfDaysMonths(java.lang.Long) instead */ @@ -863,32 +817,13 @@ public Field32K 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 Field32K 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 Field32K setComponent5(java.lang.Number component5) { @@ -920,53 +855,45 @@ public Field32K 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 Field32K 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 Field32K setAmount(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); } @@ -987,6 +914,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); } @@ -1055,7 +983,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field32K(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 f37891dd6..4cca4c3aa 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; @@ -223,14 +220,13 @@ 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; } @@ -247,7 +243,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -492,32 +488,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) { @@ -549,53 +526,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); } @@ -616,6 +585,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); } @@ -684,7 +654,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 ddec44865..3aa8c4b52 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; @@ -223,11 +220,9 @@ 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); } /** @@ -242,7 +237,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type 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,26 +496,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); } @@ -589,7 +590,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 3e2fd9bfb..eab163fea 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; @@ -244,14 +241,13 @@ 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; } @@ -268,7 +264,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type 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 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) { @@ -573,27 +550,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); @@ -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); } @@ -684,7 +648,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 1235ac823..7be56ff32 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; @@ -223,14 +220,13 @@ 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; } @@ -247,7 +243,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -492,32 +488,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) { @@ -549,53 +526,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); } @@ -616,6 +585,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); } @@ -684,7 +654,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 34f8f4979..57cebbff1 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; @@ -278,11 +275,9 @@ 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); } /** @@ -297,7 +292,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -748,32 +743,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) { @@ -803,27 +780,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); @@ -840,32 +803,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) { @@ -895,27 +840,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); @@ -932,32 +863,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) { @@ -987,27 +900,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); @@ -1024,32 +923,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) { @@ -1079,27 +960,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); @@ -1116,32 +983,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) { @@ -1171,27 +1020,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); @@ -1208,32 +1043,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) { @@ -1263,27 +1080,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); @@ -1354,7 +1157,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 9360f7aac..e1f90149b 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; @@ -359,11 +356,9 @@ 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); } /** @@ -378,7 +373,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -1087,32 +1082,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) { @@ -1142,27 +1119,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); @@ -1355,32 +1318,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) { @@ -1410,27 +1355,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); @@ -1447,32 +1378,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) { @@ -1502,27 +1415,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); @@ -1539,32 +1438,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) { @@ -1594,27 +1475,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); @@ -1631,32 +1498,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) { @@ -1686,27 +1535,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); @@ -1723,32 +1558,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) { @@ -1778,27 +1595,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); @@ -1815,32 +1618,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) { @@ -1870,27 +1655,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); @@ -1907,32 +1678,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) { @@ -1962,27 +1715,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); @@ -1994,6 +1733,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); } @@ -2071,7 +1811,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 13a3f400c..a940046a5 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; @@ -226,11 +223,9 @@ 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); } /** @@ -245,7 +240,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -468,32 +463,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) { @@ -523,27 +500,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); @@ -560,32 +523,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) { @@ -615,27 +560,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); @@ -706,7 +637,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 ead196766..f547db83d 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; @@ -323,11 +320,9 @@ 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); } /** @@ -342,7 +337,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -911,32 +906,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) { @@ -966,27 +943,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); @@ -1091,32 +1054,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) { @@ -1146,27 +1091,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); @@ -1183,32 +1114,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) { @@ -1238,27 +1151,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); @@ -1275,32 +1174,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) { @@ -1330,27 +1211,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); @@ -1362,6 +1229,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); } @@ -1439,7 +1307,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 29c5fbc24..44e3f47cc 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; @@ -221,13 +218,12 @@ 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; } @@ -244,7 +240,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -527,7 +523,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 fae29b6aa..7abf48844 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; @@ -274,13 +271,12 @@ 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; } @@ -297,7 +293,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -820,7 +816,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 58542b382..1b287f915 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; @@ -239,11 +236,9 @@ 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); } /** @@ -258,7 +253,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -483,32 +478,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) { @@ -538,27 +515,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); @@ -650,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 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 917b3bc3e..2330034d4 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; @@ -204,14 +201,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 337"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** @@ -226,7 +220,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -429,7 +423,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 2f65cb2cf..087bdc969 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; @@ -204,14 +201,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 338"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** @@ -226,7 +220,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -429,7 +423,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 4e164290e..3db820e13 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; @@ -204,14 +201,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 339"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** @@ -226,7 +220,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -429,7 +423,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 1640bfe76..559d4e74d 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; @@ -246,14 +243,13 @@ 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; } @@ -270,7 +266,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type 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 +591,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) { @@ -652,53 +629,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); } @@ -719,6 +688,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); } @@ -728,6 +698,7 @@ public BigDecimal amount() { * * @return the list of converted components (a Calendar object or null) */ + @Override public List dates() { return DateResolver.dates(this); } @@ -805,7 +776,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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/Field33B.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field33B.java index 84d003958..280c364f1 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field33B.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field33B.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; @@ -228,14 +225,13 @@ 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; } @@ -252,7 +248,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -485,32 +481,13 @@ public Field33B 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 Field33B 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 Field33B setComponent2(java.lang.Number component2) { @@ -542,27 +519,13 @@ public Field33B 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 Field33B 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 Field33B setAmount(java.lang.Number component2) { return setComponent2(component2); @@ -575,14 +538,6 @@ public Field33B setPrice(String component2) { return setAmount(component2); } - /** - * @deprecated use #setComponent2(java.math.BigDecimal) instead - * @since 9.2.7 - */ - public Field33B setPrice(java.math.BigDecimal component2) { - return setAmount(component2); - } - /** * @deprecated use #setAmount(java.math.BigDecimal) instead */ @@ -607,6 +562,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); } @@ -675,7 +631,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field33B(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 052a78c21..98f184bc6 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; @@ -246,14 +243,13 @@ 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; } @@ -270,7 +266,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type 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 +591,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) { @@ -652,53 +629,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); } @@ -719,6 +688,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); } @@ -728,6 +698,7 @@ public BigDecimal amount() { * * @return the list of converted components (a Calendar object or null) */ + @Override public List dates() { return DateResolver.dates(this); } @@ -805,7 +776,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 11ec7a363..4cc47c950 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; @@ -246,14 +243,13 @@ 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; } @@ -270,7 +266,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type 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 +591,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) { @@ -652,53 +629,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); } @@ -719,6 +688,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); } @@ -728,6 +698,7 @@ public BigDecimal amount() { * * @return the list of converted components (a Calendar object or null) */ + @Override public List dates() { return DateResolver.dates(this); } @@ -805,7 +776,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 2f50e356b..e82bd4f20 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; @@ -223,14 +220,13 @@ 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; } @@ -247,7 +243,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -492,32 +488,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) { @@ -549,53 +526,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); } @@ -616,6 +585,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); } @@ -684,7 +654,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 e73f602b1..9203ed084 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; @@ -223,14 +220,13 @@ 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; } @@ -247,7 +243,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -492,32 +488,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) { @@ -549,53 +526,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); } @@ -616,6 +585,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); } @@ -684,7 +654,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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/Field33G.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field33G.java index 5ccc784e8..4343c913a 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field33G.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field33G.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; @@ -247,11 +244,9 @@ public String getValueDisplay(int component, Locale locale) { return f.format(n); } } - 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); } /** @@ -266,7 +261,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -564,32 +559,13 @@ public Field33G 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 Price content to set - * @return the field object to enable build pattern - */ - public Field33G setComponent2(java.math.BigDecimal component2) { - setComponent(2, SwiftFormatUtils.getBigDecimal(component2)); - return this; - } /** * Alternative method setter for field's Price (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 Price content to set * @return the field object to enable build pattern - * @see #setPrice(java.math.BigDecimal) */ public Field33G setComponent2(java.lang.Number component2) { @@ -621,27 +597,13 @@ public Field33G setPrice(String component2) { return setComponent2(component2); } - /** - * Set the Price (component 2) from a BigDecimal object. - * - * @see #setComponent2(java.math.BigDecimal) - * - * @param component2 BigDecimal with the Price content to set - * @return the field object to enable build pattern - * @since 9.2.7 - */ - public Field33G setPrice(java.math.BigDecimal component2) { - return setComponent2(component2); - } - /** * Alternative method setter for field's Price (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 Price content to set * @return the field object to enable build pattern - * @see #setPrice(java.math.BigDecimal) */ public Field33G setPrice(java.lang.Number component2) { return setComponent2(component2); @@ -656,16 +618,6 @@ public Field33G setAmount(String component2) { return setPrice(component2); } - /** - * @deprecated use #setComponent2(java.math.BigDecimal) instead - * @since 9.2.7 - */ - @Deprecated - @ProwideDeprecated(phase4 = TargetYear.SRU2024) - public Field33G setAmount(java.math.BigDecimal component2) { - return setPrice(component2); - } - /** * @deprecated use #setPrice(java.math.BigDecimal) instead */ @@ -697,26 +649,32 @@ public Field33G setCode(String 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); } @@ -737,6 +695,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); } @@ -805,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 Field33G(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 c2d72cdfe..e527fdaec 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; @@ -223,14 +220,13 @@ 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; } @@ -247,7 +243,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -492,32 +488,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) { @@ -549,53 +526,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); } @@ -616,6 +585,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); } @@ -684,7 +654,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 36a37f099..160e5d952 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; @@ -229,14 +226,13 @@ 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; } @@ -253,7 +249,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -480,32 +476,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) { @@ -537,27 +514,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); @@ -580,6 +543,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); } @@ -648,7 +612,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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/Field33K.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field33K.java index 1739b39c1..f0506d483 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field33K.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field33K.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; @@ -284,14 +281,13 @@ 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; } @@ -308,7 +304,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -678,32 +674,14 @@ public Field33K 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 Days/Months content to set - * @return the field object to enable build pattern - */ - public Field33K setComponent2(java.lang.Long component2) { - setComponent(2, SwiftFormatUtils.getLong(component2)); - return this; - } /** * Alternative method setter for field's Number Of Days/Months (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 Days/Months content to set * @return the field object to enable build pattern - * @see #setNumberOfDaysMonths(java.lang.Long) */ public Field33K setComponent2(java.lang.Number component2) { @@ -733,27 +711,13 @@ public Field33K setNumberOfDaysMonths(String component2) { return setComponent2(component2); } - /** - * Set the Number Of Days/Months (component 2) from a Long object. - * - * @see #setComponent2(java.lang.Long) - * - * @param component2 Long with the Number Of Days/Months content to set - * @return the field object to enable build pattern - * @since 9.2.7 - */ - public Field33K setNumberOfDaysMonths(java.lang.Long component2) { - return setComponent2(component2); - } - /** * Alternative method setter for field's Number Of Days/Months (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 Days/Months content to set * @return the field object to enable build pattern - * @see #setNumberOfDaysMonths(java.lang.Long) */ public Field33K setNumberOfDaysMonths(java.lang.Number component2) { return setComponent2(component2); @@ -768,16 +732,6 @@ public Field33K setNumberofDaysMonths(String component2) { return setNumberOfDaysMonths(component2); } - /** - * @deprecated use #setComponent2(java.lang.Long) instead - * @since 9.2.7 - */ - @Deprecated - @ProwideDeprecated(phase4 = TargetYear.SRU2024) - public Field33K setNumberofDaysMonths(java.lang.Long component2) { - return setNumberOfDaysMonths(component2); - } - /** * @deprecated use #setNumberOfDaysMonths(java.lang.Long) instead */ @@ -863,32 +817,13 @@ public Field33K 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 Field33K 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 Field33K setComponent5(java.lang.Number component5) { @@ -920,53 +855,45 @@ public Field33K 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 Field33K 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 Field33K setAmount(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); } @@ -987,6 +914,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); } @@ -1055,7 +983,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field33K(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 29297f6d7..6c6dc3bac 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; @@ -229,14 +226,13 @@ 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; } @@ -253,7 +249,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -480,32 +476,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) { @@ -537,27 +514,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); @@ -580,6 +543,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); } @@ -648,7 +612,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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/Field33T.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field33T.java index b7c9cea41..c742d7a94 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field33T.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field33T.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; @@ -229,14 +226,13 @@ 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; } @@ -253,7 +249,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -489,32 +485,13 @@ public Field33T 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 Price content to set - * @return the field object to enable build pattern - */ - public Field33T setComponent2(java.math.BigDecimal component2) { - setComponent(2, SwiftFormatUtils.getBigDecimal(component2)); - return this; - } /** * Alternative method setter for field's Price (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 Price content to set * @return the field object to enable build pattern - * @see #setPrice(java.math.BigDecimal) */ public Field33T setComponent2(java.lang.Number component2) { @@ -546,27 +523,13 @@ public Field33T setPrice(String component2) { return setComponent2(component2); } - /** - * Set the Price (component 2) from a BigDecimal object. - * - * @see #setComponent2(java.math.BigDecimal) - * - * @param component2 BigDecimal with the Price content to set - * @return the field object to enable build pattern - * @since 9.2.7 - */ - public Field33T setPrice(java.math.BigDecimal component2) { - return setComponent2(component2); - } - /** * Alternative method setter for field's Price (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 Price content to set * @return the field object to enable build pattern - * @see #setPrice(java.math.BigDecimal) */ public Field33T setPrice(java.lang.Number component2) { return setComponent2(component2); @@ -581,16 +544,6 @@ public Field33T setAmount(String component2) { return setPrice(component2); } - /** - * @deprecated use #setComponent2(java.math.BigDecimal) instead - * @since 9.2.7 - */ - @Deprecated - @ProwideDeprecated(phase4 = TargetYear.SRU2024) - public Field33T setAmount(java.math.BigDecimal component2) { - return setPrice(component2); - } - /** * @deprecated use #setPrice(java.math.BigDecimal) instead */ @@ -617,6 +570,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); } @@ -685,7 +639,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field33T(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 1cb7191e4..0bf1e1abf 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; @@ -208,17 +205,15 @@ public String getValue() { */ @Override 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; } @@ -235,7 +230,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type 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,32 +395,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) { @@ -457,27 +433,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); @@ -500,6 +462,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); } @@ -568,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 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 8d0143bf9..f6d70747a 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; @@ -222,11 +219,9 @@ 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); } /** @@ -241,7 +236,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -484,7 +479,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 fd47577e6..4ab3e0576 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; @@ -204,14 +201,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 341"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** @@ -226,7 +220,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -429,7 +423,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 38d54a967..2d76f9f5c 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; @@ -225,13 +222,12 @@ 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; } @@ -248,7 +244,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -531,7 +527,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 27499a2ae..8fb17b196 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; @@ -252,11 +249,9 @@ 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); } /** @@ -271,7 +266,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -608,32 +603,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) { @@ -663,27 +640,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); @@ -700,32 +663,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) { @@ -755,27 +700,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); @@ -792,32 +723,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) { @@ -847,27 +760,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); @@ -884,32 +783,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) { @@ -939,27 +820,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); @@ -1030,7 +897,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 83565c6bb..8f44f0ba1 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; @@ -227,11 +224,9 @@ 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); } /** @@ -246,7 +241,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type 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,32 +447,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) { @@ -507,27 +484,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); @@ -598,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 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 d081f42ae..b90a6dc93 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; @@ -301,11 +298,9 @@ 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); } /** @@ -320,7 +315,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -883,7 +878,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 8c102a4e7..cff12a95a 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; @@ -299,11 +296,9 @@ 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); } /** @@ -318,7 +313,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -881,7 +876,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 efa666cb7..a2225518b 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; @@ -299,11 +296,9 @@ 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); } /** @@ -318,7 +313,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -881,7 +876,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 d3a83bfc9..f50a5ae61 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; @@ -204,14 +201,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 348"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** @@ -226,7 +220,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -429,7 +423,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 5761c29f8..befa49ad8 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; @@ -206,14 +203,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 349"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** @@ -228,7 +222,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -394,32 +388,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) { @@ -449,27 +425,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); @@ -540,7 +502,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 474a4be31..6c07811ea 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; @@ -246,14 +243,13 @@ 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; } @@ -270,7 +266,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type 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 +591,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) { @@ -652,53 +629,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); } @@ -719,6 +688,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); } @@ -728,6 +698,7 @@ public BigDecimal amount() { * * @return the list of converted components (a Calendar object or null) */ + @Override public List dates() { return DateResolver.dates(this); } @@ -805,7 +776,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 db255a591..c48299db1 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; @@ -223,14 +220,13 @@ 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; } @@ -247,7 +243,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -492,32 +488,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) { @@ -549,53 +526,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); } @@ -616,6 +585,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); } @@ -684,7 +654,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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/Field34C.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field34C.java index 8539ccff2..8b97c6000 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field34C.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field34C.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; @@ -271,14 +268,13 @@ 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; } @@ -295,7 +291,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -694,32 +690,13 @@ public Field34C 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/Rate content to set - * @return the field object to enable build pattern - */ - public Field34C setComponent4(java.math.BigDecimal component4) { - setComponent(4, SwiftFormatUtils.getBigDecimal(component4)); - return this; - } /** * Alternative method setter for field's Amount/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 Amount/Rate content to set * @return the field object to enable build pattern - * @see #setAmountRate(java.math.BigDecimal) */ public Field34C setComponent4(java.lang.Number component4) { @@ -751,27 +728,13 @@ public Field34C setAmountRate(String component4) { return setComponent4(component4); } - /** - * Set the Amount/Rate (component 4) from a BigDecimal object. - * - * @see #setComponent4(java.math.BigDecimal) - * - * @param component4 BigDecimal with the Amount/Rate content to set - * @return the field object to enable build pattern - * @since 9.2.7 - */ - public Field34C setAmountRate(java.math.BigDecimal component4) { - return setComponent4(component4); - } - /** * Alternative method setter for field's Amount/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 Amount/Rate content to set * @return the field object to enable build pattern - * @see #setAmountRate(java.math.BigDecimal) */ public Field34C setAmountRate(java.lang.Number component4) { return setComponent4(component4); @@ -786,16 +749,6 @@ public Field34C setAmount(String component4) { return setAmountRate(component4); } - /** - * @deprecated use #setComponent4(java.math.BigDecimal) instead - * @since 9.2.7 - */ - @Deprecated - @ProwideDeprecated(phase4 = TargetYear.SRU2024) - public Field34C setAmount(java.math.BigDecimal component4) { - return setAmountRate(component4); - } - /** * @deprecated use #setAmountRate(java.math.BigDecimal) instead */ @@ -806,26 +759,32 @@ public Field34C setAmount(java.lang.Number 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); } @@ -846,6 +805,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); } @@ -914,7 +874,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field34C(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 fe0067032..95b110c26 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; @@ -241,14 +238,13 @@ 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; } @@ -265,7 +261,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -553,32 +549,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) { @@ -610,53 +587,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); } @@ -677,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); } @@ -745,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 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 0c5cdfd77..db1293c92 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; @@ -241,14 +238,13 @@ 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; } @@ -265,7 +261,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -553,32 +549,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) { @@ -610,53 +587,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); } @@ -677,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); } @@ -745,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 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 bb4455d8a..a849187dd 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; @@ -247,14 +244,13 @@ 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; } @@ -271,7 +267,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -541,32 +537,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) { @@ -598,27 +575,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); @@ -641,6 +604,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); } @@ -709,7 +673,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 66a1d1134..5de361989 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; @@ -246,14 +243,13 @@ 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; } @@ -270,7 +266,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type 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 +591,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) { @@ -652,53 +629,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); } @@ -719,6 +688,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); } @@ -728,6 +698,7 @@ public BigDecimal amount() { * * @return the list of converted components (a Calendar object or null) */ + @Override public List dates() { return DateResolver.dates(this); } @@ -805,7 +776,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 f57be2cb4..0a750945b 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; @@ -246,14 +243,13 @@ 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; } @@ -270,7 +266,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type 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 +591,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) { @@ -652,53 +629,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); } @@ -719,6 +688,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); } @@ -728,6 +698,7 @@ public BigDecimal amount() { * * @return the list of converted components (a Calendar object or null) */ + @Override public List dates() { return DateResolver.dates(this); } @@ -805,7 +776,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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/Field35A.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field35A.java index 0debaf270..177736eb8 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field35A.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field35A.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; @@ -236,14 +233,13 @@ 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; } @@ -260,7 +256,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type 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 +514,13 @@ public Field35A 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 Field35A 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 Field35A setComponent2(java.lang.Number component2) { @@ -575,27 +552,13 @@ public Field35A 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 Field35A 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 Field35A setQuantity(java.lang.Number component2) { return setComponent2(component2); @@ -610,16 +573,6 @@ public Field35A setAmount(String component2) { return setQuantity(component2); } - /** - * @deprecated use #setComponent2(java.math.BigDecimal) instead - * @since 9.2.7 - */ - @Deprecated - @ProwideDeprecated(phase4 = TargetYear.SRU2024) - public Field35A setAmount(java.math.BigDecimal component2) { - return setQuantity(component2); - } - /** * @deprecated use #setQuantity(java.math.BigDecimal) instead */ @@ -646,6 +599,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); } @@ -714,7 +668,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field35A(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 9d1f0bde8..c5a35cf8d 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; @@ -281,11 +278,9 @@ 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); } /** @@ -300,7 +295,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -983,7 +978,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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)); } @@ -999,6 +994,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); } @@ -1012,6 +1008,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); @@ -1024,6 +1021,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()); } @@ -1036,6 +1034,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)); @@ -1050,6 +1049,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); } @@ -1064,6 +1064,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 f28690b96..41a94bea5 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; @@ -221,11 +218,9 @@ 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); } /** @@ -240,7 +235,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -486,7 +481,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 f80084d34..31c72753e 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; @@ -207,16 +204,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 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; } @@ -233,7 +228,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -417,6 +412,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); } @@ -494,7 +490,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 942acdbdc..f05f2fa1d 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; @@ -234,11 +231,9 @@ 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); } /** @@ -253,7 +248,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -711,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 Field35E(f)); } @@ -727,6 +722,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); } @@ -740,6 +736,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); @@ -752,6 +749,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()); } @@ -764,6 +762,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)); @@ -778,6 +777,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); } @@ -792,6 +792,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 89ae2d038..970ece175 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; @@ -264,11 +261,9 @@ 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); } /** @@ -283,7 +278,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -999,7 +994,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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)); } @@ -1015,6 +1010,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); } @@ -1028,6 +1024,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); @@ -1040,6 +1037,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()); } @@ -1052,6 +1050,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)); @@ -1066,6 +1065,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); } @@ -1080,6 +1080,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/Field35H.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field35H.java index cfca568a0..95490ff5a 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field35H.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field35H.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; @@ -247,14 +244,13 @@ 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; } @@ -271,7 +267,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -550,32 +546,13 @@ public Field35H 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 Field35H 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 Field35H setComponent3(java.lang.Number component3) { @@ -607,27 +584,13 @@ public Field35H 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 Field35H 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 Field35H setQuantity(java.lang.Number component3) { return setComponent3(component3); @@ -642,16 +605,6 @@ public Field35H setAmount(String component3) { return setQuantity(component3); } - /** - * @deprecated use #setComponent3(java.math.BigDecimal) instead - * @since 9.2.7 - */ - @Deprecated - @ProwideDeprecated(phase4 = TargetYear.SRU2024) - public Field35H setAmount(java.math.BigDecimal component3) { - return setQuantity(component3); - } - /** * @deprecated use #setQuantity(java.math.BigDecimal) instead */ @@ -678,6 +631,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); } @@ -746,7 +700,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field35H(f)); } 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 9e27564ab..ef6638f73 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; @@ -224,11 +221,9 @@ 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); } /** @@ -243,7 +238,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -615,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 Field35L(f)); } @@ -631,6 +626,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); } @@ -644,6 +640,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); @@ -656,6 +653,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()); } @@ -668,6 +666,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)); @@ -682,6 +681,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); } @@ -696,6 +696,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/Field35N.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field35N.java index bb85a4a40..a5eaec3fd 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field35N.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field35N.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; @@ -236,14 +233,13 @@ 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; } @@ -260,7 +256,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type 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 +514,13 @@ public Field35N 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 Field35N 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 Field35N setComponent2(java.lang.Number component2) { @@ -575,27 +552,13 @@ public Field35N 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 Field35N 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 Field35N setQuantity(java.lang.Number component2) { return setComponent2(component2); @@ -610,16 +573,6 @@ public Field35N setAmount(String component2) { return setQuantity(component2); } - /** - * @deprecated use #setComponent2(java.math.BigDecimal) instead - * @since 9.2.7 - */ - @Deprecated - @ProwideDeprecated(phase4 = TargetYear.SRU2024) - public Field35N setAmount(java.math.BigDecimal component2) { - return setQuantity(component2); - } - /** * @deprecated use #setQuantity(java.math.BigDecimal) instead */ @@ -646,6 +599,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); } @@ -714,7 +668,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field35N(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field35S.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field35S.java index 03cd966d1..2f2eed9e6 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field35S.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field35S.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; @@ -236,14 +233,13 @@ 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; } @@ -260,7 +256,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type 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 +514,13 @@ public Field35S 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 Field35S 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 Field35S setComponent2(java.lang.Number component2) { @@ -575,27 +552,13 @@ public Field35S 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 Field35S 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 Field35S setQuantity(java.lang.Number component2) { return setComponent2(component2); @@ -610,16 +573,6 @@ public Field35S setAmount(String component2) { return setQuantity(component2); } - /** - * @deprecated use #setComponent2(java.math.BigDecimal) instead - * @since 9.2.7 - */ - @Deprecated - @ProwideDeprecated(phase4 = TargetYear.SRU2024) - public Field35S setAmount(java.math.BigDecimal component2) { - return setQuantity(component2); - } - /** * @deprecated use #setQuantity(java.math.BigDecimal) instead */ @@ -646,6 +599,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); } @@ -714,7 +668,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field35S(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field35U.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field35U.java index cf7d24e0f..aef5cf0c1 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field35U.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field35U.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; @@ -248,11 +245,9 @@ public String getValueDisplay(int component, Locale locale) { return f.format(n); } } - 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); } /** @@ -267,7 +262,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -525,32 +520,13 @@ public Field35U 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 Price content to set - * @return the field object to enable build pattern - */ - public Field35U setComponent2(java.math.BigDecimal component2) { - setComponent(2, SwiftFormatUtils.getBigDecimal(component2)); - return this; - } /** * Alternative method setter for field's Price (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 Price content to set * @return the field object to enable build pattern - * @see #setPrice(java.math.BigDecimal) */ public Field35U setComponent2(java.lang.Number component2) { @@ -582,27 +558,13 @@ public Field35U setPrice(String component2) { return setComponent2(component2); } - /** - * Set the Price (component 2) from a BigDecimal object. - * - * @see #setComponent2(java.math.BigDecimal) - * - * @param component2 BigDecimal with the Price content to set - * @return the field object to enable build pattern - * @since 9.2.7 - */ - public Field35U setPrice(java.math.BigDecimal component2) { - return setComponent2(component2); - } - /** * Alternative method setter for field's Price (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 Price content to set * @return the field object to enable build pattern - * @see #setPrice(java.math.BigDecimal) */ public Field35U setPrice(java.lang.Number component2) { return setComponent2(component2); @@ -617,16 +579,6 @@ public Field35U setAmount(String component2) { return setPrice(component2); } - /** - * @deprecated use #setComponent2(java.math.BigDecimal) instead - * @since 9.2.7 - */ - @Deprecated - @ProwideDeprecated(phase4 = TargetYear.SRU2024) - public Field35U setAmount(java.math.BigDecimal component2) { - return setPrice(component2); - } - /** * @deprecated use #setPrice(java.math.BigDecimal) instead */ @@ -674,6 +626,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); } @@ -742,7 +695,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field35U(f)); } 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 9402cae90..d7361ba89 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; @@ -208,17 +205,15 @@ public String getValue() { */ @Override 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; } @@ -235,7 +230,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type 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,32 +395,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) { @@ -457,27 +433,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); @@ -500,6 +462,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); } @@ -568,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 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 0ed2661d6..5bafd901f 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; @@ -240,14 +237,13 @@ 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; } @@ -264,7 +260,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type 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,32 +505,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) { @@ -566,27 +543,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); @@ -609,6 +572,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); } @@ -620,6 +584,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; } @@ -630,6 +595,7 @@ public String getDSS() { * @see #getDSS() * @return true if DSS is present, false otherwise. */ + @Override public boolean isDSSPresent() { return false; } @@ -644,6 +610,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); } @@ -711,7 +678,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 a972386da..25e7268ee 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; @@ -229,11 +226,9 @@ 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); } /** @@ -248,7 +243,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type 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 Field36C setCode(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; } @@ -466,6 +462,7 @@ public String getDSS() { * @see #getDSS() * @return true if DSS is present, false otherwise. */ + @Override public boolean isDSSPresent() { return false; } @@ -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 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 bf67bcc50..f075cadfa 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; @@ -238,11 +235,9 @@ 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); } /** @@ -257,7 +252,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type 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 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) { @@ -558,27 +535,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); @@ -592,6 +555,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; } @@ -602,6 +566,7 @@ public String getDSS() { * @see #getDSS() * @return true if DSS is present, false otherwise. */ + @Override public boolean isDSSPresent() { return false; } @@ -616,6 +581,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); } @@ -683,7 +649,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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/Field36E.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field36E.java index 5a88c4c86..4a2b84a28 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field36E.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field36E.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; @@ -260,14 +257,13 @@ 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; } @@ -284,7 +280,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type 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 +599,13 @@ public Field36E 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 Field36E 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 Field36E setComponent4(java.lang.Number component4) { @@ -660,27 +637,13 @@ public Field36E 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 Field36E 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 Field36E setQuantity(java.lang.Number component4) { return setComponent4(component4); @@ -695,16 +658,6 @@ public Field36E setAmount(String component4) { return setQuantity(component4); } - /** - * @deprecated use #setComponent4(java.math.BigDecimal) instead - * @since 9.2.7 - */ - @Deprecated - @ProwideDeprecated(phase4 = TargetYear.SRU2024) - public Field36E setAmount(java.math.BigDecimal component4) { - return setQuantity(component4); - } - /** * @deprecated use #setQuantity(java.math.BigDecimal) instead */ @@ -731,6 +684,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); } @@ -742,6 +696,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; } @@ -752,6 +707,7 @@ public String getDSS() { * @see #getDSS() * @return true if DSS is present, false otherwise. */ + @Override public boolean isDSSPresent() { return false; } @@ -766,6 +722,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); } @@ -833,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 Field36E(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field37A.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field37A.java index 0e35ebc55..98081474c 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field37A.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field37A.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; @@ -307,11 +304,9 @@ 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); } /** @@ -326,7 +321,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -700,32 +695,13 @@ public Field37A 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 Field37A 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 Field37A setComponent1(java.lang.Number component1) { @@ -757,27 +733,13 @@ public Field37A 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 Field37A 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 Field37A setRate(java.lang.Number component1) { return setComponent1(component1); @@ -886,32 +848,14 @@ public Field37A 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 content to set - * @return the field object to enable build pattern - */ - public Field37A setComponent4(java.lang.Long component4) { - setComponent(4, SwiftFormatUtils.getLong(component4)); - return this; - } /** * Alternative method setter for field's 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 Number content to set * @return the field object to enable build pattern - * @see #setNumber(java.lang.Long) */ public Field37A setComponent4(java.lang.Number component4) { @@ -941,27 +885,13 @@ public Field37A setNumber(String component4) { return setComponent4(component4); } - /** - * Set the Number (component 4) from a Long object. - * - * @see #setComponent4(java.lang.Long) - * - * @param component4 Long with the Number content to set - * @return the field object to enable build pattern - * @since 9.2.7 - */ - public Field37A setNumber(java.lang.Long component4) { - return setComponent4(component4); - } - /** * Alternative method setter for field's 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 Number content to set * @return the field object to enable build pattern - * @see #setNumber(java.lang.Long) */ public Field37A setNumber(java.lang.Number component4) { return setComponent4(component4); @@ -976,16 +906,6 @@ public Field37A setNumberofDaysMonths(String component4) { return setNumber(component4); } - /** - * @deprecated use #setComponent4(java.lang.Long) instead - * @since 9.2.7 - */ - @Deprecated - @ProwideDeprecated(phase4 = TargetYear.SRU2024) - public Field37A setNumberofDaysMonths(java.lang.Long component4) { - return setNumber(component4); - } - /** * @deprecated use #setNumber(java.lang.Long) instead */ @@ -1033,6 +953,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); } @@ -1042,6 +963,7 @@ public BigDecimal amount() { * * @return the list of converted components (a Calendar object or null) */ + @Override public List dates() { return DateResolver.dates(this); } @@ -1119,7 +1041,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field37A(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field37B.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field37B.java index 1b35137a6..6d7197f2c 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field37B.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field37B.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; @@ -307,11 +304,9 @@ 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); } /** @@ -326,7 +321,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -700,32 +695,13 @@ public Field37B 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 Field37B 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 Field37B setComponent1(java.lang.Number component1) { @@ -757,27 +733,13 @@ public Field37B 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 Field37B 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 Field37B setRate(java.lang.Number component1) { return setComponent1(component1); @@ -886,32 +848,14 @@ public Field37B 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 content to set - * @return the field object to enable build pattern - */ - public Field37B setComponent4(java.lang.Long component4) { - setComponent(4, SwiftFormatUtils.getLong(component4)); - return this; - } /** * Alternative method setter for field's 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 Number content to set * @return the field object to enable build pattern - * @see #setNumber(java.lang.Long) */ public Field37B setComponent4(java.lang.Number component4) { @@ -941,27 +885,13 @@ public Field37B setNumber(String component4) { return setComponent4(component4); } - /** - * Set the Number (component 4) from a Long object. - * - * @see #setComponent4(java.lang.Long) - * - * @param component4 Long with the Number content to set - * @return the field object to enable build pattern - * @since 9.2.7 - */ - public Field37B setNumber(java.lang.Long component4) { - return setComponent4(component4); - } - /** * Alternative method setter for field's 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 Number content to set * @return the field object to enable build pattern - * @see #setNumber(java.lang.Long) */ public Field37B setNumber(java.lang.Number component4) { return setComponent4(component4); @@ -976,16 +906,6 @@ public Field37B setNumberofDaysMonths(String component4) { return setNumber(component4); } - /** - * @deprecated use #setComponent4(java.lang.Long) instead - * @since 9.2.7 - */ - @Deprecated - @ProwideDeprecated(phase4 = TargetYear.SRU2024) - public Field37B setNumberofDaysMonths(java.lang.Long component4) { - return setNumber(component4); - } - /** * @deprecated use #setNumber(java.lang.Long) instead */ @@ -1033,6 +953,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); } @@ -1042,6 +963,7 @@ public BigDecimal amount() { * * @return the list of converted components (a Calendar object or null) */ + @Override public List dates() { return DateResolver.dates(this); } @@ -1119,7 +1041,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field37B(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field37C.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field37C.java index eed0ce5c6..f8eaf6370 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field37C.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field37C.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; @@ -307,11 +304,9 @@ 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); } /** @@ -326,7 +321,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -700,32 +695,13 @@ public Field37C 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 Field37C 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 Field37C setComponent1(java.lang.Number component1) { @@ -757,27 +733,13 @@ public Field37C 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 Field37C 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 Field37C setRate(java.lang.Number component1) { return setComponent1(component1); @@ -886,32 +848,14 @@ public Field37C 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 content to set - * @return the field object to enable build pattern - */ - public Field37C setComponent4(java.lang.Long component4) { - setComponent(4, SwiftFormatUtils.getLong(component4)); - return this; - } /** * Alternative method setter for field's 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 Number content to set * @return the field object to enable build pattern - * @see #setNumber(java.lang.Long) */ public Field37C setComponent4(java.lang.Number component4) { @@ -941,27 +885,13 @@ public Field37C setNumber(String component4) { return setComponent4(component4); } - /** - * Set the Number (component 4) from a Long object. - * - * @see #setComponent4(java.lang.Long) - * - * @param component4 Long with the Number content to set - * @return the field object to enable build pattern - * @since 9.2.7 - */ - public Field37C setNumber(java.lang.Long component4) { - return setComponent4(component4); - } - /** * Alternative method setter for field's 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 Number content to set * @return the field object to enable build pattern - * @see #setNumber(java.lang.Long) */ public Field37C setNumber(java.lang.Number component4) { return setComponent4(component4); @@ -976,16 +906,6 @@ public Field37C setNumberofDaysMonths(String component4) { return setNumber(component4); } - /** - * @deprecated use #setComponent4(java.lang.Long) instead - * @since 9.2.7 - */ - @Deprecated - @ProwideDeprecated(phase4 = TargetYear.SRU2024) - public Field37C setNumberofDaysMonths(java.lang.Long component4) { - return setNumber(component4); - } - /** * @deprecated use #setNumber(java.lang.Long) instead */ @@ -1033,6 +953,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); } @@ -1042,6 +963,7 @@ public BigDecimal amount() { * * @return the list of converted components (a Calendar object or null) */ + @Override public List dates() { return DateResolver.dates(this); } @@ -1119,7 +1041,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field37C(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field37D.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field37D.java index df6c87535..f9b632785 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field37D.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field37D.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; @@ -307,11 +304,9 @@ 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); } /** @@ -326,7 +321,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -700,32 +695,13 @@ public Field37D 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 Field37D 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 Field37D setComponent1(java.lang.Number component1) { @@ -757,27 +733,13 @@ public Field37D 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 Field37D 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 Field37D setRate(java.lang.Number component1) { return setComponent1(component1); @@ -886,32 +848,14 @@ public Field37D 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 content to set - * @return the field object to enable build pattern - */ - public Field37D setComponent4(java.lang.Long component4) { - setComponent(4, SwiftFormatUtils.getLong(component4)); - return this; - } /** * Alternative method setter for field's 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 Number content to set * @return the field object to enable build pattern - * @see #setNumber(java.lang.Long) */ public Field37D setComponent4(java.lang.Number component4) { @@ -941,27 +885,13 @@ public Field37D setNumber(String component4) { return setComponent4(component4); } - /** - * Set the Number (component 4) from a Long object. - * - * @see #setComponent4(java.lang.Long) - * - * @param component4 Long with the Number content to set - * @return the field object to enable build pattern - * @since 9.2.7 - */ - public Field37D setNumber(java.lang.Long component4) { - return setComponent4(component4); - } - /** * Alternative method setter for field's 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 Number content to set * @return the field object to enable build pattern - * @see #setNumber(java.lang.Long) */ public Field37D setNumber(java.lang.Number component4) { return setComponent4(component4); @@ -976,16 +906,6 @@ public Field37D setNumberofDaysMonths(String component4) { return setNumber(component4); } - /** - * @deprecated use #setComponent4(java.lang.Long) instead - * @since 9.2.7 - */ - @Deprecated - @ProwideDeprecated(phase4 = TargetYear.SRU2024) - public Field37D setNumberofDaysMonths(java.lang.Long component4) { - return setNumber(component4); - } - /** * @deprecated use #setNumber(java.lang.Long) instead */ @@ -1033,6 +953,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); } @@ -1042,6 +963,7 @@ public BigDecimal amount() { * * @return the list of converted components (a Calendar object or null) */ + @Override public List dates() { return DateResolver.dates(this); } @@ -1119,7 +1041,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field37D(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field37E.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field37E.java index 421966208..da6910c99 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field37E.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field37E.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; @@ -307,11 +304,9 @@ 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); } /** @@ -326,7 +321,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -700,32 +695,13 @@ public Field37E 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 Field37E 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 Field37E setComponent1(java.lang.Number component1) { @@ -757,27 +733,13 @@ public Field37E 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 Field37E 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 Field37E setRate(java.lang.Number component1) { return setComponent1(component1); @@ -886,32 +848,14 @@ public Field37E 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 content to set - * @return the field object to enable build pattern - */ - public Field37E setComponent4(java.lang.Long component4) { - setComponent(4, SwiftFormatUtils.getLong(component4)); - return this; - } /** * Alternative method setter for field's 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 Number content to set * @return the field object to enable build pattern - * @see #setNumber(java.lang.Long) */ public Field37E setComponent4(java.lang.Number component4) { @@ -941,27 +885,13 @@ public Field37E setNumber(String component4) { return setComponent4(component4); } - /** - * Set the Number (component 4) from a Long object. - * - * @see #setComponent4(java.lang.Long) - * - * @param component4 Long with the Number content to set - * @return the field object to enable build pattern - * @since 9.2.7 - */ - public Field37E setNumber(java.lang.Long component4) { - return setComponent4(component4); - } - /** * Alternative method setter for field's 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 Number content to set * @return the field object to enable build pattern - * @see #setNumber(java.lang.Long) */ public Field37E setNumber(java.lang.Number component4) { return setComponent4(component4); @@ -976,16 +906,6 @@ public Field37E setNumberofDaysMonths(String component4) { return setNumber(component4); } - /** - * @deprecated use #setComponent4(java.lang.Long) instead - * @since 9.2.7 - */ - @Deprecated - @ProwideDeprecated(phase4 = TargetYear.SRU2024) - public Field37E setNumberofDaysMonths(java.lang.Long component4) { - return setNumber(component4); - } - /** * @deprecated use #setNumber(java.lang.Long) instead */ @@ -1033,6 +953,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); } @@ -1042,6 +963,7 @@ public BigDecimal amount() { * * @return the list of converted components (a Calendar object or null) */ + @Override public List dates() { return DateResolver.dates(this); } @@ -1119,7 +1041,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field37E(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field37F.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field37F.java index 2296a90a7..15546aa4c 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field37F.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field37F.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; @@ -307,11 +304,9 @@ 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); } /** @@ -326,7 +321,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -700,32 +695,13 @@ public Field37F 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 Field37F 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 Field37F setComponent1(java.lang.Number component1) { @@ -757,27 +733,13 @@ public Field37F 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 Field37F 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 Field37F setRate(java.lang.Number component1) { return setComponent1(component1); @@ -886,32 +848,14 @@ public Field37F 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 content to set - * @return the field object to enable build pattern - */ - public Field37F setComponent4(java.lang.Long component4) { - setComponent(4, SwiftFormatUtils.getLong(component4)); - return this; - } /** * Alternative method setter for field's 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 Number content to set * @return the field object to enable build pattern - * @see #setNumber(java.lang.Long) */ public Field37F setComponent4(java.lang.Number component4) { @@ -941,27 +885,13 @@ public Field37F setNumber(String component4) { return setComponent4(component4); } - /** - * Set the Number (component 4) from a Long object. - * - * @see #setComponent4(java.lang.Long) - * - * @param component4 Long with the Number content to set - * @return the field object to enable build pattern - * @since 9.2.7 - */ - public Field37F setNumber(java.lang.Long component4) { - return setComponent4(component4); - } - /** * Alternative method setter for field's 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 Number content to set * @return the field object to enable build pattern - * @see #setNumber(java.lang.Long) */ public Field37F setNumber(java.lang.Number component4) { return setComponent4(component4); @@ -976,16 +906,6 @@ public Field37F setNumberofDaysMonths(String component4) { return setNumber(component4); } - /** - * @deprecated use #setComponent4(java.lang.Long) instead - * @since 9.2.7 - */ - @Deprecated - @ProwideDeprecated(phase4 = TargetYear.SRU2024) - public Field37F setNumberofDaysMonths(java.lang.Long component4) { - return setNumber(component4); - } - /** * @deprecated use #setNumber(java.lang.Long) instead */ @@ -1033,6 +953,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); } @@ -1042,6 +963,7 @@ public BigDecimal amount() { * * @return the list of converted components (a Calendar object or null) */ + @Override public List dates() { return DateResolver.dates(this); } @@ -1119,7 +1041,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field37F(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 325479aa6..7cf4667ad 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; @@ -222,14 +219,13 @@ 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; } @@ -246,7 +242,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -454,32 +450,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) { @@ -511,27 +488,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); @@ -554,6 +517,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); } @@ -622,7 +586,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 163cb786c..3d6bdcd12 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; @@ -247,14 +244,13 @@ 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; } @@ -271,7 +267,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -541,32 +537,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) { @@ -598,27 +575,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); @@ -641,6 +604,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); } @@ -709,7 +673,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 7feb13a77..f1c906de3 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; @@ -208,17 +205,15 @@ public String getValue() { */ @Override 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; } @@ -235,7 +230,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type 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,32 +395,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) { @@ -457,27 +433,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); @@ -500,6 +462,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); } @@ -568,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 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 2849420d5..8fa21dcb2 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; @@ -222,14 +219,13 @@ 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; } @@ -246,7 +242,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type 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,32 +447,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) { @@ -508,27 +485,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); @@ -551,6 +514,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); } @@ -619,7 +583,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 ecb77fe00..398bb378b 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; @@ -208,17 +205,15 @@ public String getValue() { */ @Override 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; } @@ -235,7 +230,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type 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,32 +395,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) { @@ -457,27 +433,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); @@ -500,6 +462,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); } @@ -568,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 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 0aa230a71..5c0b00aa1 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; @@ -222,14 +219,13 @@ 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; } @@ -246,7 +242,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -454,32 +450,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) { @@ -511,27 +488,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); @@ -554,6 +517,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); } @@ -622,7 +586,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 6e470068b..5fec9e685 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/Field37P.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field37P.java index d919c78dd..d33c84bf4 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field37P.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field37P.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; @@ -208,17 +205,15 @@ public String getValue() { */ @Override public String getValueDisplay(int component, Locale locale) { - if (component < 1 || component > 1) { + if (component != 1) { throw new IllegalArgumentException("invalid component number " + component + " for field 37P"); } - 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; } @@ -235,7 +230,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type 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,32 +395,13 @@ public Field37P 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 Field37P 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 Field37P setComponent1(java.lang.Number component1) { @@ -457,27 +433,13 @@ public Field37P 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 Field37P 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 Field37P setRate(java.lang.Number component1) { return setComponent1(component1); @@ -500,6 +462,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); } @@ -568,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 Field37P(f)); } 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 70f343140..efd3f7ab6 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; @@ -222,14 +219,13 @@ 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; } @@ -246,7 +242,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -454,32 +450,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) { @@ -511,27 +488,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); @@ -554,6 +517,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); } @@ -622,7 +586,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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/Field37U.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field37U.java index bba256fde..34b9823d2 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field37U.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field37U.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; @@ -208,17 +205,15 @@ public String getValue() { */ @Override public String getValueDisplay(int component, Locale locale) { - if (component < 1 || component > 1) { + if (component != 1) { throw new IllegalArgumentException("invalid component number " + component + " for field 37U"); } - 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; } @@ -235,7 +230,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type 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,32 +395,13 @@ public Field37U 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 Field37U 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 Field37U setComponent1(java.lang.Number component1) { @@ -457,27 +433,13 @@ public Field37U 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 Field37U 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 Field37U setRate(java.lang.Number component1) { return setComponent1(component1); @@ -500,6 +462,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); } @@ -568,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 Field37U(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 c2c8720e6..f7d151341 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; @@ -222,14 +219,13 @@ 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; } @@ -246,7 +242,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -454,32 +450,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) { @@ -511,27 +488,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); @@ -554,6 +517,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); } @@ -622,7 +586,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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/Field38A.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field38A.java index 4b7f52689..80509d86a 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field38A.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field38A.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; @@ -213,14 +210,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 38A"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** @@ -235,7 +229,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -432,32 +426,14 @@ public Field38A 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 Period content to set - * @return the field object to enable build pattern - */ - public Field38A setComponent1(java.lang.Long component1) { - setComponent(1, SwiftFormatUtils.getLong(component1)); - return this; - } /** * Alternative method setter for field's Period (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 Period content to set * @return the field object to enable build pattern - * @see #setPeriod(java.lang.Long) */ public Field38A setComponent1(java.lang.Number component1) { @@ -487,27 +463,13 @@ public Field38A setPeriod(String component1) { return setComponent1(component1); } - /** - * Set the Period (component 1) from a Long object. - * - * @see #setComponent1(java.lang.Long) - * - * @param component1 Long with the Period content to set - * @return the field object to enable build pattern - * @since 9.2.7 - */ - public Field38A setPeriod(java.lang.Long component1) { - return setComponent1(component1); - } - /** * Alternative method setter for field's Period (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 Period content to set * @return the field object to enable build pattern - * @see #setPeriod(java.lang.Long) */ public Field38A setPeriod(java.lang.Number component1) { return setComponent1(component1); @@ -522,16 +484,6 @@ public Field38A setNumber(String component1) { return setPeriod(component1); } - /** - * @deprecated use #setComponent1(java.lang.Long) instead - * @since 9.2.7 - */ - @Deprecated - @ProwideDeprecated(phase4 = TargetYear.SRU2024) - public Field38A setNumber(java.lang.Long component1) { - return setPeriod(component1); - } - /** * @deprecated use #setPeriod(java.lang.Long) instead */ @@ -606,7 +558,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field38A(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field38D.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field38D.java index efbc5d01c..a50d65b9c 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field38D.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field38D.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; @@ -213,14 +210,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 38D"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** @@ -235,7 +229,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -432,32 +426,14 @@ public Field38D 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 Period content to set - * @return the field object to enable build pattern - */ - public Field38D setComponent1(java.lang.Long component1) { - setComponent(1, SwiftFormatUtils.getLong(component1)); - return this; - } /** * Alternative method setter for field's Period (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 Period content to set * @return the field object to enable build pattern - * @see #setPeriod(java.lang.Long) */ public Field38D setComponent1(java.lang.Number component1) { @@ -487,27 +463,13 @@ public Field38D setPeriod(String component1) { return setComponent1(component1); } - /** - * Set the Period (component 1) from a Long object. - * - * @see #setComponent1(java.lang.Long) - * - * @param component1 Long with the Period content to set - * @return the field object to enable build pattern - * @since 9.2.7 - */ - public Field38D setPeriod(java.lang.Long component1) { - return setComponent1(component1); - } - /** * Alternative method setter for field's Period (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 Period content to set * @return the field object to enable build pattern - * @see #setPeriod(java.lang.Long) */ public Field38D setPeriod(java.lang.Number component1) { return setComponent1(component1); @@ -522,16 +484,6 @@ public Field38D setNumber(String component1) { return setPeriod(component1); } - /** - * @deprecated use #setComponent1(java.lang.Long) instead - * @since 9.2.7 - */ - @Deprecated - @ProwideDeprecated(phase4 = TargetYear.SRU2024) - public Field38D setNumber(java.lang.Long component1) { - return setPeriod(component1); - } - /** * @deprecated use #setPeriod(java.lang.Long) instead */ @@ -606,7 +558,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field38D(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 c3cb76136..787179677 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; @@ -220,11 +217,9 @@ 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); } /** @@ -239,7 +234,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -424,32 +419,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) { @@ -479,27 +456,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); @@ -591,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 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 0f28261ed..ce3c8ec8e 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; @@ -247,11 +244,9 @@ 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); } /** @@ -266,7 +261,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -527,32 +522,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) { @@ -582,27 +559,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); @@ -640,32 +603,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) { @@ -695,27 +640,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); @@ -807,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 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 09b70356a..734cac590 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; @@ -247,11 +244,9 @@ 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); } /** @@ -266,7 +261,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -527,32 +522,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) { @@ -582,27 +559,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); @@ -640,32 +603,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) { @@ -695,27 +640,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); @@ -807,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 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 8890c1e5d..2a3de6d5e 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; @@ -227,11 +224,9 @@ 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); } /** @@ -246,7 +241,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -474,32 +469,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) { @@ -529,27 +506,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); @@ -620,7 +583,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 aab4bf5fa..ea15fc8ec 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; @@ -222,11 +219,9 @@ 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); } /** @@ -241,7 +236,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -464,32 +459,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) { @@ -519,27 +496,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); @@ -556,32 +519,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) { @@ -611,27 +556,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); @@ -702,7 +633,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 d56a1268b..0189b20a2 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; @@ -204,14 +201,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 39B"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** @@ -226,7 +220,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -429,7 +423,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 554fc66e6..37f4a9fbd 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; @@ -224,11 +221,9 @@ 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); } /** @@ -243,7 +238,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -615,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 Field39C(f)); } @@ -631,6 +626,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); } @@ -644,6 +640,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); @@ -656,6 +653,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()); } @@ -668,6 +666,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)); @@ -682,6 +681,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); } @@ -696,6 +696,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/Field39D.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field39D.java index a06f6bbd7..f9ffc5995 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field39D.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field39D.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; @@ -264,11 +261,9 @@ 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); } /** @@ -283,7 +278,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -999,7 +994,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field39D(f)); } @@ -1015,6 +1010,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); } @@ -1028,6 +1024,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) { Field39D cp = newInstance(this); return getLine(cp, line, null, offset); @@ -1040,6 +1037,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()); } @@ -1052,6 +1050,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) { Field39D cp = newInstance(this); return SwiftParseUtils.getLines(getLine(cp, null, null, offset)); @@ -1066,6 +1065,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); } @@ -1080,6 +1080,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) { Field39D 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 6f90596b6..ff0e4aa72 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; @@ -264,11 +261,9 @@ 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); } /** @@ -283,7 +278,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -999,7 +994,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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)); } @@ -1015,6 +1010,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); } @@ -1028,6 +1024,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); @@ -1040,6 +1037,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()); } @@ -1052,6 +1050,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)); @@ -1066,6 +1065,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); } @@ -1080,6 +1080,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 8975653a4..391efb8c0 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; @@ -264,11 +261,9 @@ 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); } /** @@ -283,7 +278,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -999,7 +994,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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)); } @@ -1015,6 +1010,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); } @@ -1028,6 +1024,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); @@ -1040,6 +1037,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()); } @@ -1052,6 +1050,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)); @@ -1066,6 +1065,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); } @@ -1080,6 +1080,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 3a73372bf..234b67a8d 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; @@ -204,14 +201,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 39M"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** @@ -226,7 +220,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -429,7 +423,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 1379fea9f..39a863d96 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; @@ -206,14 +203,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 401"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** @@ -228,7 +222,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -394,32 +388,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) { @@ -449,27 +425,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); @@ -540,7 +502,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 a07f1b24c..108b999af 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; @@ -226,11 +223,9 @@ 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); } /** @@ -245,7 +240,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type 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,32 +446,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) { @@ -506,27 +483,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); @@ -597,7 +560,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 b15f65db4..80e9ba83b 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; @@ -204,14 +201,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 40A"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** @@ -226,7 +220,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -429,7 +423,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 3c222e837..e1c3ccf76 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; @@ -224,11 +221,9 @@ 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); } /** @@ -243,7 +238,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -486,7 +481,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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)); } @@ -502,6 +497,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); } @@ -515,6 +511,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); @@ -527,6 +524,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()); } @@ -539,6 +537,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)); @@ -553,6 +552,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); } @@ -567,6 +567,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 6c0d25bf1..c18983d1e 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; @@ -221,11 +218,9 @@ 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); } /** @@ -240,7 +235,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -486,7 +481,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 7f30c6e00..5c19fc08d 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; @@ -204,14 +201,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 40D"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** @@ -226,7 +220,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -429,7 +423,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 27392d682..d8dcd99dd 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; @@ -221,11 +218,9 @@ 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); } /** @@ -240,7 +235,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -486,7 +481,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 8bd350507..540bede57 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; @@ -204,14 +201,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 40F"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** @@ -226,7 +220,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -429,7 +423,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 5ea37223d..e942a4e28 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; @@ -234,11 +231,9 @@ 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); } /** @@ -253,7 +248,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -512,10 +507,12 @@ public Field41A setCode(String component2) { } + @Override public List bics() { return BICResolver.bics(this); } + @Override public List bicStrings () { return BICResolver.bicStrings(this); } @@ -584,7 +581,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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)); } @@ -600,6 +597,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 +611,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); @@ -625,6 +624,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 +637,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)); @@ -651,6 +652,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 +667,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 9bb722549..b2b71adff 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; @@ -252,11 +249,9 @@ 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); } /** @@ -271,7 +266,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -683,7 +678,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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)); } @@ -699,6 +694,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); } @@ -712,6 +708,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); @@ -724,6 +721,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()); } @@ -736,6 +734,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)); @@ -750,6 +749,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); } @@ -764,6 +764,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 f1ec3a679..684a794c8 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; @@ -214,14 +211,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 41F"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** @@ -236,7 +230,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type 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 +449,12 @@ public Field41F setBIC(com.prowidesoftware.swift.model.BIC component1) { } + @Override public List bics() { return BICResolver.bics(this); } + @Override public List bicStrings () { return BICResolver.bicStrings(this); } @@ -527,7 +523,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 6294d4005..b0f80e233 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; @@ -224,11 +221,9 @@ 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); } /** @@ -243,7 +238,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -615,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 Field41G(f)); } @@ -631,6 +626,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); } @@ -644,6 +640,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); @@ -656,6 +653,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()); } @@ -668,6 +666,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)); @@ -682,6 +681,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); } @@ -696,6 +696,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 c51e79ebe..a00ccf755 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; @@ -204,14 +201,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 421"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** @@ -226,7 +220,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -429,7 +423,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 a7fe2259e..06149772a 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; @@ -235,7 +232,6 @@ public String getValue() { final StringBuilder result = new StringBuilder(); //FIXME serialization 12*(S/S) // @NotImplemented - int notImplemented; return result.toString(); } @@ -345,11 +341,9 @@ 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); } /** @@ -364,7 +358,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -1007,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 Field422(f)); } @@ -1022,11 +1016,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(); - - @@ -1051,7 +1043,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 0986f40f7..f89d13958 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; @@ -204,14 +201,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 423"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** @@ -226,7 +220,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -429,7 +423,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 740baa586..86766ebaf 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; @@ -204,14 +201,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 424"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** @@ -226,7 +220,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -429,7 +423,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 efeedaf89..bcdb2c9e8 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; @@ -251,7 +248,6 @@ public String getValue() { final StringBuilder result = new StringBuilder(); //FIXME serialization 20*(S/S) // @NotImplemented - int notImplemented; return result.toString(); } @@ -425,11 +421,9 @@ 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); } /** @@ -444,7 +438,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -1407,7 +1401,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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)); } @@ -1422,11 +1416,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(); - - @@ -1467,7 +1459,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 76df94cd5..35f971dcc 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; @@ -260,10 +257,12 @@ public Field42A setBIC(com.prowidesoftware.swift.model.BIC component3) { } + @Override public List bics() { return BICResolver.bics(this); } + @Override public List bicStrings () { return BICResolver.bicStrings(this); } @@ -332,7 +331,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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)); } @@ -348,6 +347,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); } @@ -361,6 +361,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); @@ -373,6 +374,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()); } @@ -385,6 +387,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)); @@ -399,6 +402,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); } @@ -413,6 +417,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 29b762f8b..c8ec0bcce 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; @@ -219,11 +216,9 @@ 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); } /** @@ -238,7 +233,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type 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,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 Field42C(f)); } @@ -583,6 +578,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); } @@ -596,6 +592,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); @@ -608,6 +605,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()); } @@ -620,6 +618,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)); @@ -634,6 +633,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); } @@ -648,6 +648,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 2516dc0fc..2925cf815 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 8424c9527..57c572db2 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; @@ -224,11 +221,9 @@ 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); } /** @@ -243,7 +238,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -615,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 Field42M(f)); } @@ -631,6 +626,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); } @@ -644,6 +640,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); @@ -656,6 +653,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()); } @@ -668,6 +666,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)); @@ -682,6 +681,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); } @@ -696,6 +696,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 9bedbd460..b33731986 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; @@ -224,11 +221,9 @@ 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); } /** @@ -243,7 +238,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -615,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 Field42P(f)); } @@ -631,6 +626,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); } @@ -644,6 +640,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); @@ -656,6 +653,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()); } @@ -668,6 +666,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)); @@ -682,6 +681,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); } @@ -696,6 +696,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 e88655051..b0878f93d 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; @@ -206,14 +203,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 431"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** @@ -228,7 +222,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -394,32 +388,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) { @@ -449,27 +425,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); @@ -540,7 +502,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 c071f5e53..e7f26f12c 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; @@ -204,14 +201,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 432"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** @@ -226,7 +220,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -429,7 +423,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 af2f21b17..0224e41a7 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; @@ -221,11 +218,9 @@ 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); } /** @@ -240,7 +235,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -483,7 +478,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 a60bb3871..fc5db68de 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; @@ -221,11 +218,9 @@ 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); } /** @@ -240,7 +235,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -483,7 +478,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 0e079d530..6382ae25e 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; @@ -211,14 +208,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 43P"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** @@ -233,7 +227,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type 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,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 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 0e8c879f1..f9ba88338 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; @@ -211,14 +208,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 43T"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** @@ -233,7 +227,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type 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,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 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 424a54ce7..acd4ff628 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; @@ -204,14 +201,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 443"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** @@ -226,7 +220,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -429,7 +423,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 38cdf3209..ccff9140d 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; @@ -204,14 +201,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 44A"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** @@ -226,7 +220,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -429,7 +423,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 2153afa9d..203736eb6 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; @@ -204,14 +201,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 44B"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** @@ -226,7 +220,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -429,7 +423,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 55c985511..e4bfc34a8 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; @@ -207,16 +204,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 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; } @@ -233,7 +228,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -417,6 +412,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); } @@ -494,7 +490,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 cf8b655d1..580e45cd9 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; @@ -234,11 +231,9 @@ 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); } /** @@ -253,7 +248,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -711,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 Field44D(f)); } @@ -727,6 +722,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); } @@ -740,6 +736,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); @@ -752,6 +749,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()); } @@ -764,6 +762,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)); @@ -778,6 +777,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); } @@ -792,6 +792,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 956823863..ff9807e99 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; @@ -204,14 +201,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 44E"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** @@ -226,7 +220,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -429,7 +423,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 26de2e6a2..4dca23020 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; @@ -204,14 +201,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 44F"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** @@ -226,7 +220,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -429,7 +423,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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/Field44H.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field44H.java index 7a7eb8269..64a0e3822 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field44H.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field44H.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; @@ -221,11 +218,9 @@ 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); } /** @@ -240,7 +235,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -486,7 +481,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field44H(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 124fc584a..dda875cfb 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; @@ -240,11 +237,9 @@ 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); } /** @@ -259,7 +254,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -548,7 +543,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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)); } @@ -564,6 +559,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); } @@ -577,6 +573,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); @@ -589,6 +586,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()); } @@ -601,6 +599,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)); @@ -615,6 +614,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); } @@ -629,6 +629,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 01eaad9aa..a115f8dd6 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; @@ -206,14 +203,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 451"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** @@ -228,7 +222,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -394,32 +388,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) { @@ -449,27 +425,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); @@ -540,7 +502,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 47b3af0c7..3d68aa618 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; @@ -205,14 +202,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 45A"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** @@ -227,7 +221,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type 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,7 +424,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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)); } @@ -446,6 +440,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); } @@ -459,6 +454,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); @@ -471,6 +467,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()); } @@ -483,6 +480,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)); @@ -497,6 +495,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); } @@ -511,6 +510,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 1cdde4914..cc396675c 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 228a146e8..1cc0e2e58 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; @@ -205,14 +202,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 45C"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** @@ -227,7 +221,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type 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,7 +424,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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)); } @@ -446,6 +440,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); } @@ -459,6 +454,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); @@ -471,6 +467,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()); } @@ -483,6 +480,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)); @@ -497,6 +495,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); } @@ -511,6 +510,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 9d5ea971a..b6bcaaa72 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; @@ -205,14 +202,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 45D"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** @@ -227,7 +221,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type 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,7 +424,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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)); } @@ -446,6 +440,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); } @@ -459,6 +454,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); @@ -471,6 +467,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()); } @@ -483,6 +480,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)); @@ -497,6 +495,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); } @@ -511,6 +510,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 0ef232305..b42d5bd2f 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; @@ -205,14 +202,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 45L"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** @@ -227,7 +221,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type 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,7 +424,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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)); } @@ -446,6 +440,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); } @@ -459,6 +454,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); @@ -471,6 +467,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()); } @@ -483,6 +480,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)); @@ -497,6 +495,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); } @@ -511,6 +510,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 89740b168..6c25ad01e 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; @@ -204,14 +201,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 461"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** @@ -226,7 +220,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -429,7 +423,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 79792e46c..09a1ad33d 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; @@ -205,14 +202,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 46A"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** @@ -227,7 +221,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type 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,7 +424,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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)); } @@ -446,6 +440,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); } @@ -459,6 +454,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); @@ -471,6 +467,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()); } @@ -483,6 +480,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)); @@ -497,6 +495,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); } @@ -511,6 +510,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 bf50f28cd..d38ce8127 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 88c5ba6d2..1267c571a 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; @@ -205,14 +202,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 47A"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** @@ -227,7 +221,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type 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,7 +424,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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)); } @@ -446,6 +440,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); } @@ -459,6 +454,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); @@ -471,6 +467,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()); } @@ -483,6 +480,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)); @@ -497,6 +495,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); } @@ -511,6 +510,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 328d08f14..5207bf6b1 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 865220412..bf02b7006 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; @@ -223,11 +220,9 @@ 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); } /** @@ -242,7 +237,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type 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,32 +425,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) { @@ -485,27 +462,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); @@ -597,7 +560,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 c0ca779ce..12356fa31 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; @@ -204,14 +201,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 48B"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** @@ -226,7 +220,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -429,7 +423,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 651430cc9..0a0df07c8 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; @@ -204,14 +201,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 48D"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** @@ -226,7 +220,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -429,7 +423,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 910a7583f..3d501414c 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; @@ -204,14 +201,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 49"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** @@ -226,7 +220,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -429,7 +423,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 3e952a872..468c35834 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; @@ -235,11 +232,9 @@ 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); } /** @@ -254,7 +249,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -522,7 +517,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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)); } @@ -538,6 +533,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 +547,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); @@ -563,6 +560,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 +573,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)); @@ -589,6 +588,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 +603,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 c3d814326..0dee6df1f 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; @@ -205,14 +202,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 49G"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** @@ -227,7 +221,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type 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,7 +424,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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)); } @@ -446,6 +440,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); } @@ -459,6 +454,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); @@ -471,6 +467,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()); } @@ -483,6 +480,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)); @@ -497,6 +495,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); } @@ -511,6 +510,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 4257791ff..1064ca7d0 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; @@ -205,14 +202,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 49H"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** @@ -227,7 +221,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type 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,7 +424,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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)); } @@ -446,6 +440,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); } @@ -459,6 +454,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); @@ -471,6 +467,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()); } @@ -483,6 +480,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)); @@ -497,6 +495,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); } @@ -511,6 +510,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 a752efa5c..6ea30a044 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 52231fb37..f26a0720f 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 6c2823416..3b5acc121 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; @@ -224,11 +221,9 @@ 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); } /** @@ -243,7 +238,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -615,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 Field50(f)); } @@ -631,6 +626,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); } @@ -644,6 +640,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); @@ -656,6 +653,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()); } @@ -668,6 +666,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)); @@ -682,6 +681,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); } @@ -696,6 +696,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 fc0c4da5a..4607a019f 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; @@ -204,14 +201,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 503"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** @@ -226,7 +220,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -429,7 +423,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 65e1aa9ee..4f06c83bf 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; @@ -239,11 +236,9 @@ 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); } /** @@ -258,7 +253,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -529,10 +524,12 @@ public Field50A setBIC(com.prowidesoftware.swift.model.BIC component2) { } + @Override public List bics() { return BICResolver.bics(this); } + @Override public List bicStrings () { return BICResolver.bicStrings(this); } @@ -601,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 Field50A(f)); } @@ -617,6 +614,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); } @@ -630,6 +628,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); @@ -642,6 +641,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()); } @@ -654,6 +654,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)); @@ -668,6 +669,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); } @@ -682,6 +684,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 bb3345175..e587ca34f 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; @@ -224,11 +221,9 @@ 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); } /** @@ -243,7 +238,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -615,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 Field50B(f)); } @@ -631,6 +626,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); } @@ -644,6 +640,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); @@ -656,6 +653,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()); } @@ -668,6 +666,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)); @@ -682,6 +681,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); } @@ -696,6 +696,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 45b3aa7b5..b239a9f74 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; @@ -214,14 +211,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 50C"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** @@ -236,7 +230,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type 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 +449,12 @@ public Field50C setBIC(com.prowidesoftware.swift.model.BIC component1) { } + @Override public List bics() { return BICResolver.bics(this); } + @Override public List bicStrings () { return BICResolver.bicStrings(this); } @@ -527,7 +523,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 cd788f6c8..6f004b436 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 0e0fb5267..5b3f9b07b 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; @@ -305,9 +302,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) @@ -337,11 +333,9 @@ 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); } /** @@ -356,7 +350,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -827,32 +821,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) { @@ -882,27 +858,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); @@ -940,32 +902,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) { @@ -995,27 +939,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); @@ -1053,32 +983,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) { @@ -1108,27 +1020,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); @@ -1166,32 +1064,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) { @@ -1221,27 +1101,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); @@ -1333,7 +1199,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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)); } @@ -1349,6 +1215,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); } @@ -1362,6 +1229,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); @@ -1374,6 +1242,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()); } @@ -1386,6 +1255,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)); @@ -1400,6 +1270,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); } @@ -1414,6 +1285,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)); @@ -1561,25 +1433,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 22937f4c4..56ef146bc 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; @@ -238,10 +235,12 @@ public Field50G setBIC(com.prowidesoftware.swift.model.BIC component2) { } + @Override public List bics() { return BICResolver.bics(this); } + @Override public List bicStrings () { return BICResolver.bicStrings(this); } @@ -310,7 +309,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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)); } @@ -326,6 +325,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); } @@ -339,6 +339,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); @@ -351,6 +352,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()); } @@ -363,6 +365,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)); @@ -377,6 +380,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); } @@ -391,6 +395,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 a550a2fdd..d0d0bb191 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 6d6f97111..d781e6e43 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 f480bc032..9891f2ec9 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 06d4e5d08..0d14a46fd 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; @@ -224,11 +221,9 @@ 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); } /** @@ -243,7 +238,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -615,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 Field51(f)); } @@ -631,6 +626,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); } @@ -644,6 +640,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); @@ -656,6 +653,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()); } @@ -668,6 +666,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)); @@ -682,6 +681,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); } @@ -696,6 +696,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 d8c8c4a86..baeca3a11 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; @@ -260,10 +257,12 @@ public Field51A setBIC(com.prowidesoftware.swift.model.BIC component3) { } + @Override public List bics() { return BICResolver.bics(this); } + @Override public List bicStrings () { return BICResolver.bicStrings(this); } @@ -332,7 +331,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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)); } @@ -348,6 +347,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); } @@ -361,6 +361,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); @@ -373,6 +374,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()); } @@ -385,6 +387,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)); @@ -399,6 +402,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); } @@ -413,6 +417,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 3f394fac8..d1d26e4ee 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 3ceb4e28d..06fff2faa 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 e579c9a00..3ef5a8c25 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; @@ -260,10 +257,12 @@ public Field52A setBIC(com.prowidesoftware.swift.model.BIC component3) { } + @Override public List bics() { return BICResolver.bics(this); } + @Override public List bicStrings () { return BICResolver.bicStrings(this); } @@ -332,7 +331,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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)); } @@ -348,6 +347,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); } @@ -361,6 +361,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); @@ -373,6 +374,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()); } @@ -385,6 +387,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)); @@ -399,6 +402,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); } @@ -413,6 +417,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 026dcbdc1..33def3e55 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 cacba8406..c71291016 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 78ddd0d8d..2815de4a5 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 641346683..e85594c47 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; @@ -206,14 +203,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 533"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** @@ -228,7 +222,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -394,32 +388,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) { @@ -449,27 +425,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); @@ -540,7 +502,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 4eff152c0..57b9a5241 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; @@ -260,10 +257,12 @@ public Field53A setBIC(com.prowidesoftware.swift.model.BIC component3) { } + @Override public List bics() { return BICResolver.bics(this); } + @Override public List bicStrings () { return BICResolver.bicStrings(this); } @@ -332,7 +331,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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)); } @@ -348,6 +347,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); } @@ -361,6 +361,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); @@ -373,6 +374,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()); } @@ -385,6 +387,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)); @@ -399,6 +402,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); } @@ -413,6 +417,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 ff280b6d3..d641b6360 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 3642bd934..274d58e93 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 0a935f910..f395d0015 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 472f787f0..d6273ac37 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 0fc2bbcd5..b9c30817a 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; @@ -260,10 +257,12 @@ public Field54A setBIC(com.prowidesoftware.swift.model.BIC component3) { } + @Override public List bics() { return BICResolver.bics(this); } + @Override public List bicStrings () { return BICResolver.bicStrings(this); } @@ -332,7 +331,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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)); } @@ -348,6 +347,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); } @@ -361,6 +361,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); @@ -373,6 +374,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()); } @@ -385,6 +387,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)); @@ -399,6 +402,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); } @@ -413,6 +417,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 5ad813ee5..06f9c6761 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 81086988f..dd05c7a44 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 c5a42b275..d498c4235 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; @@ -260,10 +257,12 @@ public Field55A setBIC(com.prowidesoftware.swift.model.BIC component3) { } + @Override public List bics() { return BICResolver.bics(this); } + @Override public List bicStrings () { return BICResolver.bicStrings(this); } @@ -332,7 +331,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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)); } @@ -348,6 +347,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); } @@ -361,6 +361,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); @@ -373,6 +374,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()); } @@ -385,6 +387,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)); @@ -399,6 +402,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); } @@ -413,6 +417,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 6fcbbf0dd..b49f56a2e 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 0b6ba4254..5f285384c 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 236490b71..90c447455 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; @@ -260,10 +257,12 @@ public Field56A setBIC(com.prowidesoftware.swift.model.BIC component3) { } + @Override public List bics() { return BICResolver.bics(this); } + @Override public List bicStrings () { return BICResolver.bicStrings(this); } @@ -332,7 +331,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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)); } @@ -348,6 +347,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); } @@ -361,6 +361,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); @@ -373,6 +374,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()); } @@ -385,6 +387,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)); @@ -399,6 +402,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); } @@ -413,6 +417,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 a313f0190..a8169e349 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 3d3a4d7de..4732c7838 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 b00c8239a..09e99b0e9 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 6a4239191..ae46e9eb1 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 ce2769619..308b42714 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; @@ -260,10 +257,12 @@ public Field57A setBIC(com.prowidesoftware.swift.model.BIC component3) { } + @Override public List bics() { return BICResolver.bics(this); } + @Override public List bicStrings () { return BICResolver.bicStrings(this); } @@ -332,7 +331,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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)); } @@ -348,6 +347,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); } @@ -361,6 +361,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); @@ -373,6 +374,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()); } @@ -385,6 +387,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)); @@ -399,6 +402,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); } @@ -413,6 +417,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 a65477f37..db0bcfed8 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 6a7812475..97370934d 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 eb9e6df7d..79db85bae 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 a8fd18e6c..27e3d85b6 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 409c421b1..0e9579750 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; @@ -260,10 +257,12 @@ public Field58A setBIC(com.prowidesoftware.swift.model.BIC component3) { } + @Override public List bics() { return BICResolver.bics(this); } + @Override public List bicStrings () { return BICResolver.bicStrings(this); } @@ -332,7 +331,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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)); } @@ -348,6 +347,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); } @@ -361,6 +361,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); @@ -373,6 +374,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()); } @@ -385,6 +387,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)); @@ -399,6 +402,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); } @@ -413,6 +417,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 d689fbe75..b2fe017bc 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 14951fd50..b51d3fdd1 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 c8340879f..e0931a05e 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 befe8afd7..f0a4b5c70 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; @@ -244,11 +241,9 @@ 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); } /** @@ -263,7 +258,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type 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 Field59(f)); } @@ -703,6 +698,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); } @@ -716,6 +712,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); @@ -728,6 +725,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()); } @@ -740,6 +738,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)); @@ -754,6 +753,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); } @@ -768,6 +768,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 507aeb355..77cb33406 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; @@ -239,11 +236,9 @@ 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); } /** @@ -258,7 +253,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -529,10 +524,12 @@ public Field59A setBIC(com.prowidesoftware.swift.model.BIC component2) { } + @Override public List bics() { return BICResolver.bics(this); } + @Override public List bicStrings () { return BICResolver.bicStrings(this); } @@ -601,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 Field59A(f)); } @@ -617,6 +614,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); } @@ -630,6 +628,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); @@ -642,6 +641,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()); } @@ -654,6 +654,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)); @@ -668,6 +669,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); } @@ -682,6 +684,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 432a51960..3ef7e1a24 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; @@ -312,11 +309,9 @@ 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); } /** @@ -331,7 +326,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -814,32 +809,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) { @@ -869,27 +846,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); @@ -927,32 +890,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) { @@ -982,27 +927,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); @@ -1040,32 +971,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) { @@ -1095,27 +1008,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); @@ -1153,32 +1052,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) { @@ -1208,27 +1089,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); @@ -1320,7 +1187,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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)); } @@ -1336,6 +1203,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); } @@ -1349,6 +1217,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); @@ -1361,6 +1230,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()); } @@ -1373,6 +1243,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)); @@ -1387,6 +1258,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); } @@ -1401,6 +1273,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)); @@ -1542,14 +1415,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 7e567cc90..f716bca09 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; @@ -260,14 +257,13 @@ 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; } @@ -284,7 +280,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type 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,32 +678,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) { @@ -739,53 +716,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); } @@ -806,6 +775,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); } @@ -815,6 +785,7 @@ public BigDecimal amount() { * * @return the list of converted components (a Calendar object or null) */ + @Override public List dates() { return DateResolver.dates(this); } @@ -892,7 +863,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 dfba3322b..a14d49fae 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; @@ -260,14 +257,13 @@ 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; } @@ -284,7 +280,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type 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,32 +678,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) { @@ -739,53 +716,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); } @@ -806,6 +775,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); } @@ -815,6 +785,7 @@ public BigDecimal amount() { * * @return the list of converted components (a Calendar object or null) */ + @Override public List dates() { return DateResolver.dates(this); } @@ -892,7 +863,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 36abfe6ad..163863da6 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; @@ -348,11 +345,9 @@ 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); } /** @@ -367,7 +362,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -934,32 +929,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) { @@ -991,27 +967,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); @@ -1139,6 +1101,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); } @@ -1149,6 +1112,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); } @@ -1227,7 +1191,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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)); } @@ -1243,6 +1207,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); } @@ -1256,6 +1221,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); @@ -1268,6 +1234,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()); } @@ -1280,6 +1247,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)); @@ -1294,6 +1262,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); } @@ -1308,6 +1277,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 4832286ff..97d61b7b0 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; @@ -204,14 +201,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 619"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** @@ -226,7 +220,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -429,7 +423,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 bb39b8db4..a9c9f1a11 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; @@ -259,14 +256,13 @@ 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; } @@ -283,7 +279,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -626,32 +622,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) { @@ -683,27 +660,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); @@ -726,6 +689,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); } @@ -735,6 +699,7 @@ public BigDecimal amount() { * * @return the list of converted components (a Calendar object or null) */ + @Override public List dates() { return DateResolver.dates(this); } @@ -812,7 +777,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 695e100a2..0095b8ad5 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; @@ -259,14 +256,13 @@ 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; } @@ -283,7 +279,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -626,32 +622,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) { @@ -683,27 +660,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); @@ -726,6 +689,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); } @@ -735,6 +699,7 @@ public BigDecimal amount() { * * @return the list of converted components (a Calendar object or null) */ + @Override public List dates() { return DateResolver.dates(this); } @@ -812,7 +777,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 1dbed86fc..48f6818f1 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; @@ -259,14 +256,13 @@ 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; } @@ -283,7 +279,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -626,32 +622,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) { @@ -683,27 +660,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); @@ -726,6 +689,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); } @@ -735,6 +699,7 @@ public BigDecimal amount() { * * @return the list of converted components (a Calendar object or null) */ + @Override public List dates() { return DateResolver.dates(this); } @@ -812,7 +777,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 7d547734f..bd468a59b 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; @@ -259,14 +256,13 @@ 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; } @@ -283,7 +279,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -626,32 +622,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) { @@ -683,27 +660,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); @@ -726,6 +689,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); } @@ -735,6 +699,7 @@ public BigDecimal amount() { * * @return the list of converted components (a Calendar object or null) */ + @Override public List dates() { return DateResolver.dates(this); } @@ -812,7 +777,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 04c645864..cc691b0ab 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; @@ -285,11 +282,9 @@ 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); } /** @@ -304,7 +299,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -701,32 +696,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) { @@ -756,27 +733,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); @@ -837,32 +800,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) { @@ -892,27 +837,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); @@ -929,32 +860,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) { @@ -984,27 +897,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); @@ -1021,32 +920,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) { @@ -1078,27 +958,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); @@ -1126,26 +992,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); } @@ -1166,6 +1038,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); } @@ -1234,7 +1107,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 0e34413a5..e7cc93bb9 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; @@ -243,13 +240,12 @@ 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; } @@ -266,7 +262,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -570,6 +566,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); } @@ -590,6 +587,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; } @@ -600,6 +598,7 @@ public String getDSS() { * @see #getDSS() * @return true if DSS is present, false otherwise. */ + @Override public boolean isDSSPresent() { return false; } @@ -614,6 +613,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); } @@ -681,7 +681,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 bd15b1f32..bc152f53a 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; @@ -317,13 +314,12 @@ 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; } @@ -340,7 +336,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -964,6 +960,7 @@ public Field69B setEndTime(java.util.Calendar component5) { * * @return the list of converted components (a Calendar object or null) */ + @Override public List dates() { return DateResolver.dates(this); } @@ -984,6 +981,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; } @@ -994,6 +992,7 @@ public String getDSS() { * @see #getDSS() * @return true if DSS is present, false otherwise. */ + @Override public boolean isDSSPresent() { return false; } @@ -1008,6 +1007,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); } @@ -1075,7 +1075,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 001fd38cb..937dff1b6 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; @@ -243,11 +240,9 @@ 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); } /** @@ -262,7 +257,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -526,6 +521,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); } @@ -546,6 +542,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; } @@ -556,6 +553,7 @@ public String getDSS() { * @see #getDSS() * @return true if DSS is present, false otherwise. */ + @Override public boolean isDSSPresent() { return false; } @@ -570,6 +568,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); } @@ -637,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 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 bbd1ca642..5fc048461 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; @@ -266,11 +263,9 @@ 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); } /** @@ -285,7 +280,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -629,6 +624,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); } @@ -649,6 +645,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; } @@ -659,6 +656,7 @@ public String getDSS() { * @see #getDSS() * @return true if DSS is present, false otherwise. */ + @Override public boolean isDSSPresent() { return false; } @@ -673,6 +671,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); } @@ -740,7 +739,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 94dbfc9fb..2674eef1c 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; @@ -246,13 +243,12 @@ 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; } @@ -269,7 +265,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type 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 +551,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); } @@ -575,6 +572,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; } @@ -585,6 +583,7 @@ public String getDSS() { * @see #getDSS() * @return true if DSS is present, false otherwise. */ + @Override public boolean isDSSPresent() { return false; } @@ -599,6 +598,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); } @@ -666,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 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 aeb4ce6e9..162b93809 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; @@ -269,13 +266,12 @@ 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; } @@ -292,7 +288,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type 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,6 +654,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); } @@ -678,6 +675,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; } @@ -688,6 +686,7 @@ public String getDSS() { * @see #getDSS() * @return true if DSS is present, false otherwise. */ + @Override public boolean isDSSPresent() { return false; } @@ -702,6 +701,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); } @@ -769,7 +769,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 426cc2283..af2a5a0e2 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; @@ -229,11 +226,9 @@ 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); } /** @@ -248,7 +243,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type 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 Field69J setCode(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; } @@ -466,6 +462,7 @@ public String getDSS() { * @see #getDSS() * @return true if DSS is present, false otherwise. */ + @Override public boolean isDSSPresent() { return false; } @@ -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 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 b89d25dfd..7902f6202 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 65e0b9563..3c66cd7d8 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; @@ -243,11 +240,9 @@ 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); } /** @@ -262,7 +257,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -617,6 +612,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; } @@ -627,6 +623,7 @@ public String getDSS() { * @see #getDSS() * @return true if DSS is present, false otherwise. */ + @Override public boolean isDSSPresent() { return false; } @@ -641,6 +638,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); } @@ -708,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 Field70C(f)); } @@ -724,6 +722,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); } @@ -737,6 +736,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); @@ -749,6 +749,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()); } @@ -761,6 +762,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)); @@ -775,6 +777,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); } @@ -789,6 +792,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 10b85a72c..c6ef8b93d 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; @@ -253,11 +250,9 @@ 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); } /** @@ -272,7 +267,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -713,6 +708,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; } @@ -723,6 +719,7 @@ public String getDSS() { * @see #getDSS() * @return true if DSS is present, false otherwise. */ + @Override public boolean isDSSPresent() { return false; } @@ -737,6 +734,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); } @@ -804,7 +802,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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)); } @@ -820,6 +818,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); } @@ -833,6 +832,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); @@ -845,6 +845,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()); } @@ -857,6 +858,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)); @@ -871,6 +873,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); } @@ -885,6 +888,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 5cfe0f7e4..da55b61d2 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; @@ -273,11 +270,9 @@ 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); } /** @@ -292,7 +287,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -905,6 +900,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; } @@ -915,6 +911,7 @@ public String getDSS() { * @see #getDSS() * @return true if DSS is present, false otherwise. */ + @Override public boolean isDSSPresent() { return false; } @@ -929,6 +926,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); } @@ -996,7 +994,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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)); } @@ -1012,6 +1010,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); } @@ -1025,6 +1024,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); @@ -1037,6 +1037,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()); } @@ -1049,6 +1050,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)); @@ -1063,6 +1065,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); } @@ -1077,6 +1080,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 0f5065ec3..2db962bca 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; @@ -223,11 +220,9 @@ 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); } /** @@ -242,7 +237,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -428,6 +423,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; } @@ -438,6 +434,7 @@ public String getDSS() { * @see #getDSS() * @return true if DSS is present, false otherwise. */ + @Override public boolean isDSSPresent() { return false; } @@ -452,6 +449,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); } @@ -519,7 +517,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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)); } @@ -535,6 +533,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); } @@ -548,6 +547,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); @@ -560,6 +560,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()); } @@ -572,6 +573,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)); @@ -586,6 +588,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); } @@ -600,6 +603,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 f2e83c301..403a772fe 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; @@ -273,11 +270,9 @@ 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); } /** @@ -292,7 +287,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -905,6 +900,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; } @@ -915,6 +911,7 @@ public String getDSS() { * @see #getDSS() * @return true if DSS is present, false otherwise. */ + @Override public boolean isDSSPresent() { return false; } @@ -929,6 +926,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); } @@ -996,7 +994,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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)); } @@ -1012,6 +1010,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); } @@ -1025,6 +1024,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); @@ -1037,6 +1037,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()); } @@ -1049,6 +1050,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)); @@ -1063,6 +1065,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); } @@ -1077,6 +1080,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 ab30145f1..74231b74a 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; @@ -222,11 +219,9 @@ 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); } /** @@ -241,7 +236,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -427,6 +422,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; } @@ -437,6 +433,7 @@ public String getDSS() { * @see #getDSS() * @return true if DSS is present, false otherwise. */ + @Override public boolean isDSSPresent() { return false; } @@ -451,6 +448,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); } @@ -518,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 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 24ccf8f87..e01845f0f 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; @@ -204,14 +201,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 71A"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** @@ -226,7 +220,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -429,7 +423,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 aa289a6f1..b0bc3fa32 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 4e94d90b3..6c9b58ee9 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; @@ -234,11 +231,9 @@ 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); } /** @@ -253,7 +248,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -711,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 Field71C(f)); } @@ -727,6 +722,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); } @@ -740,6 +736,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); @@ -752,6 +749,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()); } @@ -764,6 +762,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)); @@ -778,6 +777,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); } @@ -792,6 +792,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 2cee5ddcf..4930adeb2 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 be91790d3..f6b52b177 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; @@ -223,14 +220,13 @@ 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; } @@ -247,7 +243,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -492,32 +488,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) { @@ -549,53 +526,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); } @@ -616,6 +585,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); } @@ -684,7 +654,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 dd43678a2..0bc935086 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; @@ -223,14 +220,13 @@ 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; } @@ -247,7 +243,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -492,32 +488,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) { @@ -549,53 +526,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); } @@ -616,6 +585,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); } @@ -684,7 +654,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 a91e4fa09..342f96750 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; @@ -244,11 +241,9 @@ 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); } /** @@ -263,7 +258,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -764,7 +759,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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)); } @@ -780,6 +775,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); } @@ -793,6 +789,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); @@ -805,6 +802,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()); } @@ -817,6 +815,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)); @@ -831,6 +830,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); } @@ -845,6 +845,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 389a667b5..cb81b7013 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 8d73b5b10..7558ff8d9 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 637d2e520..6379769e0 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 5b228b6ed..5d9a142c4 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 e6d8e956c..5ac304d2c 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; @@ -221,11 +218,9 @@ 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); } /** @@ -240,7 +235,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -486,7 +481,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 3ad921cd8..d5b66ece1 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; @@ -221,11 +218,9 @@ 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); } /** @@ -240,7 +235,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -486,7 +481,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 7b9b7e224..034697ec8 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 15b082fc9..d57b2e84a 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 843692483..87654b285 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 fb4ec9171..80bd1d3f7 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 5debf4a7c..eb965545f 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 8ecf20e63..58c28b0de 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 09b89264a..63cbd094f 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; @@ -205,14 +202,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 77C"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** @@ -227,7 +221,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type 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,7 +424,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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)); } @@ -446,6 +440,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); } @@ -459,6 +454,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); @@ -471,6 +467,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()); } @@ -483,6 +480,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)); @@ -497,6 +495,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); } @@ -511,6 +510,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 1f4f5bba2..3d938cf90 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 4d13fe3b6..a12133f9a 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; @@ -205,14 +202,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 77E"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** @@ -227,7 +221,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type 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,7 +424,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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)); } @@ -446,6 +440,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); } @@ -459,6 +454,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); @@ -471,6 +467,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()); } @@ -483,6 +480,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)); @@ -497,6 +495,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); } @@ -511,6 +510,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 dfb3958bc..7ac93512e 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; @@ -212,14 +209,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 77F"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** @@ -234,7 +228,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type 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 +453,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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)); } @@ -475,6 +469,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); } @@ -488,6 +483,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); @@ -500,6 +496,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()); } @@ -512,6 +509,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)); @@ -526,6 +524,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); } @@ -540,6 +539,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 b4598a097..7f335e4fe 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; @@ -249,11 +246,9 @@ 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); } /** @@ -268,7 +263,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -597,6 +592,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); } @@ -675,7 +671,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 fe97bae31..4ea1bf97d 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 f463ae2a8..7dc6b409d 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; @@ -212,14 +209,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 77L"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** @@ -234,7 +228,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type 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 +453,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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)); } @@ -475,6 +469,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); } @@ -488,6 +483,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); @@ -500,6 +496,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()); } @@ -512,6 +509,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)); @@ -526,6 +524,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); } @@ -540,6 +539,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 784c98739..28c7adb3e 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; @@ -205,14 +202,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 77T"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** @@ -227,7 +221,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type 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,7 +424,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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)); } @@ -446,6 +440,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); } @@ -459,6 +454,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); @@ -471,6 +467,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()); } @@ -483,6 +480,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)); @@ -497,6 +495,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); } @@ -511,6 +510,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 68271de53..f9c042f8e 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; @@ -205,14 +202,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 77U"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** @@ -227,7 +221,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type 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,7 +424,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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)); } @@ -446,6 +440,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); } @@ -459,6 +454,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); @@ -471,6 +467,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()); } @@ -483,6 +480,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)); @@ -497,6 +495,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); } @@ -511,6 +510,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 78b83bbd6..f4c4e8828 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; @@ -264,11 +261,9 @@ 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); } /** @@ -283,7 +278,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -999,7 +994,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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)); } @@ -1015,6 +1010,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); } @@ -1028,6 +1024,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); @@ -1040,6 +1037,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()); } @@ -1052,6 +1050,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)); @@ -1066,6 +1065,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); } @@ -1080,6 +1080,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 deb151607..26d6a1298 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; @@ -264,11 +261,9 @@ 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); } /** @@ -283,7 +278,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -999,7 +994,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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)); } @@ -1015,6 +1010,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); } @@ -1028,6 +1024,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); @@ -1040,6 +1037,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()); } @@ -1052,6 +1050,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)); @@ -1066,6 +1065,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); } @@ -1080,6 +1080,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 fc45061cd..29c114589 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; @@ -379,11 +376,9 @@ 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); } /** @@ -398,7 +393,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -2103,7 +2098,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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)); } @@ -2119,6 +2114,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); } @@ -2132,6 +2128,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); @@ -2144,6 +2141,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()); } @@ -2156,6 +2154,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)); @@ -2170,6 +2169,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); } @@ -2184,6 +2184,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 17af1e60f..f1ec180a1 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; @@ -379,11 +376,9 @@ 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); } /** @@ -398,7 +393,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -2103,7 +2098,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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)); } @@ -2119,6 +2114,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); } @@ -2132,6 +2128,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); @@ -2144,6 +2141,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()); } @@ -2156,6 +2154,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)); @@ -2170,6 +2169,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); } @@ -2184,6 +2184,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 830443ece..84570a781 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; @@ -234,11 +231,9 @@ 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); } /** @@ -253,7 +248,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -711,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 Field80C(f)); } @@ -727,6 +722,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); } @@ -740,6 +736,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); @@ -752,6 +749,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()); } @@ -764,6 +762,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)); @@ -778,6 +777,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); } @@ -792,6 +792,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 c962c1930..c7d11183f 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; @@ -260,10 +257,12 @@ public Field81A setBIC(com.prowidesoftware.swift.model.BIC component3) { } + @Override public List bics() { return BICResolver.bics(this); } + @Override public List bicStrings () { return BICResolver.bicStrings(this); } @@ -332,7 +331,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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)); } @@ -348,6 +347,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); } @@ -361,6 +361,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); @@ -373,6 +374,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()); } @@ -385,6 +387,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)); @@ -399,6 +402,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); } @@ -413,6 +417,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 fd4fcffd1..67c2ac01a 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 03c1c65d9..564f6e9e5 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 a8b042236..9d7199962 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; @@ -260,10 +257,12 @@ public Field82A setBIC(com.prowidesoftware.swift.model.BIC component3) { } + @Override public List bics() { return BICResolver.bics(this); } + @Override public List bicStrings () { return BICResolver.bicStrings(this); } @@ -332,7 +331,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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)); } @@ -348,6 +347,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); } @@ -361,6 +361,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); @@ -373,6 +374,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()); } @@ -385,6 +387,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)); @@ -399,6 +402,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); } @@ -413,6 +417,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 1ff0a046e..ddb15651b 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 dc3cd6c41..f917d0bee 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 762869349..b5bb0bfd3 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 c7b953a32..acbfa608d 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; @@ -260,10 +257,12 @@ public Field83A setBIC(com.prowidesoftware.swift.model.BIC component3) { } + @Override public List bics() { return BICResolver.bics(this); } + @Override public List bicStrings () { return BICResolver.bicStrings(this); } @@ -332,7 +331,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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)); } @@ -348,6 +347,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); } @@ -361,6 +361,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); @@ -373,6 +374,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()); } @@ -385,6 +387,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)); @@ -399,6 +402,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); } @@ -413,6 +417,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 c57232b49..1a3dd4bdc 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 d593e489c..25b910930 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 3ee1bb42c..8a343efc7 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 75184cb8e..a12bfb784 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; @@ -260,10 +257,12 @@ public Field84A setBIC(com.prowidesoftware.swift.model.BIC component3) { } + @Override public List bics() { return BICResolver.bics(this); } + @Override public List bicStrings () { return BICResolver.bicStrings(this); } @@ -332,7 +331,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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)); } @@ -348,6 +347,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); } @@ -361,6 +361,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); @@ -373,6 +374,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()); } @@ -385,6 +387,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)); @@ -399,6 +402,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); } @@ -413,6 +417,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 342936659..8f27832c5 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 bcc3436ec..826da607b 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 41547c238..880551e82 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 5c9ac0a40..3b8237f97 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; @@ -260,10 +257,12 @@ public Field85A setBIC(com.prowidesoftware.swift.model.BIC component3) { } + @Override public List bics() { return BICResolver.bics(this); } + @Override public List bicStrings () { return BICResolver.bicStrings(this); } @@ -332,7 +331,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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)); } @@ -348,6 +347,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); } @@ -361,6 +361,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); @@ -373,6 +374,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()); } @@ -385,6 +387,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)); @@ -399,6 +402,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); } @@ -413,6 +417,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 8301f4966..51df8d6fa 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 886c3b113..d9d90891a 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 7d6988d5a..b2722f54e 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 fec1b8b4b..290c2f9cd 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; @@ -234,11 +231,9 @@ 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); } /** @@ -253,7 +248,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -711,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 Field86(f)); } @@ -727,6 +722,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); } @@ -740,6 +736,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); @@ -752,6 +749,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()); } @@ -764,6 +762,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)); @@ -778,6 +777,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); } @@ -792,6 +792,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 a8c1f5b98..80cff3ab1 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; @@ -260,10 +257,12 @@ public Field86A setBIC(com.prowidesoftware.swift.model.BIC component3) { } + @Override public List bics() { return BICResolver.bics(this); } + @Override public List bicStrings () { return BICResolver.bicStrings(this); } @@ -332,7 +331,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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)); } @@ -348,6 +347,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); } @@ -361,6 +361,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); @@ -373,6 +374,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()); } @@ -385,6 +387,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)); @@ -399,6 +402,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); } @@ -413,6 +417,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 817521b91..62ed7e384 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 5e8964394..0a40345a6 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 196a46266..b23fc4cef 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 4cba226a0..647977a82 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; @@ -260,10 +257,12 @@ public Field87A setBIC(com.prowidesoftware.swift.model.BIC component3) { } + @Override public List bics() { return BICResolver.bics(this); } + @Override public List bicStrings () { return BICResolver.bicStrings(this); } @@ -332,7 +331,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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)); } @@ -348,6 +347,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); } @@ -361,6 +361,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); @@ -373,6 +374,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()); } @@ -385,6 +387,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)); @@ -399,6 +402,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); } @@ -413,6 +417,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 a6acced22..fe99500cd 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 b7b31e969..1f9ed3570 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 c53ce7f8f..00b8948b1 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 d52eaa6a5..e3482048b 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; @@ -260,10 +257,12 @@ public Field88A setBIC(com.prowidesoftware.swift.model.BIC component3) { } + @Override public List bics() { return BICResolver.bics(this); } + @Override public List bicStrings () { return BICResolver.bicStrings(this); } @@ -332,7 +331,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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)); } @@ -348,6 +347,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); } @@ -361,6 +361,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); @@ -373,6 +374,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()); } @@ -385,6 +387,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)); @@ -399,6 +402,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); } @@ -413,6 +417,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 56d12c950..ffcd89b9b 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 4463ea043..5c0dcff05 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 a39abd282..efbb3b709 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 8f83f65df..da3a2270c 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; @@ -260,10 +257,12 @@ public Field89A setBIC(com.prowidesoftware.swift.model.BIC component3) { } + @Override public List bics() { return BICResolver.bics(this); } + @Override public List bicStrings () { return BICResolver.bicStrings(this); } @@ -332,7 +331,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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)); } @@ -348,6 +347,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); } @@ -361,6 +361,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); @@ -373,6 +374,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()); } @@ -385,6 +387,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)); @@ -399,6 +402,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); } @@ -413,6 +417,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 acc5e414f..eac58be78 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 d07ec4b9a..531f5211b 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 e72d48d77..0c4b8ca00 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; @@ -253,14 +250,13 @@ 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; } @@ -277,7 +273,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -565,32 +561,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) { @@ -622,27 +599,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); @@ -665,6 +628,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); } @@ -676,6 +640,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; } @@ -686,6 +651,7 @@ public String getDSS() { * @see #getDSS() * @return true if DSS is present, false otherwise. */ + @Override public boolean isDSSPresent() { return false; } @@ -700,6 +666,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); } @@ -767,7 +734,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 56e778806..6a9bfcacb 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; @@ -260,14 +257,13 @@ 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; } @@ -284,7 +280,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type 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,32 +645,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) { @@ -706,53 +683,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); } @@ -773,6 +742,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); } @@ -784,6 +754,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; } @@ -794,6 +765,7 @@ public String getDSS() { * @see #getDSS() * @return true if DSS is present, false otherwise. */ + @Override public boolean isDSSPresent() { return false; } @@ -808,6 +780,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); } @@ -875,7 +848,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 862eb1740..dc98fa7ff 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; @@ -235,14 +232,13 @@ 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; } @@ -259,7 +255,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type 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,32 +513,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) { @@ -572,27 +550,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); @@ -653,32 +617,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) { @@ -710,53 +655,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); } @@ -777,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); } @@ -845,7 +783,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 ba47c06d4..990202cdd 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; @@ -235,14 +232,13 @@ 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; } @@ -259,7 +255,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type 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,32 +513,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) { @@ -572,27 +550,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); @@ -653,32 +617,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) { @@ -710,53 +655,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); } @@ -777,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); } @@ -845,7 +783,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 170b5df6c..711880cd4 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; @@ -229,11 +226,9 @@ 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); } /** @@ -248,7 +243,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type 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 Field90E setCode(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; } @@ -466,6 +462,7 @@ public String getDSS() { * @see #getDSS() * @return true if DSS is present, false otherwise. */ + @Override public boolean isDSSPresent() { return false; } @@ -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 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 d6366153d..752bd4b54 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; @@ -294,14 +291,13 @@ 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; } @@ -318,7 +314,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -758,32 +754,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) { @@ -815,27 +792,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); @@ -873,32 +836,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) { @@ -930,53 +874,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); } @@ -997,6 +933,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); } @@ -1008,6 +945,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; } @@ -1018,6 +956,7 @@ public String getDSS() { * @see #getDSS() * @return true if DSS is present, false otherwise. */ + @Override public boolean isDSSPresent() { return false; } @@ -1032,6 +971,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); } @@ -1099,7 +1039,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 870b79dbe..8156db60f 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; @@ -307,14 +304,13 @@ 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; } @@ -331,7 +327,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -832,32 +828,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) { @@ -889,27 +866,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); @@ -988,32 +951,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) { @@ -1045,53 +989,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); } @@ -1112,6 +1048,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); } @@ -1123,6 +1060,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; } @@ -1133,6 +1071,7 @@ public String getDSS() { * @see #getDSS() * @return true if DSS is present, false otherwise. */ + @Override public boolean isDSSPresent() { return false; } @@ -1147,6 +1086,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); } @@ -1214,7 +1154,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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/Field90K.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field90K.java index ef90d5063..08a5a2de3 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field90K.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field90K.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; @@ -233,14 +230,13 @@ 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; } @@ -257,7 +253,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type 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,32 +489,13 @@ public Field90K 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 Index Points content to set - * @return the field object to enable build pattern - */ - public Field90K setComponent2(java.math.BigDecimal component2) { - setComponent(2, SwiftFormatUtils.getBigDecimal(component2)); - return this; - } /** * Alternative method setter for field's Index Points (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 Index Points content to set * @return the field object to enable build pattern - * @see #setIndexPoints(java.math.BigDecimal) */ public Field90K setComponent2(java.lang.Number component2) { @@ -550,27 +527,13 @@ public Field90K setIndexPoints(String component2) { return setComponent2(component2); } - /** - * Set the Index Points (component 2) from a BigDecimal object. - * - * @see #setComponent2(java.math.BigDecimal) - * - * @param component2 BigDecimal with the Index Points content to set - * @return the field object to enable build pattern - * @since 9.2.7 - */ - public Field90K setIndexPoints(java.math.BigDecimal component2) { - return setComponent2(component2); - } - /** * Alternative method setter for field's Index Points (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 Index Points content to set * @return the field object to enable build pattern - * @see #setIndexPoints(java.math.BigDecimal) */ public Field90K setIndexPoints(java.lang.Number component2) { return setComponent2(component2); @@ -585,16 +548,6 @@ public Field90K setAmount(String component2) { return setIndexPoints(component2); } - /** - * @deprecated use #setComponent2(java.math.BigDecimal) instead - * @since 9.2.7 - */ - @Deprecated - @ProwideDeprecated(phase4 = TargetYear.SRU2024) - public Field90K setAmount(java.math.BigDecimal component2) { - return setIndexPoints(component2); - } - /** * @deprecated use #setIndexPoints(java.math.BigDecimal) instead */ @@ -621,6 +574,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); } @@ -632,6 +586,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; } @@ -642,6 +597,7 @@ public String getDSS() { * @see #getDSS() * @return true if DSS is present, false otherwise. */ + @Override public boolean isDSSPresent() { return false; } @@ -656,6 +612,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); } @@ -723,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 Field90K(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field90L.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field90L.java index 1bea2df74..d5b83b573 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field90L.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field90L.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; @@ -246,14 +243,13 @@ 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; } @@ -270,7 +266,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -549,32 +545,13 @@ public Field90L 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 Index Points content to set - * @return the field object to enable build pattern - */ - public Field90L setComponent3(java.math.BigDecimal component3) { - setComponent(3, SwiftFormatUtils.getBigDecimal(component3)); - return this; - } /** * Alternative method setter for field's Index Points (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 Index Points content to set * @return the field object to enable build pattern - * @see #setIndexPoints(java.math.BigDecimal) */ public Field90L setComponent3(java.lang.Number component3) { @@ -606,27 +583,13 @@ public Field90L setIndexPoints(String component3) { return setComponent3(component3); } - /** - * Set the Index Points (component 3) from a BigDecimal object. - * - * @see #setComponent3(java.math.BigDecimal) - * - * @param component3 BigDecimal with the Index Points content to set - * @return the field object to enable build pattern - * @since 9.2.7 - */ - public Field90L setIndexPoints(java.math.BigDecimal component3) { - return setComponent3(component3); - } - /** * Alternative method setter for field's Index Points (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 Index Points content to set * @return the field object to enable build pattern - * @see #setIndexPoints(java.math.BigDecimal) */ public Field90L setIndexPoints(java.lang.Number component3) { return setComponent3(component3); @@ -641,16 +604,6 @@ public Field90L setAmount(String component3) { return setIndexPoints(component3); } - /** - * @deprecated use #setComponent3(java.math.BigDecimal) instead - * @since 9.2.7 - */ - @Deprecated - @ProwideDeprecated(phase4 = TargetYear.SRU2024) - public Field90L setAmount(java.math.BigDecimal component3) { - return setIndexPoints(component3); - } - /** * @deprecated use #setIndexPoints(java.math.BigDecimal) instead */ @@ -677,6 +630,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); } @@ -688,6 +642,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; } @@ -698,6 +653,7 @@ public String getDSS() { * @see #getDSS() * @return true if DSS is present, false otherwise. */ + @Override public boolean isDSSPresent() { return false; } @@ -712,6 +668,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); } @@ -779,7 +736,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field90L(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 df5cfbedd..1a45acc02 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; @@ -260,10 +257,12 @@ public Field91A setBIC(com.prowidesoftware.swift.model.BIC component3) { } + @Override public List bics() { return BICResolver.bics(this); } + @Override public List bicStrings () { return BICResolver.bicStrings(this); } @@ -332,7 +331,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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)); } @@ -348,6 +347,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); } @@ -361,6 +361,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); @@ -373,6 +374,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()); } @@ -385,6 +387,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)); @@ -399,6 +402,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); } @@ -413,6 +417,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 cea066115..9e66b154c 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 a4f82dd7f..69800d634 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/Field92A.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field92A.java index 664e5a9e3..d7b7bda59 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field92A.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field92A.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; @@ -246,14 +243,13 @@ 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; } @@ -270,7 +266,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -549,32 +545,13 @@ public Field92A 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 Field92A 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 Field92A setComponent3(java.lang.Number component3) { @@ -606,27 +583,13 @@ public Field92A 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 Field92A 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 Field92A setRate(java.lang.Number component3) { return setComponent3(component3); @@ -641,16 +604,6 @@ public Field92A setRateAmount(String component3) { return setRate(component3); } - /** - * @deprecated use #setComponent3(java.math.BigDecimal) instead - * @since 9.2.7 - */ - @Deprecated - @ProwideDeprecated(phase4 = TargetYear.SRU2024) - public Field92A setRateAmount(java.math.BigDecimal component3) { - return setRate(component3); - } - /** * @deprecated use #setRate(java.math.BigDecimal) instead */ @@ -677,6 +630,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); } @@ -688,6 +642,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; } @@ -698,6 +653,7 @@ public String getDSS() { * @see #getDSS() * @return true if DSS is present, false otherwise. */ + @Override public boolean isDSSPresent() { return false; } @@ -712,6 +668,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); } @@ -779,7 +736,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field92A(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 8f0b6e8b5..47480bdbc 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; @@ -254,14 +251,13 @@ 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; } @@ -278,7 +274,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -643,32 +639,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) { @@ -700,53 +677,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); } @@ -767,6 +736,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); } @@ -778,6 +748,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; } @@ -788,6 +759,7 @@ public String getDSS() { * @see #getDSS() * @return true if DSS is present, false otherwise. */ + @Override public boolean isDSSPresent() { return false; } @@ -802,6 +774,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); } @@ -869,7 +842,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 36cd1443a..f7eed31a8 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; @@ -242,11 +239,9 @@ 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); } /** @@ -261,7 +256,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -512,6 +507,7 @@ public Field92C setCode(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(); } @@ -522,6 +518,7 @@ public String getDSS() { * @see #getDSS() * @return true if DSS is present, false otherwise. */ + @Override public boolean isDSSPresent() { return getComponent2() != null; } @@ -536,6 +533,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); } @@ -603,7 +601,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 24036a597..aed1c70f3 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; @@ -245,14 +242,13 @@ 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; } @@ -269,7 +265,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -530,32 +526,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) { @@ -587,27 +564,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); @@ -624,32 +587,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) { @@ -681,27 +625,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); @@ -724,6 +654,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); } @@ -735,6 +666,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; } @@ -745,6 +677,7 @@ public String getDSS() { * @see #getDSS() * @return true if DSS is present, false otherwise. */ + @Override public boolean isDSSPresent() { return false; } @@ -759,6 +692,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); } @@ -826,7 +760,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 b59240bc2..4033e1e52 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; @@ -247,14 +244,13 @@ 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; } @@ -271,7 +267,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -596,32 +592,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) { @@ -653,53 +630,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); } @@ -720,6 +689,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); } @@ -731,6 +701,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; } @@ -741,6 +712,7 @@ public String getDSS() { * @see #getDSS() * @return true if DSS is present, false otherwise. */ + @Override public boolean isDSSPresent() { return false; } @@ -755,6 +727,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); } @@ -822,7 +795,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 d0532238a..14422829e 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; @@ -266,11 +263,9 @@ 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); } /** @@ -285,7 +280,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -629,32 +624,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) { @@ -686,27 +662,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); @@ -734,26 +696,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); } @@ -774,6 +742,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); } @@ -785,6 +754,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; } @@ -795,6 +765,7 @@ public String getDSS() { * @see #getDSS() * @return true if DSS is present, false otherwise. */ + @Override public boolean isDSSPresent() { return false; } @@ -809,6 +780,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); } @@ -876,7 +848,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 0c1ce015f..984092927 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; @@ -300,11 +297,9 @@ 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); } /** @@ -319,7 +314,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -771,32 +766,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) { @@ -828,27 +804,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); @@ -876,26 +838,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); } @@ -916,6 +884,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); } @@ -927,6 +896,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(); } @@ -937,6 +907,7 @@ public String getDSS() { * @see #getDSS() * @return true if DSS is present, false otherwise. */ + @Override public boolean isDSSPresent() { return getComponent2() != null; } @@ -951,6 +922,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); } @@ -1018,7 +990,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 a91d51391..6b464d503 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; @@ -222,11 +219,9 @@ 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); } /** @@ -241,7 +236,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -427,6 +422,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; } @@ -437,6 +433,7 @@ public String getDSS() { * @see #getDSS() * @return true if DSS is present, false otherwise. */ + @Override public boolean isDSSPresent() { return false; } @@ -451,6 +448,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); } @@ -518,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 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 dda5dd6dc..cb2d27052 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; @@ -286,14 +283,13 @@ 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; } @@ -310,7 +306,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -749,32 +745,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) { @@ -806,27 +783,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); @@ -905,32 +868,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) { @@ -962,53 +906,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); } @@ -1029,6 +965,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); } @@ -1040,6 +977,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; } @@ -1050,6 +988,7 @@ public String getDSS() { * @see #getDSS() * @return true if DSS is present, false otherwise. */ + @Override public boolean isDSSPresent() { return false; } @@ -1064,6 +1003,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); } @@ -1131,7 +1071,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 0396235ff..cf5136b35 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; @@ -266,14 +263,13 @@ 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; } @@ -290,7 +286,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -671,32 +667,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) { @@ -728,27 +705,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); @@ -765,32 +728,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) { @@ -822,53 +766,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); } @@ -889,6 +825,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); } @@ -900,6 +837,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; } @@ -910,6 +848,7 @@ public String getDSS() { * @see #getDSS() * @return true if DSS is present, false otherwise. */ + @Override public boolean isDSSPresent() { return false; } @@ -924,6 +863,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); } @@ -991,7 +931,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 69a41ae98..dcfa63883 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; @@ -265,14 +262,13 @@ 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; } @@ -289,7 +285,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -608,32 +604,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) { @@ -665,27 +642,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); @@ -764,32 +727,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) { @@ -821,53 +765,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); } @@ -888,6 +824,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); } @@ -899,6 +836,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; } @@ -909,6 +847,7 @@ public String getDSS() { * @see #getDSS() * @return true if DSS is present, false otherwise. */ + @Override public boolean isDSSPresent() { return false; } @@ -923,6 +862,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); } @@ -990,7 +930,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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/Field92P.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field92P.java index ae6f6e9f6..7c00cfcad 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field92P.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field92P.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; @@ -233,14 +230,13 @@ 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; } @@ -257,7 +253,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type 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,32 +489,13 @@ public Field92P 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 Index Points content to set - * @return the field object to enable build pattern - */ - public Field92P setComponent2(java.math.BigDecimal component2) { - setComponent(2, SwiftFormatUtils.getBigDecimal(component2)); - return this; - } /** * Alternative method setter for field's Index Points (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 Index Points content to set * @return the field object to enable build pattern - * @see #setIndexPoints(java.math.BigDecimal) */ public Field92P setComponent2(java.lang.Number component2) { @@ -550,27 +527,13 @@ public Field92P setIndexPoints(String component2) { return setComponent2(component2); } - /** - * Set the Index Points (component 2) from a BigDecimal object. - * - * @see #setComponent2(java.math.BigDecimal) - * - * @param component2 BigDecimal with the Index Points content to set - * @return the field object to enable build pattern - * @since 9.2.7 - */ - public Field92P setIndexPoints(java.math.BigDecimal component2) { - return setComponent2(component2); - } - /** * Alternative method setter for field's Index Points (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 Index Points content to set * @return the field object to enable build pattern - * @see #setIndexPoints(java.math.BigDecimal) */ public Field92P setIndexPoints(java.lang.Number component2) { return setComponent2(component2); @@ -585,16 +548,6 @@ public Field92P setAmount(String component2) { return setIndexPoints(component2); } - /** - * @deprecated use #setComponent2(java.math.BigDecimal) instead - * @since 9.2.7 - */ - @Deprecated - @ProwideDeprecated(phase4 = TargetYear.SRU2024) - public Field92P setAmount(java.math.BigDecimal component2) { - return setIndexPoints(component2); - } - /** * @deprecated use #setIndexPoints(java.math.BigDecimal) instead */ @@ -621,6 +574,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); } @@ -632,6 +586,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; } @@ -642,6 +597,7 @@ public String getDSS() { * @see #getDSS() * @return true if DSS is present, false otherwise. */ + @Override public boolean isDSSPresent() { return false; } @@ -656,6 +612,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); } @@ -723,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 Field92P(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field92R.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field92R.java index fa0e742c2..72a4dde05 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field92R.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field92R.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; @@ -266,14 +263,13 @@ 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; } @@ -290,7 +286,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -631,32 +627,13 @@ public Field92R 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 Field92R 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 Field92R setComponent4(java.lang.Number component4) { @@ -688,27 +665,13 @@ public Field92R 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 Field92R 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 Field92R setRate(java.lang.Number component4) { return setComponent4(component4); @@ -723,16 +686,6 @@ public Field92R setAmount(String component4) { return setRate(component4); } - /** - * @deprecated use #setComponent4(java.math.BigDecimal) instead - * @since 9.2.7 - */ - @Deprecated - @ProwideDeprecated(phase4 = TargetYear.SRU2024) - public Field92R setAmount(java.math.BigDecimal component4) { - return setRate(component4); - } - /** * @deprecated use #setRate(java.math.BigDecimal) instead */ @@ -759,6 +712,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); } @@ -770,6 +724,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(); } @@ -780,6 +735,7 @@ public String getDSS() { * @see #getDSS() * @return true if DSS is present, false otherwise. */ + @Override public boolean isDSSPresent() { return getComponent2() != null; } @@ -794,6 +750,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); } @@ -861,7 +818,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field92R(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 2bd8d40df..640d4bdac 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; @@ -242,11 +239,9 @@ 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); } /** @@ -261,7 +256,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -512,6 +507,7 @@ public Field93A setCode(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(); } @@ -522,6 +518,7 @@ public String getDSS() { * @see #getDSS() * @return true if DSS is present, false otherwise. */ + @Override public boolean isDSSPresent() { return getComponent2() != null; } @@ -536,6 +533,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); } @@ -603,7 +601,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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/Field93B.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field93B.java index b625c8678..2d82737c7 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field93B.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field93B.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; @@ -273,14 +270,13 @@ 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; } @@ -297,7 +293,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type 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,13 @@ public Field93B 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 content to set - * @return the field object to enable build pattern - */ - public Field93B setComponent5(java.math.BigDecimal component5) { - setComponent(5, SwiftFormatUtils.getBigDecimal(component5)); - return this; - } /** * Alternative method setter for field's Balance (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 content to set * @return the field object to enable build pattern - * @see #setBalance(java.math.BigDecimal) */ public Field93B setComponent5(java.lang.Number component5) { @@ -716,27 +693,13 @@ public Field93B setBalance(String component5) { return setComponent5(component5); } - /** - * Set the Balance (component 5) from a BigDecimal object. - * - * @see #setComponent5(java.math.BigDecimal) - * - * @param component5 BigDecimal with the Balance content to set - * @return the field object to enable build pattern - * @since 9.2.7 - */ - public Field93B setBalance(java.math.BigDecimal component5) { - return setComponent5(component5); - } - /** * Alternative method setter for field's Balance (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 content to set * @return the field object to enable build pattern - * @see #setBalance(java.math.BigDecimal) */ public Field93B setBalance(java.lang.Number component5) { return setComponent5(component5); @@ -751,16 +714,6 @@ public Field93B setBalanceAmount(String component5) { return setBalance(component5); } - /** - * @deprecated use #setComponent5(java.math.BigDecimal) instead - * @since 9.2.7 - */ - @Deprecated - @ProwideDeprecated(phase4 = TargetYear.SRU2024) - public Field93B setBalanceAmount(java.math.BigDecimal component5) { - return setBalance(component5); - } - /** * @deprecated use #setBalance(java.math.BigDecimal) instead */ @@ -787,6 +740,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); } @@ -798,6 +752,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(); } @@ -808,6 +763,7 @@ public String getDSS() { * @see #getDSS() * @return true if DSS is present, false otherwise. */ + @Override public boolean isDSSPresent() { return getComponent2() != null; } @@ -822,6 +778,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); } @@ -889,7 +846,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field93B(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field93C.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field93C.java index 2a7da1c44..6cccbf62f 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field93C.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field93C.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; @@ -273,14 +270,13 @@ 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; } @@ -297,7 +293,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type 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,32 +652,13 @@ public Field93C 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 content to set - * @return the field object to enable build pattern - */ - public Field93C setComponent5(java.math.BigDecimal component5) { - setComponent(5, SwiftFormatUtils.getBigDecimal(component5)); - return this; - } /** * Alternative method setter for field's Balance (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 content to set * @return the field object to enable build pattern - * @see #setBalance(java.math.BigDecimal) */ public Field93C setComponent5(java.lang.Number component5) { @@ -713,27 +690,13 @@ public Field93C setBalance(String component5) { return setComponent5(component5); } - /** - * Set the Balance (component 5) from a BigDecimal object. - * - * @see #setComponent5(java.math.BigDecimal) - * - * @param component5 BigDecimal with the Balance content to set - * @return the field object to enable build pattern - * @since 9.2.7 - */ - public Field93C setBalance(java.math.BigDecimal component5) { - return setComponent5(component5); - } - /** * Alternative method setter for field's Balance (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 content to set * @return the field object to enable build pattern - * @see #setBalance(java.math.BigDecimal) */ public Field93C setBalance(java.lang.Number component5) { return setComponent5(component5); @@ -748,16 +711,6 @@ public Field93C setAmount(String component5) { return setBalance(component5); } - /** - * @deprecated use #setComponent5(java.math.BigDecimal) instead - * @since 9.2.7 - */ - @Deprecated - @ProwideDeprecated(phase4 = TargetYear.SRU2024) - public Field93C setAmount(java.math.BigDecimal component5) { - return setBalance(component5); - } - /** * @deprecated use #setBalance(java.math.BigDecimal) instead */ @@ -784,6 +737,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); } @@ -795,6 +749,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; } @@ -805,6 +760,7 @@ public String getDSS() { * @see #getDSS() * @return true if DSS is present, false otherwise. */ + @Override public boolean isDSSPresent() { return false; } @@ -819,6 +775,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); } @@ -886,7 +843,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field93C(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field93D.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field93D.java index 017758731..c12eb2642 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field93D.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field93D.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; @@ -246,14 +243,13 @@ 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; } @@ -270,7 +266,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -549,32 +545,13 @@ public Field93D 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 Balance content to set - * @return the field object to enable build pattern - */ - public Field93D setComponent3(java.math.BigDecimal component3) { - setComponent(3, SwiftFormatUtils.getBigDecimal(component3)); - return this; - } /** * Alternative method setter for field's Balance (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 Balance content to set * @return the field object to enable build pattern - * @see #setBalance(java.math.BigDecimal) */ public Field93D setComponent3(java.lang.Number component3) { @@ -606,27 +583,13 @@ public Field93D setBalance(String component3) { return setComponent3(component3); } - /** - * Set the Balance (component 3) from a BigDecimal object. - * - * @see #setComponent3(java.math.BigDecimal) - * - * @param component3 BigDecimal with the Balance content to set - * @return the field object to enable build pattern - * @since 9.2.7 - */ - public Field93D setBalance(java.math.BigDecimal component3) { - return setComponent3(component3); - } - /** * Alternative method setter for field's Balance (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 Balance content to set * @return the field object to enable build pattern - * @see #setBalance(java.math.BigDecimal) */ public Field93D setBalance(java.lang.Number component3) { return setComponent3(component3); @@ -641,16 +604,6 @@ public Field93D setAmount(String component3) { return setBalance(component3); } - /** - * @deprecated use #setComponent3(java.math.BigDecimal) instead - * @since 9.2.7 - */ - @Deprecated - @ProwideDeprecated(phase4 = TargetYear.SRU2024) - public Field93D setAmount(java.math.BigDecimal component3) { - return setBalance(component3); - } - /** * @deprecated use #setBalance(java.math.BigDecimal) instead */ @@ -677,6 +630,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); } @@ -688,6 +642,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; } @@ -698,6 +653,7 @@ public String getDSS() { * @see #getDSS() * @return true if DSS is present, false otherwise. */ + @Override public boolean isDSSPresent() { return false; } @@ -712,6 +668,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); } @@ -779,7 +736,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field93D(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 2ab8039df..2804f3b8a 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; @@ -266,14 +263,13 @@ 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; } @@ -290,7 +286,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -618,32 +614,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) { @@ -675,27 +652,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); @@ -718,6 +681,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); } @@ -729,6 +693,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 +704,7 @@ public String getDSS() { * @see #getDSS() * @return true if DSS is present, false otherwise. */ + @Override public boolean isDSSPresent() { return false; } @@ -753,6 +719,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 +787,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 29cb02972..f49930387 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; @@ -266,14 +263,13 @@ 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; } @@ -290,7 +286,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -621,32 +617,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) { @@ -678,27 +655,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); @@ -721,6 +684,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); } @@ -732,6 +696,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(); } @@ -742,6 +707,7 @@ public String getDSS() { * @see #getDSS() * @return true if DSS is present, false otherwise. */ + @Override public boolean isDSSPresent() { return getComponent2() != null; } @@ -756,6 +722,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); } @@ -823,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 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 eeef975ba..aae0ae186 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; @@ -204,14 +201,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 94A"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** @@ -226,7 +220,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -429,7 +423,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 3f09b3682..868bc166c 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; @@ -249,11 +246,9 @@ 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); } /** @@ -268,7 +263,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type 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 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(); } @@ -550,6 +546,7 @@ public String getDSS() { * @see #getDSS() * @return true if DSS is present, false otherwise. */ + @Override public boolean isDSSPresent() { return getComponent2() != null; } @@ -564,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); } @@ -631,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 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 08af595d2..9146bc20b 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; @@ -222,11 +219,9 @@ 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); } /** @@ -241,7 +236,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -427,6 +422,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; } @@ -437,6 +433,7 @@ public String getDSS() { * @see #getDSS() * @return true if DSS is present, false otherwise. */ + @Override public boolean isDSSPresent() { return false; } @@ -451,6 +448,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); } @@ -518,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 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 4c25b64d3..782498ac8 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; @@ -236,11 +233,9 @@ 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); } /** @@ -255,7 +250,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -484,6 +479,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; } @@ -494,6 +490,7 @@ public String getDSS() { * @see #getDSS() * @return true if DSS is present, false otherwise. */ + @Override public boolean isDSSPresent() { return false; } @@ -508,6 +505,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); } @@ -575,7 +573,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 e61a54003..d34d5dd10 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; @@ -273,11 +270,9 @@ 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); } /** @@ -292,7 +287,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -905,6 +900,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; } @@ -915,6 +911,7 @@ public String getDSS() { * @see #getDSS() * @return true if DSS is present, false otherwise. */ + @Override public boolean isDSSPresent() { return false; } @@ -929,6 +926,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); } @@ -996,7 +994,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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)); } @@ -1012,6 +1010,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); } @@ -1025,6 +1024,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); @@ -1037,6 +1037,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()); } @@ -1049,6 +1050,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)); @@ -1063,6 +1065,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); } @@ -1077,6 +1080,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 beeb1f728..c7eb5a7d7 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; @@ -253,11 +250,9 @@ 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); } /** @@ -272,7 +267,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -593,10 +588,12 @@ public Field94F setBIC(com.prowidesoftware.swift.model.BIC component3) { } + @Override public List bics() { return BICResolver.bics(this); } + @Override public List bicStrings () { return BICResolver.bicStrings(this); } @@ -608,6 +605,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; } @@ -618,6 +616,7 @@ public String getDSS() { * @see #getDSS() * @return true if DSS is present, false otherwise. */ + @Override public boolean isDSSPresent() { return false; } @@ -632,6 +631,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); } @@ -699,7 +699,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 b2bee3662..f436f32e3 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; @@ -236,11 +233,9 @@ 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); } /** @@ -255,7 +250,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -524,6 +519,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; } @@ -534,6 +530,7 @@ public String getDSS() { * @see #getDSS() * @return true if DSS is present, false otherwise. */ + @Override public boolean isDSSPresent() { return false; } @@ -548,6 +545,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); } @@ -615,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 Field94G(f)); } @@ -631,6 +629,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); } @@ -644,6 +643,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); @@ -656,6 +656,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()); } @@ -668,6 +669,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)); @@ -682,6 +684,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); } @@ -696,6 +699,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 24a001b47..002a17893 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; @@ -232,11 +229,9 @@ 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); } /** @@ -251,7 +246,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type 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,10 +505,12 @@ public Field94H setBIC(com.prowidesoftware.swift.model.BIC component2) { } + @Override public List bics() { return BICResolver.bics(this); } + @Override public List bicStrings () { return BICResolver.bicStrings(this); } @@ -525,6 +522,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; } @@ -535,6 +533,7 @@ public String getDSS() { * @see #getDSS() * @return true if DSS is present, false otherwise. */ + @Override public boolean isDSSPresent() { return false; } @@ -549,6 +548,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); } @@ -616,7 +616,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 ca729d693..47e8cf19e 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; @@ -241,11 +238,9 @@ 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); } /** @@ -260,7 +255,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -506,32 +501,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) { @@ -561,27 +538,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); @@ -595,6 +558,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; } @@ -605,6 +569,7 @@ public String getDSS() { * @see #getDSS() * @return true if DSS is present, false otherwise. */ + @Override public boolean isDSSPresent() { return false; } @@ -619,6 +584,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); } @@ -686,7 +652,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 20f002e6b..50352d61d 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; @@ -222,11 +219,9 @@ 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); } /** @@ -241,7 +236,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -427,6 +422,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; } @@ -437,6 +433,7 @@ public String getDSS() { * @see #getDSS() * @return true if DSS is present, false otherwise. */ + @Override public boolean isDSSPresent() { return false; } @@ -451,6 +448,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); } @@ -518,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 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 b76490d1b..9d9b01b71 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; @@ -241,11 +238,9 @@ 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); } /** @@ -260,7 +255,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -506,32 +501,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) { @@ -561,27 +538,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); @@ -595,6 +558,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; } @@ -605,6 +569,7 @@ public String getDSS() { * @see #getDSS() * @return true if DSS is present, false otherwise. */ + @Override public boolean isDSSPresent() { return false; } @@ -619,6 +584,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); } @@ -686,7 +652,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 8e75f27fb..58fa16f61 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; @@ -238,10 +235,12 @@ public Field95P setBIC(com.prowidesoftware.swift.model.BIC component2) { } + @Override public List bics() { return BICResolver.bics(this); } + @Override public List bicStrings () { return BICResolver.bicStrings(this); } @@ -253,6 +252,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; } @@ -263,6 +263,7 @@ public String getDSS() { * @see #getDSS() * @return true if DSS is present, false otherwise. */ + @Override public boolean isDSSPresent() { return false; } @@ -277,6 +278,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); } @@ -344,7 +346,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 41b5114fd..339583d06 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 df7d6828e..af53d94db 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 5015596ba..f20e69195 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 94563aa51..878175d91 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 e5d5f4596..e3829b632 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; @@ -273,11 +270,9 @@ 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); } /** @@ -292,7 +287,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -905,6 +900,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; } @@ -915,6 +911,7 @@ public String getDSS() { * @see #getDSS() * @return true if DSS is present, false otherwise. */ + @Override public boolean isDSSPresent() { return false; } @@ -929,6 +926,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); } @@ -996,7 +994,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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)); } @@ -1012,6 +1010,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); } @@ -1025,6 +1024,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); @@ -1037,6 +1037,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()); } @@ -1049,6 +1050,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)); @@ -1063,6 +1065,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); } @@ -1077,6 +1080,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 70778b60d..8eb60a03c 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; @@ -260,10 +257,12 @@ public Field96A setBIC(com.prowidesoftware.swift.model.BIC component3) { } + @Override public List bics() { return BICResolver.bics(this); } + @Override public List bicStrings () { return BICResolver.bicStrings(this); } @@ -332,7 +331,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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)); } @@ -348,6 +347,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); } @@ -361,6 +361,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); @@ -373,6 +374,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()); } @@ -385,6 +387,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)); @@ -399,6 +402,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); } @@ -413,6 +417,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 01f4e2ade..6a30dc1b1 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 1dec0d1a3..beb76d4df 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 2dca990ff..7ab41220e 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; @@ -229,11 +226,9 @@ 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); } /** @@ -248,7 +243,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -465,6 +460,7 @@ public Field97A setAccount(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; } @@ -475,6 +471,7 @@ public String getDSS() { * @see #getDSS() * @return true if DSS is present, false otherwise. */ + @Override public boolean isDSSPresent() { return false; } @@ -489,6 +486,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); } @@ -556,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 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 bca6bafd7..0b1f49ac3 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; @@ -250,11 +247,9 @@ 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); } /** @@ -269,7 +264,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -538,6 +533,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(); } @@ -548,6 +544,7 @@ public String getDSS() { * @see #getDSS() * @return true if DSS is present, false otherwise. */ + @Override public boolean isDSSPresent() { return getComponent2() != null; } @@ -562,6 +559,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); } @@ -629,7 +627,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 7897377a0..ca62bf34f 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; @@ -229,11 +226,9 @@ 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); } /** @@ -248,7 +243,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type 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 Field97C setCode(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; } @@ -466,6 +462,7 @@ public String getDSS() { * @see #getDSS() * @return true if DSS is present, false otherwise. */ + @Override public boolean isDSSPresent() { return false; } @@ -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 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 4ab730462..27ac7af23 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; @@ -235,11 +232,9 @@ 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); } /** @@ -254,7 +249,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -483,6 +478,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(); } @@ -493,6 +489,7 @@ public String getDSS() { * @see #getDSS() * @return true if DSS is present, false otherwise. */ + @Override public boolean isDSSPresent() { return getComponent2() != null; } @@ -507,6 +504,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); } @@ -574,7 +572,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 1c9feb3ba..f5c00170c 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; @@ -229,11 +226,9 @@ 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); } /** @@ -248,7 +243,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -465,6 +460,7 @@ public Field97E setAccount(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; } @@ -475,6 +471,7 @@ public String getDSS() { * @see #getDSS() * @return true if DSS is present, false otherwise. */ + @Override public boolean isDSSPresent() { return false; } @@ -489,6 +486,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); } @@ -556,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 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 aa4470176..5c822504c 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; @@ -225,13 +222,12 @@ 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; } @@ -248,7 +244,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type 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 +468,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); } @@ -492,6 +489,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; } @@ -502,6 +500,7 @@ public String getDSS() { * @see #getDSS() * @return true if DSS is present, false otherwise. */ + @Override public boolean isDSSPresent() { return false; } @@ -516,6 +515,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); } @@ -583,7 +583,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 d4da7ede7..ab843ac57 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; @@ -242,11 +239,9 @@ 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); } /** @@ -261,7 +256,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -512,6 +507,7 @@ public Field98B setCode(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(); } @@ -522,6 +518,7 @@ public String getDSS() { * @see #getDSS() * @return true if DSS is present, false otherwise. */ + @Override public boolean isDSSPresent() { return getComponent2() != null; } @@ -536,6 +533,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); } @@ -603,7 +601,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 743f17b26..ed6989f6a 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; @@ -244,13 +241,12 @@ 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; } @@ -267,7 +263,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -571,6 +567,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); } @@ -591,6 +588,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; } @@ -601,6 +599,7 @@ public String getDSS() { * @see #getDSS() * @return true if DSS is present, false otherwise. */ + @Override public boolean isDSSPresent() { return false; } @@ -615,6 +614,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); } @@ -682,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 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 72d6de1be..0ceadfbfb 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; @@ -296,13 +293,12 @@ 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; } @@ -319,7 +315,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -709,32 +705,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) { @@ -764,27 +742,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); @@ -861,6 +825,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); } @@ -938,7 +903,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 f3aa0ae6b..61123b289 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; @@ -312,13 +309,12 @@ 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; } @@ -335,7 +331,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -765,32 +761,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) { @@ -820,27 +798,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); @@ -917,6 +881,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); } @@ -937,6 +902,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; } @@ -947,6 +913,7 @@ public String getDSS() { * @see #getDSS() * @return true if DSS is present, false otherwise. */ + @Override public boolean isDSSPresent() { return false; } @@ -961,6 +928,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); } @@ -1028,7 +996,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 7161aca6c..f550d708b 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; @@ -263,13 +260,12 @@ 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; } @@ -286,7 +282,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -617,6 +613,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(); } @@ -627,6 +624,7 @@ public String getDSS() { * @see #getDSS() * @return true if DSS is present, false otherwise. */ + @Override public boolean isDSSPresent() { return getComponent2() != null; } @@ -641,6 +639,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); } @@ -708,7 +707,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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/Field98G.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field98G.java index 42c2117d0..c46ae9460 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field98G.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field98G.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; @@ -303,13 +300,12 @@ 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; } @@ -326,7 +322,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -747,32 +743,14 @@ public Field98G 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 Field98G 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 Field98G setComponent3(java.lang.Number component3) { @@ -802,27 +780,13 @@ public Field98G 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 Field98G 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 Field98G setDecimals(java.lang.Number component3) { return setComponent3(component3); @@ -837,16 +801,6 @@ public Field98G setNumber(String component3) { return setDecimals(component3); } - /** - * @deprecated use #setComponent3(java.lang.Long) instead - * @since 9.2.7 - */ - @Deprecated - @ProwideDeprecated(phase4 = TargetYear.SRU2024) - public Field98G setNumber(java.lang.Long component3) { - return setDecimals(component3); - } - /** * @deprecated use #setDecimals(java.lang.Long) instead */ @@ -927,6 +881,7 @@ public Field98G setOffset(java.util.Calendar component5) { * * @return the list of converted components (a Calendar object or null) */ + @Override public List dates() { return DateResolver.dates(this); } @@ -1004,7 +959,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field98G(f)); } diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/Field98H.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field98H.java index ae5af3c4e..5cb7c820c 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field98H.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field98H.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; @@ -286,13 +283,12 @@ public String getValueDisplay(int component, Locale locale) { //default format (as is) return getComponent(3); } - 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; } @@ -309,7 +305,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -650,32 +646,14 @@ public Field98H 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 Decimals content to set - * @return the field object to enable build pattern - */ - public Field98H setComponent2(java.lang.Long component2) { - setComponent(2, SwiftFormatUtils.getLong(component2)); - return this; - } /** * Alternative method setter for field's Decimals (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 Decimals content to set * @return the field object to enable build pattern - * @see #setDecimals(java.lang.Long) */ public Field98H setComponent2(java.lang.Number component2) { @@ -705,27 +683,13 @@ public Field98H setDecimals(String component2) { return setComponent2(component2); } - /** - * Set the Decimals (component 2) from a Long object. - * - * @see #setComponent2(java.lang.Long) - * - * @param component2 Long with the Decimals content to set - * @return the field object to enable build pattern - * @since 9.2.7 - */ - public Field98H setDecimals(java.lang.Long component2) { - return setComponent2(component2); - } - /** * Alternative method setter for field's Decimals (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 Decimals content to set * @return the field object to enable build pattern - * @see #setDecimals(java.lang.Long) */ public Field98H setDecimals(java.lang.Number component2) { return setComponent2(component2); @@ -740,16 +704,6 @@ public Field98H setNumber(String component2) { return setDecimals(component2); } - /** - * @deprecated use #setComponent2(java.lang.Long) instead - * @since 9.2.7 - */ - @Deprecated - @ProwideDeprecated(phase4 = TargetYear.SRU2024) - public Field98H setNumber(java.lang.Long component2) { - return setDecimals(component2); - } - /** * @deprecated use #setDecimals(java.lang.Long) instead */ @@ -889,7 +843,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field98H(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 f1706e0f8..553b612b2 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; @@ -276,11 +273,9 @@ 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); } /** @@ -295,7 +290,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -719,6 +714,7 @@ public Field98J setBIC(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); } @@ -732,10 +728,12 @@ public Calendar date() { return DateResolver.date(this); } + @Override public List bics() { return BICResolver.bics(this); } + @Override public List bicStrings () { return BICResolver.bicStrings(this); } @@ -747,6 +745,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; } @@ -757,6 +756,7 @@ public String getDSS() { * @see #getDSS() * @return true if DSS is present, false otherwise. */ + @Override public boolean isDSSPresent() { return false; } @@ -771,6 +771,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); } @@ -838,7 +839,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 41bd090fb..2a568d8ce 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; @@ -279,11 +276,9 @@ 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); } /** @@ -298,7 +293,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type 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 Field98K setProprietaryCode(String component5) { * * @return the list of converted components (a Calendar object or null) */ + @Override public List dates() { return DateResolver.dates(this); } @@ -702,6 +698,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; } @@ -712,6 +709,7 @@ public String getDSS() { * @see #getDSS() * @return true if DSS is present, false otherwise. */ + @Override public boolean isDSSPresent() { return false; } @@ -726,6 +724,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 +792,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 fa325ec74..dc9cbdeb4 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; @@ -199,14 +196,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 999"); } - if (component == 1) { - //default format (as is) - return getComponent(1); - } - return null; + //default format (as is) + return getComponent(1); } /** @@ -221,7 +215,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -404,7 +398,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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)); } @@ -419,13 +413,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/Field99A.java b/src/generated/java/com/prowidesoftware/swift/model/field/Field99A.java index 15fa7ccde..aa3a370f4 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/Field99A.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/Field99A.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; @@ -244,11 +241,9 @@ 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); } /** @@ -263,7 +258,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type for each component in the Field. It supersedes * the Components Pattern because it distinguishes between N (Number) and I (BigDecimal). * @since 9.2.7 @@ -543,32 +538,14 @@ public Field99A 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 content to set - * @return the field object to enable build pattern - */ - public Field99A setComponent3(java.lang.Long component3) { - setComponent(3, SwiftFormatUtils.getLong(component3)); - return this; - } /** * Alternative method setter for field's 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 Number content to set * @return the field object to enable build pattern - * @see #setNumber(java.lang.Long) */ public Field99A setComponent3(java.lang.Number component3) { @@ -598,27 +575,13 @@ public Field99A setNumber(String component3) { return setComponent3(component3); } - /** - * Set the Number (component 3) from a Long object. - * - * @see #setComponent3(java.lang.Long) - * - * @param component3 Long with the Number content to set - * @return the field object to enable build pattern - * @since 9.2.7 - */ - public Field99A setNumber(java.lang.Long component3) { - return setComponent3(component3); - } - /** * Alternative method setter for field's 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 Number content to set * @return the field object to enable build pattern - * @see #setNumber(java.lang.Long) */ public Field99A setNumber(java.lang.Number component3) { return setComponent3(component3); @@ -633,16 +596,6 @@ public Field99A setAmount(String component3) { return setNumber(component3); } - /** - * @deprecated use #setComponent3(java.lang.Long) instead - * @since 9.2.7 - */ - @Deprecated - @ProwideDeprecated(phase4 = TargetYear.SRU2024) - public Field99A setAmount(java.lang.Long component3) { - return setNumber(component3); - } - /** * @deprecated use #setNumber(java.lang.Long) instead */ @@ -660,6 +613,7 @@ public Field99A setAmount(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; } @@ -670,6 +624,7 @@ public String getDSS() { * @see #getDSS() * @return true if DSS is present, false otherwise. */ + @Override public boolean isDSSPresent() { return false; } @@ -684,6 +639,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); } @@ -751,7 +707,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field99A(f)); } 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 dfa27b2cc..16a034207 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; @@ -224,11 +221,9 @@ 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); } /** @@ -243,7 +238,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type 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 +444,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) { @@ -504,27 +481,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); @@ -538,6 +501,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; } @@ -548,6 +512,7 @@ public String getDSS() { * @see #getDSS() * @return true if DSS is present, false otherwise. */ + @Override public boolean isDSSPresent() { return false; } @@ -562,6 +527,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); } @@ -629,7 +595,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 f4f5e8cfc..6b8c7814a 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; @@ -224,11 +221,9 @@ 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); } /** @@ -243,7 +238,7 @@ public String componentsPattern() { /** * Returns the field component types pattern. - * + *

* This method returns a letter representing the type 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 +444,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) { @@ -504,27 +481,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); @@ -538,6 +501,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; } @@ -548,6 +512,7 @@ public String getDSS() { * @see #getDSS() * @return true if DSS is present, false otherwise. */ + @Override public boolean isDSSPresent() { return false; } @@ -562,6 +527,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); } @@ -629,7 +595,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 0d1d9d062..5a565ca5f 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 afcdc819a..57827248c 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 6b93734b0..8f47fff03 100644 --- a/src/main/java/com/prowidesoftware/swift/model/MtSwiftMessage.java +++ b/src/main/java/com/prowidesoftware/swift/model/MtSwiftMessage.java @@ -70,6 +70,7 @@ public MtSwiftMessage() {} /** * Calls {@link #MtSwiftMessage(String, MessageMetadataStrategy)} with the {@link DefaultMtMetadataStrategy} + * * @param fin the plain FIN message content */ public MtSwiftMessage(final String fin) { @@ -98,6 +99,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 */ @@ -110,7 +112,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 @@ -134,7 +136,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 @@ -342,6 +344,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) { @@ -451,10 +454,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 e020267f2..9b56dae66 100644 --- a/src/main/java/com/prowidesoftware/swift/model/SwiftMessageUtils.java +++ b/src/main/java/com/prowidesoftware/swift/model/SwiftMessageUtils.java @@ -353,7 +353,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. * @@ -365,7 +365,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; } @@ -374,7 +374,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. * @@ -387,24 +387,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 597939c87..fe70ecd19 100644 --- a/src/main/java/com/prowidesoftware/swift/model/field/Field.java +++ b/src/main/java/com/prowidesoftware/swift/model/field/Field.java @@ -58,6 +58,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 5155a850e..687316696 100644 --- a/src/main/java/com/prowidesoftware/swift/model/field/Field11T.java +++ b/src/main/java/com/prowidesoftware/swift/model/field/Field11T.java @@ -243,13 +243,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; } @@ -516,24 +514,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 * @@ -541,7 +521,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) { @@ -571,19 +550,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 * @@ -591,7 +557,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); @@ -690,6 +655,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); } @@ -766,7 +732,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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)); } @@ -782,6 +748,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); } @@ -795,6 +762,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); @@ -807,6 +775,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()); } @@ -819,6 +788,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)); @@ -833,6 +803,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); } @@ -847,6 +818,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 b87026a83..f83f6afca 100644 --- a/src/main/java/com/prowidesoftware/swift/model/field/Field12H.java +++ b/src/main/java/com/prowidesoftware/swift/model/field/Field12H.java @@ -212,11 +212,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); } /** @@ -269,10 +266,7 @@ public String validatorPattern() { */ @Override public boolean isOptional(int component) { - if (component == 2) { - return true; - } - return false; + return component == 2; } /** @@ -475,7 +469,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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/Field12K.java b/src/main/java/com/prowidesoftware/swift/model/field/Field12K.java index bb40f2ad8..6559c288c 100644 --- a/src/main/java/com/prowidesoftware/swift/model/field/Field12K.java +++ b/src/main/java/com/prowidesoftware/swift/model/field/Field12K.java @@ -206,14 +206,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 12K"); } - if (component == 1) { - // default format (as is) - return getComponent(1); - } - return null; + // default format (as is) + return getComponent(1); } /** @@ -444,24 +441,6 @@ public Field12K 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 Field12K setComponent1(java.lang.Long component1) { - setComponent(1, SwiftFormatUtils.getLong(component1)); - return this; - } - /** * Alternative method setter for field's Number (component 1) as as Number * @@ -469,7 +448,6 @@ public Field12K 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 Field12K setComponent1(java.lang.Number component1) { @@ -499,32 +477,6 @@ public Field12K 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 Field12K setNumber(java.lang.Long component1) { - return setComponent1(component1); - } - - /** - * Alternative method setter for field's Number (component 1) as 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 Field12K setNumber(java.lang.Number component1) { - return setComponent1(component1); - } - /** * Alternative DEPRECATED method setter for field's Number * @@ -540,33 +492,15 @@ public Field12K setVersion(String component1) { } /** - * Alternative DEPRECATED method setter for field's Number 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 - */ - @Deprecated - @ProwideDeprecated(phase4 = TargetYear.SRU2024) - public Field12K setVersion(java.lang.Long component1) { - return setNumber(component1); - } - - /** - * Alternative DEPRECATED method setter for field's Number (component 1) as as Number + * Alternative method setter for field's Number (component 1) as 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) */ - @Deprecated - @ProwideDeprecated(phase4 = TargetYear.SRU2024) - public Field12K setVersion(java.lang.Number component1) { - return setNumber(component1); + public Field12K setNumber(java.lang.Number component1) { + return setComponent1(component1); } /** @@ -632,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 Field12K(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 8884829d3..6f9a129fd 100644 --- a/src/main/java/com/prowidesoftware/swift/model/field/Field12L.java +++ b/src/main/java/com/prowidesoftware/swift/model/field/Field12L.java @@ -195,14 +195,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); } /** @@ -418,7 +415,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 2d0298f06..9fc49f63d 100644 --- a/src/main/java/com/prowidesoftware/swift/model/field/Field12R.java +++ b/src/main/java/com/prowidesoftware/swift/model/field/Field12R.java @@ -212,11 +212,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); } /** @@ -269,10 +266,7 @@ public String validatorPattern() { */ @Override public boolean isOptional(int component) { - if (component == 2) { - return true; - } - return false; + return component == 2; } /** @@ -475,7 +469,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 f5afd7b08..e7518302f 100644 --- a/src/main/java/com/prowidesoftware/swift/model/field/Field12S.java +++ b/src/main/java/com/prowidesoftware/swift/model/field/Field12S.java @@ -195,14 +195,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); } /** @@ -418,7 +415,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 771471512..eb5a95365 100644 --- a/src/main/java/com/prowidesoftware/swift/model/field/Field13E.java +++ b/src/main/java/com/prowidesoftware/swift/model/field/Field13E.java @@ -222,13 +222,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; } @@ -508,6 +506,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); } @@ -584,7 +583,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 7f6b6cb94..d5a794c3f 100644 --- a/src/main/java/com/prowidesoftware/swift/model/field/Field20E.java +++ b/src/main/java/com/prowidesoftware/swift/model/field/Field20E.java @@ -211,11 +211,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); } /** @@ -471,7 +468,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 43ef8c282..4a23b5bc8 100644 --- a/src/main/java/com/prowidesoftware/swift/model/field/Field21S.java +++ b/src/main/java/com/prowidesoftware/swift/model/field/Field21S.java @@ -195,14 +195,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); } /** @@ -418,7 +415,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 7e641f05b..e3a9eb53e 100644 --- a/src/main/java/com/prowidesoftware/swift/model/field/Field21T.java +++ b/src/main/java/com/prowidesoftware/swift/model/field/Field21T.java @@ -195,14 +195,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); } /** @@ -418,7 +415,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 83fcc935e..f16b1499c 100644 --- a/src/main/java/com/prowidesoftware/swift/model/field/Field25F.java +++ b/src/main/java/com/prowidesoftware/swift/model/field/Field25F.java @@ -195,14 +195,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); } /** @@ -418,7 +415,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 a66b783fb..48cd54c6c 100644 --- a/src/main/java/com/prowidesoftware/swift/model/field/Field25G.java +++ b/src/main/java/com/prowidesoftware/swift/model/field/Field25G.java @@ -195,14 +195,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); } /** @@ -418,7 +415,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 f744282b9..f477afea3 100644 --- a/src/main/java/com/prowidesoftware/swift/model/field/Field27A.java +++ b/src/main/java/com/prowidesoftware/swift/model/field/Field27A.java @@ -214,11 +214,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); } /** @@ -480,24 +477,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 * @@ -505,7 +484,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) { @@ -535,19 +513,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 * @@ -555,7 +520,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); @@ -572,24 +536,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 * @@ -597,7 +543,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) { @@ -627,19 +572,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 * @@ -716,7 +648,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 69cb1528c..18c513866 100644 --- a/src/main/java/com/prowidesoftware/swift/model/field/Field29D.java +++ b/src/main/java/com/prowidesoftware/swift/model/field/Field29D.java @@ -214,11 +214,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); } /** @@ -277,10 +274,7 @@ public boolean isOptional(int component) { if (component == 3) { return true; } - if (component == 4) { - return true; - } - return false; + return component == 4; } /** @@ -603,7 +597,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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)); } @@ -619,6 +613,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); } @@ -632,6 +627,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); @@ -644,6 +640,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()); } @@ -656,6 +653,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)); @@ -670,6 +668,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); } @@ -684,6 +683,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 e5e2c5b65..f9bfa5d68 100644 --- a/src/main/java/com/prowidesoftware/swift/model/field/Field29F.java +++ b/src/main/java/com/prowidesoftware/swift/model/field/Field29F.java @@ -214,11 +214,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); } /** @@ -277,10 +274,7 @@ public boolean isOptional(int component) { if (component == 3) { return true; } - if (component == 4) { - return true; - } - return false; + return component == 4; } /** @@ -603,7 +597,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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)); } @@ -619,6 +613,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); } @@ -632,6 +627,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); @@ -644,6 +640,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()); } @@ -656,6 +653,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)); @@ -670,6 +668,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); } @@ -684,6 +683,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/Field29P.java b/src/main/java/com/prowidesoftware/swift/model/field/Field29P.java index f5754bc69..2d1a8a2e2 100644 --- a/src/main/java/com/prowidesoftware/swift/model/field/Field29P.java +++ b/src/main/java/com/prowidesoftware/swift/model/field/Field29P.java @@ -205,14 +205,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 29P"); } - if (component == 1) { - // default format (as is) - return getComponent(1); - } - return null; + // default format (as is) + return getComponent(1); } /** @@ -456,10 +453,12 @@ public Field29P setBIC(com.prowidesoftware.swift.model.BIC component1) { return setIdentifierCode(component1); } + @Override public List bics() { return BICResolver.bics(this); } + @Override public List bicStrings() { return BICResolver.bicStrings(this); } @@ -527,7 +526,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field29P(f)); } 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 247bf3b06..de80b37c1 100644 --- a/src/main/java/com/prowidesoftware/swift/model/field/Field29S.java +++ b/src/main/java/com/prowidesoftware/swift/model/field/Field29S.java @@ -211,11 +211,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); } /** @@ -471,7 +468,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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/Field29U.java b/src/main/java/com/prowidesoftware/swift/model/field/Field29U.java index 2fabcbbcc..8ed7941ac 100644 --- a/src/main/java/com/prowidesoftware/swift/model/field/Field29U.java +++ b/src/main/java/com/prowidesoftware/swift/model/field/Field29U.java @@ -205,14 +205,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 29U"); } - if (component == 1) { - // default format (as is) - return getComponent(1); - } - return null; + // default format (as is) + return getComponent(1); } /** @@ -456,10 +453,12 @@ public Field29U setBIC(com.prowidesoftware.swift.model.BIC component1) { return setIdentifierCode(component1); } + @Override public List bics() { return BICResolver.bics(this); } + @Override public List bicStrings() { return BICResolver.bicStrings(this); } @@ -527,7 +526,7 @@ public static List getAll(final SwiftTagListBlock block) { return result; } final Tag[] arr = block.getTagsByName(NAME); - if (arr != null && arr.length > 0) { + if (arr != null) { for (final Tag f : arr) { result.add(new Field29U(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 e952be8e0..079cf4ece 100644 --- a/src/main/java/com/prowidesoftware/swift/model/field/Field31J.java +++ b/src/main/java/com/prowidesoftware/swift/model/field/Field31J.java @@ -197,17 +197,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; } @@ -407,6 +404,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); } @@ -483,7 +481,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 11a7367f6..50ef24138 100644 --- a/src/main/java/com/prowidesoftware/swift/model/field/Field31K.java +++ b/src/main/java/com/prowidesoftware/swift/model/field/Field31K.java @@ -197,17 +197,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; } @@ -407,6 +404,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); } @@ -483,7 +481,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 477282174..285865ff7 100644 --- a/src/main/java/com/prowidesoftware/swift/model/field/Field31M.java +++ b/src/main/java/com/prowidesoftware/swift/model/field/Field31M.java @@ -197,17 +197,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; } @@ -407,6 +404,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); } @@ -483,7 +481,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 ae384e386..ca03e89e2 100644 --- a/src/main/java/com/prowidesoftware/swift/model/field/Field31T.java +++ b/src/main/java/com/prowidesoftware/swift/model/field/Field31T.java @@ -197,17 +197,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; } @@ -407,6 +404,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); } @@ -483,7 +481,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 5902b87c4..388f363f9 100644 --- a/src/main/java/com/prowidesoftware/swift/model/field/Field34D.java +++ b/src/main/java/com/prowidesoftware/swift/model/field/Field34D.java @@ -212,14 +212,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; } @@ -453,24 +451,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 * @@ -478,7 +458,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) { @@ -510,19 +489,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 * @@ -530,7 +496,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); @@ -552,6 +517,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); } @@ -619,7 +585,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 544eaf581..565001561 100644 --- a/src/main/java/com/prowidesoftware/swift/model/field/Field34K.java +++ b/src/main/java/com/prowidesoftware/swift/model/field/Field34K.java @@ -212,14 +212,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; } @@ -453,24 +451,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 * @@ -478,7 +458,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) { @@ -510,19 +489,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 * @@ -530,7 +496,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); @@ -552,6 +517,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); } @@ -619,7 +585,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 061d2935f..438a0e208 100644 --- a/src/main/java/com/prowidesoftware/swift/model/field/Field34L.java +++ b/src/main/java/com/prowidesoftware/swift/model/field/Field34L.java @@ -212,14 +212,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; } @@ -453,24 +451,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 * @@ -478,7 +458,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) { @@ -510,19 +489,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 * @@ -530,7 +496,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); @@ -552,6 +517,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); } @@ -619,7 +585,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 4b5efe3b9..2aeb7540d 100644 --- a/src/main/java/com/prowidesoftware/swift/model/field/Field34M.java +++ b/src/main/java/com/prowidesoftware/swift/model/field/Field34M.java @@ -212,14 +212,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; } @@ -453,24 +451,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 * @@ -478,7 +458,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) { @@ -510,19 +489,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 * @@ -530,7 +496,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); @@ -552,6 +517,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); } @@ -619,7 +585,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 6d85ea171..1c36e9d4f 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; /** @@ -212,14 +209,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; } @@ -453,24 +448,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 * @@ -478,7 +455,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) { @@ -510,19 +486,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 * @@ -530,7 +493,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); @@ -552,6 +514,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); } @@ -619,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 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 a1f6fe843..a07bc2b56 100644 --- a/src/main/java/com/prowidesoftware/swift/model/field/Field34T.java +++ b/src/main/java/com/prowidesoftware/swift/model/field/Field34T.java @@ -212,14 +212,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; } @@ -453,24 +451,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 * @@ -478,7 +458,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) { @@ -510,19 +489,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 * @@ -530,7 +496,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); @@ -552,6 +517,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); } @@ -619,7 +585,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 c19c50bc2..378132a91 100644 --- a/src/main/java/com/prowidesoftware/swift/model/field/Field34U.java +++ b/src/main/java/com/prowidesoftware/swift/model/field/Field34U.java @@ -212,14 +212,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; } @@ -453,24 +451,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 * @@ -478,7 +458,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) { @@ -510,19 +489,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 * @@ -530,7 +496,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); @@ -552,6 +517,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); } @@ -619,7 +585,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 56978b316..8969ab65c 100644 --- a/src/main/java/com/prowidesoftware/swift/model/field/Field34V.java +++ b/src/main/java/com/prowidesoftware/swift/model/field/Field34V.java @@ -212,14 +212,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; } @@ -453,24 +451,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 * @@ -478,7 +458,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) { @@ -510,19 +489,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 * @@ -530,7 +496,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); @@ -552,6 +517,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); } @@ -619,7 +585,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 ce34858ab..741579099 100644 --- a/src/main/java/com/prowidesoftware/swift/model/field/Field34W.java +++ b/src/main/java/com/prowidesoftware/swift/model/field/Field34W.java @@ -212,14 +212,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; } @@ -453,24 +451,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 * @@ -478,7 +458,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) { @@ -510,19 +489,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 * @@ -530,7 +496,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); @@ -552,6 +517,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); } @@ -619,7 +585,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 f26d1fda5..b24ff1e63 100644 --- a/src/main/java/com/prowidesoftware/swift/model/field/Field34X.java +++ b/src/main/java/com/prowidesoftware/swift/model/field/Field34X.java @@ -212,14 +212,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; } @@ -453,24 +451,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 * @@ -478,7 +458,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) { @@ -510,19 +489,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 * @@ -530,7 +496,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); @@ -552,6 +517,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); } @@ -619,7 +585,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 20fe2d1dd..bb513aa17 100644 --- a/src/main/java/com/prowidesoftware/swift/model/field/Field47E.java +++ b/src/main/java/com/prowidesoftware/swift/model/field/Field47E.java @@ -195,14 +195,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); } /** @@ -418,7 +415,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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)); } @@ -434,6 +431,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); } @@ -447,6 +445,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); @@ -459,6 +458,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()); } @@ -471,6 +471,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)); @@ -485,6 +486,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); } @@ -499,6 +501,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 295fda0ae..a5b4c2c7f 100644 --- a/src/main/java/com/prowidesoftware/swift/model/field/Field49D.java +++ b/src/main/java/com/prowidesoftware/swift/model/field/Field49D.java @@ -195,14 +195,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); } /** @@ -418,7 +415,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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 de99a0006..af3b62126 100644 --- a/src/main/java/com/prowidesoftware/swift/model/field/Field49F.java +++ b/src/main/java/com/prowidesoftware/swift/model/field/Field49F.java @@ -195,14 +195,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); } /** @@ -418,7 +415,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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)); } @@ -434,6 +431,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); } @@ -447,6 +445,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); @@ -459,6 +458,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()); } @@ -471,6 +471,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)); @@ -485,6 +486,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); } @@ -499,6 +501,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 863cf102e..f715c09b6 100644 --- a/src/main/java/com/prowidesoftware/swift/model/field/Field49J.java +++ b/src/main/java/com/prowidesoftware/swift/model/field/Field49J.java @@ -195,14 +195,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); } /** @@ -418,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 Field49J(f)); } @@ -434,6 +432,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); } @@ -447,6 +446,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); @@ -459,6 +459,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()); } @@ -471,6 +472,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)); @@ -485,6 +487,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); } @@ -499,6 +502,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 ef5c5ab4a..b96fd0eb1 100644 --- a/src/main/java/com/prowidesoftware/swift/model/field/Field49K.java +++ b/src/main/java/com/prowidesoftware/swift/model/field/Field49K.java @@ -195,14 +195,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); } /** @@ -418,7 +415,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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)); } @@ -434,6 +431,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); } @@ -447,6 +445,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); @@ -459,6 +458,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()); } @@ -471,6 +471,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)); @@ -485,6 +486,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); } @@ -499,6 +501,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 5aa056ee6..a2f5d303e 100644 --- a/src/main/java/com/prowidesoftware/swift/model/field/Field49L.java +++ b/src/main/java/com/prowidesoftware/swift/model/field/Field49L.java @@ -195,14 +195,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); } /** @@ -418,7 +415,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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)); } @@ -434,6 +431,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); } @@ -447,6 +445,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); @@ -459,6 +458,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()); } @@ -471,6 +471,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)); @@ -485,6 +486,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); } @@ -499,6 +501,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 a78235458..9115750c2 100644 --- a/src/main/java/com/prowidesoftware/swift/model/field/Field49Z.java +++ b/src/main/java/com/prowidesoftware/swift/model/field/Field49Z.java @@ -195,14 +195,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); } /** @@ -418,7 +415,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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)); } @@ -434,6 +431,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); } @@ -447,6 +445,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); @@ -459,6 +458,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()); } @@ -471,6 +471,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)); @@ -485,6 +486,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); } @@ -499,6 +501,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 5b14daf27..336726251 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 6643fa320..0b1845301 100644 --- a/src/main/java/com/prowidesoftware/swift/model/field/Field78B.java +++ b/src/main/java/com/prowidesoftware/swift/model/field/Field78B.java @@ -195,14 +195,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); } /** @@ -418,7 +415,7 @@ public static List getAll(final SwiftTagListBlock block) { return 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)); } @@ -434,6 +431,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); } @@ -447,6 +445,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); @@ -459,6 +458,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()); } @@ -471,6 +471,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)); @@ -485,6 +486,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); } @@ -499,6 +501,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 488c48a79..efe038de8 100644 --- a/src/main/java/com/prowidesoftware/swift/model/field/OptionCPartyField.java +++ b/src/main/java/com/prowidesoftware/swift/model/field/OptionCPartyField.java @@ -111,7 +111,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 9717f4f23..3154b3a99 100644 --- a/src/main/java/com/prowidesoftware/swift/model/field/OptionJPartyField.java +++ b/src/main/java/com/prowidesoftware/swift/model/field/OptionJPartyField.java @@ -111,7 +111,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 d44b07783..482cdcfe3 100644 --- a/src/main/java/com/prowidesoftware/swift/model/field/OptionLPartyField.java +++ b/src/main/java/com/prowidesoftware/swift/model/field/OptionLPartyField.java @@ -110,7 +110,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