public class StructuredNarrative
extends java.lang.Object
The structured narrative consist of a codeword or instruction plus additional content. This additional content is normally the actual narrative text but for some fields can include a currency and amount or a country code.
This model is intended to be a generic container for any type of structured narrative, for any narrative container field. When a component (currency, amount, country or supplement) does not apply to a field, it will be simply set to null by the parser.
To create this structure see Narrative.builder(int)
Constructor and Description |
---|
StructuredNarrative() |
Modifier and Type | Method and Description |
---|---|
java.math.BigDecimal |
getAmount()
In fields such as 73A, 71D, 71B and 73 the amount (along the currency) can be present as the first part of the
narrative content.
|
java.lang.String |
getBankCode()
In SCORE messages, in field 71B, there is a bank code within the codeword with a slash separator (i.e.
|
java.lang.String |
getCodeword()
The codeword is a mandatory keyword to identify this particular narrative content in a narrative field value.
|
java.lang.String |
getCountry()
In fields such as 77B a two letters country code can be present as the first part of the narrative content.
|
java.lang.String |
getCurrency()
In fields 73A, 71D, 71B and 73 the currency can be present as the first part of the narrative content along
an amount.
|
java.lang.String |
getNarrative()
Gets this narrative content as a single String, meaning if the narrative was wrapped in lines this method will
return the joined lines without separator.
|
java.lang.String |
getNarrative(java.lang.String delimiter)
Gets this narrative content as a single String, meaning if the narrative was wrapped in lines this method will
return the joined lines.
|
java.util.List<java.lang.String> |
getNarrativeFragments()
Returns the list of text fragments in the narrative, fragments are segments of the text that is wrapped in lines.
|
java.util.List<NarrativeFragment> |
getNarrativeFragmentsDetail()
Returns the list of text fragments in the narrative including the line index and line length,
fragments are segments of the text that is wrapped in lines.
|
java.lang.String |
getNarrativeSupplement()
Gets this narrative supplement content as a single String, meaning if the text was wrapped in lines this
method will return the joined lines without separator.
|
java.lang.String |
getNarrativeSupplement(java.lang.String delimiter)
Gets this narrative supplement content as a single String, meaning if the text was wrapped in lines this
method will return the joined lines.
|
java.util.List<java.lang.String> |
getNarrativeSupplementFragments()
In fields such as 75 or 76 the narrative can be split into a first text along an optional second supplement.
|
boolean |
isEmpty() |
void |
setBankCode(java.lang.String bankCode)
See
getBankCode() . |
boolean |
valid()
Basic validation to check the codeword is present and at least one of the other fields is present
|
public java.lang.String getCodeword()
public java.lang.String getCurrency()
public java.lang.String getBankCode()
getCurrency()
public void setBankCode(java.lang.String bankCode)
getBankCode()
.public java.math.BigDecimal getAmount()
public java.lang.String getCountry()
public java.util.List<java.lang.String> getNarrativeFragments()
getNarrative(String)
public java.util.List<NarrativeFragment> getNarrativeFragmentsDetail()
getNarrative(String)
public java.util.List<java.lang.String> getNarrativeSupplementFragments()
getNarrativeSupplement(String)
public java.lang.String getNarrative()
public java.lang.String getNarrative(java.lang.String delimiter)
delimiter
- optional delimiter, could be for example null, empty, space or line break.public java.lang.String getNarrativeSupplement()
public java.lang.String getNarrativeSupplement(java.lang.String delimiter)
delimiter
- optional delimiter, could be for example null, empty, space or line break.public boolean isEmpty()
public boolean valid()