public static class Narrative.Builder
extends java.lang.Object
Constructor and Description |
---|
Builder(int lineLength) |
Modifier and Type | Method and Description |
---|---|
Narrative.Builder |
addCodeword(java.lang.String codeword,
java.lang.String narrative)
Adds structured narrative content composed by codeword and wrapped text.
|
Narrative.Builder |
addCodewordWithAmount(java.lang.String codeword,
java.lang.String currency,
java.math.BigDecimal amount,
java.lang.String narrative)
Adds structured narrative content composed by codeword, currency, amount and optional wrapped text.
|
Narrative.Builder |
addCodewordWithCountry(java.lang.String codeword,
java.lang.String country,
java.lang.String narrative)
Adds structured narrative content composed by codeword, country code and optional wrapped text.
|
Narrative.Builder |
addCodewordWithSupplement(java.lang.String number,
java.lang.String narrative,
java.lang.String supplement)
Adds structured narrative content composed by codeword, wrapped narrative and supplementary narrative.
|
Narrative.Builder |
addUnstructured(java.lang.String narrative)
Adds unstructured narrative content wrapped into lines without any format or slash separator
|
Narrative |
build() |
public Builder(int lineLength)
lineLength
- specific field max line length, used for text wrappingpublic Narrative.Builder addCodeword(java.lang.String codeword, java.lang.String narrative)
Line 1: /codeword/[narrative] Lines 2-n: [//continuation of narrative]
codeword
- the codeword (instruction code)narrative
- the narrative text (will be wrapped into lines if necessary)public Narrative.Builder addCodewordWithAmount(java.lang.String codeword, java.lang.String currency, java.math.BigDecimal amount, java.lang.String narrative)
Line 1: /codeword/[currency][amount][narrative] Lines 2-n: [//continuation of narrative]
codeword
- the codeword (instruction code)currency
- a three letters ISO currency codenarrative
- the narrative text (will be wrapped into lines if necessary)public Narrative.Builder addCodewordWithCountry(java.lang.String codeword, java.lang.String country, java.lang.String narrative)
Line 1: /codeword/country[//narrative] Lines 2-3: [//continuation of narrative]
public Narrative.Builder addCodewordWithSupplement(java.lang.String number, java.lang.String narrative, java.lang.String supplement)
Line 1: /number/[narrative][/supplement] Lines 2-6 [//continuation of supplement] or Line 1: /number/[narrative][/supplement] Lines 2-6 [//continuation of narrative][/supplement]
number
- the API accepts a String however this line structure is normally used with query/answer numbers as codewordsnarrative
- the primary query/answer textsupplement
- additional query/answer text, that will be added with slash separatorpublic Narrative.Builder addUnstructured(java.lang.String narrative)
public Narrative build()