Skip to content

Commit

Permalink
PW-1086: Fixed typo in field 36D accessors, MT540 and MT548 added mis…
Browse files Browse the repository at this point in the history
…sing getter for Field99C (#129)
  • Loading branch information
ptorres-prowide authored Nov 3, 2022
1 parent 4a5fd00 commit 5230331
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 54 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
# Prowide Core - CHANGELOG

#### 9.3.6-SNAPSHOT
* (PW-1086) Fixed typo in field 36D accessors
* (PW-1078) StructuredNarrative: Added getBankCode() methods in order to allow direct access to data
* (GH-88) Missing constants for ISO 15022 codes added
* MT540 and MT548 added missing getter for Field99C
* Added removeRepeatedBoundaries method in order to remove repeated tag boundaries

#### 9.3.5 - October 2022
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ public class Field36D extends Field implements Serializable, GenericField {
public static final Integer QUANTITY_TYPE_CODE = 2;

/**
* Component number for the Quantity of Digital Tokens subfield.
* Component number for the Quantity Of Digital Tokens subfield.
*/
public static final Integer QUANTITY_OF_DIGITAL_TOKENS = 3;

Expand Down Expand Up @@ -330,7 +330,7 @@ public List<String> getComponentLabels() {
List<String> result = new ArrayList<>();
result.add("Qualifier");
result.add("Quantity Type Code");
result.add("Quantity of Digital Tokens");
result.add("Quantity Of Digital Tokens");
return result;
}

Expand All @@ -343,7 +343,7 @@ protected Map<Integer, String> getComponentMap() {
Map<Integer, String> result = new HashMap<>();
result.put(1, "qualifier");
result.put(2, "quantityTypeCode");
result.put(3, "quantityofDigitalTokens");
result.put(3, "quantityOfDigitalTokens");
return result;
}

Expand Down Expand Up @@ -381,7 +381,7 @@ public String getQuantityTypeCode() {
}

/**
* Gets the component 3 (Quantity of Digital Tokens).
* Gets the component 3 (Quantity Of Digital Tokens).
* @return the component 3
*/
public String getComponent3() {
Expand Down Expand Up @@ -415,34 +415,34 @@ public java.lang.Number getComponent3AsNumber() {
}

/**
* Gets the Quantity of Digital Tokens (component 3).
* @return the Quantity of Digital Tokens from component 3
* Gets the Quantity Of Digital Tokens (component 3).
* @return the Quantity Of Digital Tokens from component 3
*/
public String getQuantityofDigitalTokens() {
public String getQuantityOfDigitalTokens() {
return getComponent3();
}

/**
* Get the Quantity of Digital Tokens (component 3) as Long
* @return the Quantity of Digital Tokens from component 3 converted to Long or null if cannot be converted
* Get the Quantity Of Digital Tokens (component 3) as Long
* @return the Quantity Of Digital Tokens from component 3 converted to Long or null if cannot be converted
* @since 9.2.7
*/
public java.lang.Long getQuantityofDigitalTokensAsLong() {
public java.lang.Long getQuantityOfDigitalTokensAsLong() {
return getComponent3AsLong();
}

/**
* Get the Quantity of Digital Tokens (component 3) as as Number (BigDecimal)
* Get the Quantity Of Digital Tokens (component 3) as as Number (BigDecimal)
*
* The value is returned as BigDecimal to keep compatibility with previous API. You should
* use <code>getComponent3AsLong()</code> to get the proper value.
*
* @return the component 3 converted to Number (BigDecimal) or null if cannot be converted
* @see #getQuantityofDigitalTokensAsLong()
* @see #getQuantityOfDigitalTokensAsLong()
*/
@Deprecated
@ProwideDeprecated(phase3 = TargetYear.SRU2023)
public java.lang.Number getQuantityofDigitalTokensAsNumber() {
public java.lang.Number getQuantityOfDigitalTokensAsNumber() {
return getComponent3AsNumber();
}

Expand Down Expand Up @@ -489,9 +489,9 @@ public Field36D setQuantityTypeCode(String component2) {
}

/**
* Set the component 3 (Quantity of Digital Tokens).
* Set the component 3 (Quantity Of Digital Tokens).
*
* @param component3 the Quantity of Digital Tokens to set
* @param component3 the Quantity Of Digital Tokens to set
* @return the field object to enable build pattern
*/
public Field36D setComponent3(String component3) {
Expand All @@ -509,7 +509,7 @@ public Field36D setComponent3(String component3) {
* @see #setComponent3(String)
* @since 9.2.7
*
* @param component3 the Long with the Quantity of Digital Tokens content to set
* @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) {
Expand All @@ -518,13 +518,13 @@ public Field36D setComponent3(java.lang.Long component3) {
}

/**
* Alternative method setter for field's Quantity of Digital Tokens (component 3) as as Number
* Alternative method setter for field's Quantity Of Digital Tokens (component 3) as 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
* @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)
* @see #setQuantityOfDigitalTokens(java.lang.Long)
*/
public Field36D setComponent3(java.lang.Number component3) {

Expand All @@ -545,38 +545,38 @@ public Field36D setComponent3(java.lang.Number component3) {
}

/**
* Set the Quantity of Digital Tokens (component 3).
* Set the Quantity Of Digital Tokens (component 3).
*
* @param component3 the Quantity of Digital Tokens to set
* @param component3 the Quantity Of Digital Tokens to set
* @return the field object to enable build pattern
*/
public Field36D setQuantityofDigitalTokens(String component3) {
public Field36D setQuantityOfDigitalTokens(String component3) {
return setComponent3(component3);
}

/**
* Set the Quantity of Digital Tokens (component 3) from a Long object.
* 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
* @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) {
public Field36D setQuantityOfDigitalTokens(java.lang.Long component3) {
return setComponent3(component3);
}

/**
* Alternative method setter for field's Quantity of Digital Tokens (component 3) as as Number
* Alternative method setter for field's Quantity Of Digital Tokens (component 3) as 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
* @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)
* @see #setQuantityOfDigitalTokens(java.lang.Long)
*/
public Field36D setQuantityofDigitalTokens(java.lang.Number component3) {
public Field36D setQuantityOfDigitalTokens(java.lang.Number component3) {
return setComponent3(component3);
}

Expand Down Expand Up @@ -712,10 +712,10 @@ public static Field36D fromJson(final String json) {
field.setComponent2(jsonObject.get("quantityTypeCode").getAsString());
}

// **** COMPONENT 3 - Quantity of Digital Tokens
// **** COMPONENT 3 - Quantity Of Digital Tokens

if (jsonObject.get("quantityofDigitalTokens") != null) {
field.setComponent3(jsonObject.get("quantityofDigitalTokens").getAsString());
if (jsonObject.get("quantityOfDigitalTokens") != null) {
field.setComponent3(jsonObject.get("quantityOfDigitalTokens").getAsString());
}

return field;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
<li class="field">Field 98 A,C,E (O)</li>
<li class="fieldset">
Fieldset 99
(O)<ul><li>FieldsetItem 99 B,C (O)</li><li>FieldsetItem 99 B,C (O)</li></ul></li><li class="sequence">
(O)<ul><li>FieldsetItem 99 B (O)</li><li>FieldsetItem 99 B (O)</li></ul></li><li class="sequence">
Sequence A1 - Linkages (O) (repetitive)<ul><li class="field">Field 16 R (M)</li>
<li class="field">Field 22 F (O)</li>
<li class="field">Field 13 A,B (O)</li>
Expand Down Expand Up @@ -488,26 +488,6 @@ public List<Field99B> getField99B() {
return result;
}

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

/**
* Iterates through block4 fields and return all occurrences of fields whose names matches 16R,
* or <code>Collections.emptyList()</code> if none is found.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@
Fieldset 22
(M) (repetitive)<ul><li>FieldsetItem 22 F (M)</li><li>FieldsetItem 22 H (M)</li><li>FieldsetItem 22 H (M)</li><li>FieldsetItem 22 F (O) (repetitive)</li><li>FieldsetItem 22 F (O)</li><li>FieldsetItem 22 F (O)</li><li>FieldsetItem 22 F (O)</li><li>FieldsetItem 22 F (O)</li><li>FieldsetItem 22 F (O)</li><li>FieldsetItem 22 F (O)</li><li>FieldsetItem 22 F (O)</li><li>FieldsetItem 22 F (O)</li><li>FieldsetItem 22 F (O)</li><li>FieldsetItem 22 F (O)</li><li>FieldsetItem 22 F (O)</li><li>FieldsetItem 22 F (O)</li><li>FieldsetItem 22 F (O)</li><li>FieldsetItem 22 F (O)</li><li>FieldsetItem 22 F (O)</li><li>FieldsetItem 22 F (O)</li><li>FieldsetItem 22 F (O)</li></ul></li><li class="fieldset">
Fieldset 98
(M) (repetitive)<ul><li>FieldsetItem 98 A,C (O)</li><li>FieldsetItem 98 C,E (O)</li><li>FieldsetItem 98 A,C (O)</li><li>FieldsetItem 98 A,C (O)</li><li>FieldsetItem 98 C,E (O)</li><li>FieldsetItem 98 A,B,C (M)</li><li>FieldsetItem 98 A,B,C,E (O)</li></ul></li><li class="field">Field 70 E (O)</li>
(M) (repetitive)<ul><li>FieldsetItem 98 A,C (O)</li><li>FieldsetItem 98 C,E (O)</li><li>FieldsetItem 98 A,C (O)</li><li>FieldsetItem 98 A,C (O)</li><li>FieldsetItem 98 C,E (O)</li><li>FieldsetItem 98 C (O)</li><li>FieldsetItem 98 A,B,C (M)</li><li>FieldsetItem 98 A,B,C,E (O)</li></ul></li><li class="field">Field 70 E (O)</li>
<li class="sequence">
Sequence B1 - Settlement Parties (O) (repetitive)<ul><li class="field">Field 16 R (M)</li>
<li class="fieldset">
Expand Down

0 comments on commit 5230331

Please sign in to comment.