Class 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 separator
      Narrative.Builder addUnstructuredStrict​(java.lang.String narrative)
      Adds unstructured narrative content strictly wrapped into lines without any format or slash separator
      Narrative build()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • Builder

        public Builder​(int lineLength)
        Parameters:
        lineLength - specific field max line length, used for text wrapping
    • 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 code
        narrative - 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 codewords
        narrative - the primary query/answer text
        supplement - 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