Class Narrative.Builder
- java.lang.Object
-
- com.prowidesoftware.swift.model.field.Narrative.Builder
-
- Enclosing class:
- Narrative
public static class Narrative.Builder extends java.lang.Object
-
-
Constructor Summary
Constructors Constructor Description Builder(int lineLength)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method 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 separatorNarrative.Builder
addUnstructuredStrict(java.lang.String narrative)
Adds unstructured narrative content strictly wrapped into lines without any format or slash separatorNarrative
build()
-
-
-
Method Detail
-
addCodeword
public Narrative.Builder addCodeword(java.lang.String codeword, java.lang.String narrative)
Adds structured narrative content composed by codeword and wrapped text. Will be serialized as:Line 1: /codeword/[narrative] Lines 2-n: [//continuation of narrative]
- Parameters:
codeword
- the codeword (instruction code)narrative
- the narrative text (will be wrapped into lines if necessary)
-
addCodewordWithAmount
public 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. Will be serialized as:Line 1: /codeword/[currency][amount][narrative] Lines 2-n: [//continuation of narrative]
- Parameters:
codeword
- the codeword (instruction code)currency
- a three letters ISO currency codenarrative
- the narrative text (will be wrapped into lines if necessary)
-
addCodewordWithCountry
public 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. Will be serialized as:Line 1: /codeword/country[//narrative] Lines 2-3: [//continuation of narrative]
-
addCodewordWithSupplement
public 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. This line formats are used for fields with query and response numbers. Will be serialized as:Line 1: /number/[narrative][/supplement] Lines 2-6 [//continuation of supplement] or Line 1: /number/[narrative][/supplement] Lines 2-6 [//continuation of narrative][/supplement]
- Parameters:
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 separator
-
addUnstructured
public Narrative.Builder addUnstructured(java.lang.String narrative)
Adds unstructured narrative content wrapped into lines without any format or slash separator
-
addUnstructuredStrict
public Narrative.Builder addUnstructuredStrict(java.lang.String narrative)
Adds unstructured narrative content strictly wrapped into lines without any format or slash separator
-
build
public Narrative build()
-
-