Class Field

    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected java.util.List<java.lang.String> components
      Zero based list of field components in String format.
      For example: for field content ":FOO//EUR1234 will be components[0]=FOO, components[1]=EUR and components[1]=1234
      protected java.util.Map<java.lang.String,​java.lang.Integer> labelMap  
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      protected Field​(int components)
      Creates a field with the list of components initialized to the given number of components.
      protected Field​(Field source)
      Copy constructor.
      Initializes the components list with a deep copy of the source components list.
      protected Field​(java.lang.String value)
      Creates a new field and initializes its components with content from the parameter value.
    • Method Summary

      All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Deprecated Methods 
      Modifier and Type Method Description
      protected void append​(java.lang.StringBuilder result, int component)
      Appends a not null field component to the builder.
      protected void appendInLines​(java.lang.StringBuilder sb, int componentStart, int componentEnd)
      Append each component between componentStart and componentEnd in a new lines, empty components are ignored
      protected void appendInLines​(java.lang.StringBuilder sb, java.lang.String... lines)
      Append each lines in a new lines, empty lines are ignored
      Tag asTag()
      Get the generic tag object of this field.
      int componentNameToNumber​(java.lang.String componentName)
      Get the component number based on the component name
      abstract java.lang.String componentsPattern()
      Deprecated.
      Use typesPattern() instead
      abstract int componentsSize()
      Returns the defined amount of components.
      This is not the amount of components present in the field instance, but the total amount of components that this field accepts as defined.
      boolean equals​(java.lang.Object obj)
      Implementation of equals using EqualsBuilder from commons-lang
      java.lang.String findComponentStartingWith​(java.lang.String prefix)
      Returns the first component starting with the given prefix value or null if not found.
      protected static java.lang.String format​(java.util.Calendar d)  
      protected static java.lang.String formatAccount​(java.lang.String a)
      A formatted account with a fixed format nnnn-nnnnn-nnn-n
      protected static java.lang.String formatNumber​(java.lang.Object aValue)
      Format the given object as a money number without currency information in format
      static Field fromJson​(java.lang.String json)
      Creates a specific field instance from its JSON representation.
      static java.math.BigDecimal getAsBigDecimal​(java.lang.Number number)
      Gets a BigDecimal from a generic Number argument
      java.lang.String getComponent​(int number)
      Gets a specific component from the components list.
      java.lang.String getComponent​(java.lang.String componentName)
      Gets a specific component (subfield) value given its name.
      java.lang.Object getComponentAs​(int component, java.lang.Class c)
      Get the given component as the given object type.
      java.lang.Object getComponentAs​(java.lang.String componentName, java.lang.Class c)
      Get the given component as the given object type.
      java.lang.Number getComponentAsNumber​(int component)
      Get the given component as a number object This method internall y calls getComponentAs(int, Class), and casts the result
      java.lang.Object getComponentAsNumber​(java.lang.String componentName)
      Get the given component as a number object This method internal y calls getComponentAsNumber(int), and casts the result
      java.lang.String getComponentLabel​(int number)
      Returns english label for the component.
      java.lang.String getComponentLabel​(java.lang.String componentName)
      Returns english label for the component.
      abstract java.util.List<java.lang.String> getComponentLabels()
      Returns english label for components.
      protected abstract java.util.Map<java.lang.Integer,​java.lang.String> getComponentMap()
      Returns a mapping between component numbers and their label in camel case format.
      java.util.List<java.lang.String> getComponents()  
      static Field getField​(Tag t)
      Creates a Field instance for the given Tag object, using reflection.
      static Field getField​(java.lang.String name, java.lang.String value)
      Creates a Field instance for the given it's name and and optional value, using reflection.
      static java.lang.String getLabel​(java.lang.String fieldName, java.lang.String mt, java.lang.String sequence)
      Same as getLabel(String, String, String, Locale) using default locale
      static java.lang.String getLabel​(java.lang.String fieldName, java.lang.String mt, java.lang.String sequence, java.util.Locale locale)
      Returns the field business description name, using resource bundle from pw_swift_labels property files.
      static java.lang.String getLabelComponents​(java.lang.String fieldName, java.lang.String mt, java.lang.String sequence, java.util.Locale locale)
      Similar to getLabelComponents(String, String, String, Locale) but returning the components property in bundle
      protected abstract java.util.Map<java.lang.String,​java.lang.Integer> getLabelMap()
      Returns a mapping between component labels and the internal component number.
      protected java.lang.String getLine​(Field cp, java.lang.Integer start, java.lang.Integer end, int offset)
      Base implementation for subclasses getLine API.
      abstract java.lang.String getName()
      Returns the field's name composed by the field number and the letter option (if any)
      abstract java.lang.String getValue()
      Serializes the components into the a plain string value in SWIFT format.
      java.lang.String getValueByCodeword​(java.lang.String codeword)
      Finds the first component starting with the given codeword between slashes, and returns the component subvalue.
      java.lang.String getValueDisplay()  
      abstract java.lang.String getValueDisplay​(int component, java.util.Locale locale)
      Returns a localized suitable for showing to humans string of a field component.
      java.lang.String getValueDisplay​(java.lang.String componentName, java.util.Locale locale)
      Returns a localized suitable for showing to humans string of a field component.
      java.lang.String getValueDisplay​(java.util.Locale locale)
      Get a localized, suitable for showing to humans string of the field values.
      int hashCode()
      Implementation of hashCode using HashCodeBuilder from commons-lang
      protected void init​(int components)
      Initialize the list of components to the indicated size and sets all values to null
      boolean is​(int componentNumber, java.lang.String compare)
      Compares a specific component with the parameter value
      boolean is​(java.lang.String compare)
      Compares this field component 1 with the parameter value
      Same as is(1, compare)
      If the field has only one component this is the same as comparing against field value
      boolean is​(java.lang.String... values)
      Compares this field component 1 with the parameter values.
      boolean is​(java.lang.String compare1, java.lang.String compare2)
      Compares this field components 1 and 2 with the parameter values.
      boolean isEmpty()
      Returns true if all field's components are blank or null
      abstract boolean isGeneric()  
      boolean isLetterOption​(char c)
      Tell if this field is of a given letter option.
      boolean isNameAnyOf​(java.lang.String... names)
      Compares the this fields's name with a list of names to check
      abstract boolean isOptional​(int component)  
      java.lang.String joinComponents()
      Returns a string with all field's components joined.
      java.lang.String joinComponents​(boolean skipLast)
      Returns a string with all field's components joined.
      java.lang.String joinComponents​(int start)
      Returns a string with all field's components joined
      java.lang.String joinComponents​(int start, boolean skipLast)
      Returns a string with joined components values.
      java.lang.Character letterOption()
      Return the letter option of this field as given by it classname or null if this field has no letter option
      protected java.util.Locale notNull​(java.util.Locale locale)
      Ensures a not-null locale parameter.
      abstract void parse​(java.lang.String value)
      Parses the parameter value into the internal components structure.
      void setComponent​(int number, java.lang.String value)
      Inserts a component String value into the list of components, using the component number to position the value into the List.
      void setComponent​(java.lang.String componentName, java.lang.String value)
      Inserts a component String value into the list of components, using the component name to position the value into the List.
      void setComponents​(java.util.List<java.lang.String> components)  
      java.lang.String toJson()
      Get a json representation of this message with expanded fields content.
      java.lang.String toString()
      Implementation of toString using ToStringBuilder from commons-lang
      abstract java.lang.String typesPattern()
      Returns the field component types pattern
      abstract java.lang.String validatorPattern()
      Returns the field's validator pattern
      static boolean validName​(java.lang.String name)
      Returns true if the field name is valid.
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
    • Field Detail

      • components

        protected java.util.List<java.lang.String> components
        Zero based list of field components in String format.
        For example: for field content ":FOO//EUR1234 will be components[0]=FOO, components[1]=EUR and components[1]=1234
      • labelMap

        protected java.util.Map<java.lang.String,​java.lang.Integer> labelMap
    • Constructor Detail

      • Field

        protected Field​(int components)
        Creates a field with the list of components initialized to the given number of components.
        Parameters:
        components - the number of components to initialize
        See Also:
        init(int)
      • Field

        protected Field​(java.lang.String value)
        Creates a new field and initializes its components with content from the parameter value. The value is parsed with parse(String)
        Parameters:
        value - complete field value including separators and CRLF
      • Field

        protected Field​(Field source)
        Copy constructor.
        Initializes the components list with a deep copy of the source components list.
        Parameters:
        source - a field instance to copy
        Since:
        7.7
    • Method Detail

      • formatNumber

        protected static java.lang.String formatNumber​(java.lang.Object aValue)
        Format the given object as a money number without currency information in format
        Returns:
        the formatted amount as String
      • format

        protected static java.lang.String format​(java.util.Calendar d)
        Parameters:
        d - Date object to format
        Returns:
        the formatted date as dd/MM/yyyy or empty if exception occurs during formatting
      • formatAccount

        protected static java.lang.String formatAccount​(java.lang.String a)
        A formatted account with a fixed format nnnn-nnnnn-nnn-n
        Parameters:
        a - string with an account number or null
        Returns:
        the formatted account or an empty String if param is null
      • getAsBigDecimal

        public static java.math.BigDecimal getAsBigDecimal​(java.lang.Number number)
        Gets a BigDecimal from a generic Number argument
        Returns:
        BigDecimal value of number parameter
      • getField

        public static Field getField​(Tag t)
        Creates a Field instance for the given Tag object, using reflection. The created object is populated with parsed components data from the Tag.
        Parameters:
        t - a tag with proper name and value content
        Returns:
        a specific field object, ex: Field32A. Or null if exceptions occur during object creation.
      • getField

        public static Field getField​(java.lang.String name,
                                     java.lang.String value)
        Creates a Field instance for the given it's name and and optional value, using reflection.
        Parameters:
        name - a proper field name, ex: 32A, 22F, 20
        value - an optional field value or null to create the field with no initial content
        Returns:
        a specific field object (example: Field32A) or null if exceptions occur during object creation.
        Since:
        7.8
      • getLabel

        public static java.lang.String getLabel​(java.lang.String fieldName,
                                                java.lang.String mt,
                                                java.lang.String sequence)
        Same as getLabel(String, String, String, Locale) using default locale
        Since:
        7.8
      • getLabel

        public static java.lang.String getLabel​(java.lang.String fieldName,
                                                java.lang.String mt,
                                                java.lang.String sequence,
                                                java.util.Locale locale)
        Returns the field business description name, using resource bundle from pw_swift_labels property files. Field names may be generic for all usages, or may differ for particular letter option, message type or even sequence of a message type. The property supports all this kind of definitions with generic labels and specific ones. The following example illustrate the precedence of bundle keys that are checked for field 50:
        • 50K[103][B]
        • 50a[103][B]
        • 50K[103]
        • 50a[103]
        • 50K
        • 50a
        • 50
        Parameters:
        fieldName - field name of the field to retrieve its label, if the combination of number and letter option is provided then a specific label is returned; is the letter option is omitted then a more generic label is returned.
        mt - optional indication of message type or null.
        sequence - optional indication of sequence or null if does not apply for the specific MT and field.
        locale - the locale for which a resource bundle is desired
        Returns:
        a resource bundle based label for the given locale or the tag name, or the resource key if not found
      • getLabelComponents

        public static java.lang.String getLabelComponents​(java.lang.String fieldName,
                                                          java.lang.String mt,
                                                          java.lang.String sequence,
                                                          java.util.Locale locale)
        Similar to getLabelComponents(String, String, String, Locale) but returning the components property in bundle
        Since:
        7.8.4
      • validName

        public static boolean validName​(java.lang.String name)
        Returns true if the field name is valid. Valid field names are for example: 20, 20C, 108
        Parameters:
        name - a field name to validate
        Returns:
        true if valid, false otherwise
        Since:
        7.8
      • fromJson

        public static Field fromJson​(java.lang.String json)
        Creates a specific field instance from its JSON representation.

        The implementation reads the "name" property in the JSON data, then calls the fromJson method in the specific Field subclass

        Returns:
        a specific field, for example Field32A, or null if the JSON data is not well-formed or contains an unrecognized field name
        See Also:
        toJson()
      • init

        protected void init​(int components)
        Initialize the list of components to the indicated size and sets all values to null
        Parameters:
        components - the number of components to initialize
        Since:
        7.8
      • parse

        public abstract void parse​(java.lang.String value)
        Parses the parameter value into the internal components structure. Used to update all components from a full new value, as an alternative to setting individual components. Previous components value is overwritten.
        Implemented by subclasses with logic for each specific field structure.
        Parameters:
        value - complete field value including separators and CRLF
        Since:
        7.8
      • toString

        public java.lang.String toString()
        Implementation of toString using ToStringBuilder from commons-lang
        Overrides:
        toString in class java.lang.Object
      • equals

        public boolean equals​(java.lang.Object obj)
        Implementation of equals using EqualsBuilder from commons-lang
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Implementation of hashCode using HashCodeBuilder from commons-lang
        Overrides:
        hashCode in class java.lang.Object
      • appendInLines

        protected void appendInLines​(java.lang.StringBuilder sb,
                                     java.lang.String... lines)
        Append each lines in a new lines, empty lines are ignored
        Parameters:
        sb - must not be null, target buffer
        lines - may be null or empty, nothing is done in this case
      • appendInLines

        protected void appendInLines​(java.lang.StringBuilder sb,
                                     int componentStart,
                                     int componentEnd)
        Append each component between componentStart and componentEnd in a new lines, empty components are ignored
        Parameters:
        sb - must not be null, target buffer
        componentStart - starting component number to add
        componentEnd - ending component number to add
      • getComponents

        public java.util.List<java.lang.String> getComponents()
        Returns:
        comopnents list
      • setComponents

        public void setComponents​(java.util.List<java.lang.String> components)
        Parameters:
        components - list to set
      • setComponent

        public void setComponent​(int number,
                                 java.lang.String value)
        Inserts a component String value into the list of components, using the component number to position the value into the List.
        Parameters:
        number - component number, first component of a field should be number one
        value - String value of the parsed component (without component separators ':', '/', '//')
      • getComponent

        public java.lang.String getComponent​(int number)
        Gets a specific component from the components list.
        Parameters:
        number - one-based index of component, first component of a field should be number one
        Returns:
        found component or null
      • setComponent

        public void setComponent​(java.lang.String componentName,
                                 java.lang.String value)
        Inserts a component String value into the list of components, using the component name to position the value into the List.
        Parameters:
        componentName - name of component to set
        value - String value of the parsed component (without component separators ':', '/', '//')
        Since:
        9.3.12
      • componentNameToNumber

        public int componentNameToNumber​(java.lang.String componentName)
        Get the component number based on the component name
        Parameters:
        componentName - name of component to get
        Returns:
        the component number or zero if the component name is not part of the field
        Since:
        9.3.12
      • getComponent

        public java.lang.String getComponent​(java.lang.String componentName)
        Gets a specific component (subfield) value given its name.
        Parameters:
        componentName - name of component to get
        Returns:
        found component or null if the component name is not part of the field or the value for the component is not set
        Since:
        9.3.12
      • getValueDisplay

        public java.lang.String getValueDisplay​(java.util.Locale locale)
        Get a localized, suitable for showing to humans string of the field values. This method is overwritten when necessary by subclasses.
        Parameters:
        locale - optional locale to format date and amounts, if null, the default locale is used
        Returns:
        a concatenation of formated components with " " separator
        Since:
        7.8
        See Also:
        getValueDisplay(int, Locale)
      • getValueDisplay

        public abstract java.lang.String getValueDisplay​(int component,
                                                         java.util.Locale locale)
        Returns a localized suitable for showing to humans string of a field component.
        Parameters:
        component - number of the component to display
        locale - optional locale to format date and amounts, if null, the default locale is used
        Returns:
        formatted component value or null if component number is invalid or not present
        Throws:
        java.lang.IllegalArgumentException - if component number is invalid for the field
        Since:
        7.8
      • getValueDisplay

        public java.lang.String getValueDisplay​(java.lang.String componentName,
                                                java.util.Locale locale)
        Returns a localized suitable for showing to humans string of a field component.
        Parameters:
        componentName - name of the component to display
        locale - optional locale to format date and amounts, if null, the default locale is used
        Returns:
        formatted component value or null if component name is invalid or not present
        Throws:
        java.lang.IllegalArgumentException - if component name is invalid for the field
        Since:
        9.3.12
      • getComponentAs

        public java.lang.Object getComponentAs​(java.lang.String componentName,
                                               java.lang.Class c)
        Get the given component as the given object type. If the class is not recognized, it returns null, as well as if conversion fails.
        Parameters:
        componentName - name of the component to retrieve
        Throws:
        java.lang.IllegalArgumentException - if c is not any of: String, BIC, Currency, Number, BigDecimal Character or Integer
        Since:
        9.3.12
        See Also:
        getComponent(int)
      • getComponentAs

        public java.lang.Object getComponentAs​(int component,
                                               java.lang.Class c)
        Get the given component as the given object type. If the class is not recognized, it returns null, as well as if conversion fails.
        Parameters:
        component - one-based index of the component to retrieve
        Throws:
        java.lang.IllegalArgumentException - if c is not any of: String, BIC, Currency, Number, BigDecimal Character or Integer
        See Also:
        getComponent(int)
      • getComponentAsNumber

        public java.lang.Object getComponentAsNumber​(java.lang.String componentName)
        Get the given component as a number object This method internal y calls getComponentAsNumber(int), and casts the result
        Since:
        9.3.12
      • getComponentAsNumber

        public java.lang.Number getComponentAsNumber​(int component)
        Get the given component as a number object This method internall y calls getComponentAs(int, Class), and casts the result
        Since:
        7.8
      • joinComponents

        public java.lang.String joinComponents​(int start,
                                               boolean skipLast)
        Returns a string with joined components values.
        Parameters:
        start - starting index of components to join (zero based)
        skipLast - if true the last component will not be included in the join, and where the "last" component is understood as the last not empty component (this is not necessary the last component of the field's component list.
        Returns:
        s
      • joinComponents

        public java.lang.String joinComponents​(boolean skipLast)
        Returns a string with all field's components joined.
        Returns:
        s
        See Also:
        joinComponents(int, boolean)
      • joinComponents

        public java.lang.String joinComponents​(int start)
        Returns a string with all field's components joined
        Returns:
        s
        See Also:
        joinComponents(int, boolean)
      • joinComponents

        public java.lang.String joinComponents()
        Returns a string with all field's components joined.
        Returns:
        s
        See Also:
        joinComponents(int, boolean)
      • findComponentStartingWith

        public java.lang.String findComponentStartingWith​(java.lang.String prefix)
        Returns the first component starting with the given prefix value or null if not found.
        Returns:
        s
      • getValueByCodeword

        public java.lang.String getValueByCodeword​(java.lang.String codeword)
        Finds the first component starting with the given codeword between slashes, and returns the component subvalue. For example, for the following field value
        /ACC/BLABLABLA CrLf
        //BLABLABLA CrLf
        /INS/CITIUS33MIA CrLf
        //BLABLABLA CrLf
        A call to this method with parameter "INS" will return "CITIUS33MIA"
        Returns:
        the found value or null if not found
        See Also:
        findComponentStartingWith(String)
      • getValue

        public abstract java.lang.String getValue()
        Serializes the components into the a plain string value in SWIFT format.

        This method implementation is specific for each field. All not null components are appended to the result string with proper components separators like ':', slashes and CRLF.

        For any valid field this is always true: new Field(v)).getValue() = v meaning plain value integrity must be preserved after parsing the value into components and serializing it back into the plain value. Conversely this may not be true when the parsed field value is invalid because the parser will do a best effort to gather as many valid components as possible and the serialization will also do a best effort to generate valid content.

        Returns:
        SWIFT formatted value
      • isEmpty

        public boolean isEmpty()
        Returns true if all field's components are blank or null
        Returns:
        true if all field's components are blank or null
      • getName

        public abstract java.lang.String getName()
        Returns the field's name composed by the field number and the letter option (if any)
        Returns:
        the static value of FieldNN.NAME
      • typesPattern

        public abstract java.lang.String typesPattern()
        Returns the field component types pattern

        This method returns a letter representing the type for each component in the Field. It supersedes the Components Pattern because it distinguishes between N (Number) and I (BigDecimal).

        Specified by:
        typesPattern in interface PatternContainer
      • validatorPattern

        public abstract java.lang.String validatorPattern()
        Returns the field's validator pattern
        Since:
        7.8
      • isOptional

        public abstract boolean isOptional​(int component)
      • isGeneric

        public abstract boolean isGeneric()
      • letterOption

        public java.lang.Character letterOption()
        Return the letter option of this field as given by it classname or null if this field has no letter option
      • isLetterOption

        public boolean isLetterOption​(char c)
        Tell if this field is of a given letter option. letter is case sensitive
      • isNameAnyOf

        public boolean isNameAnyOf​(java.lang.String... names)
        Compares the this fields's name with a list of names to check
        Parameters:
        names - must not be null nor empty
        Returns:
        true if this field names equals one in the list of names and false otherwise
        Throws:
        java.lang.IllegalArgumentException - if names is null or empty
      • is

        public boolean is​(java.lang.String compare)
        Compares this field component 1 with the parameter value
        Same as is(1, compare)
        If the field has only one component this is the same as comparing against field value
        Parameters:
        compare - string to compare
        Returns:
        true if the first component is equal to the parameter
      • is

        public boolean is​(int componentNumber,
                          java.lang.String compare)
        Compares a specific component with the parameter value
        Parameters:
        componentNumber - component number 1-based
        compare - string to compare
        Returns:
        true if the indicated component value is equal to the parameter
      • is

        public boolean is​(java.lang.String compare1,
                          java.lang.String compare2)
        Compares this field components 1 and 2 with the parameter values.
        Parameters:
        compare1 - string to compare with component 1
        compare2 - string to compare with component 2
        Returns:
        true if components 1 and 2 are equal the parameter values respectively
      • is

        public boolean is​(java.lang.String... values)
        Compares this field component 1 with the parameter values.
        If the field has only one component this is the same as comparing against the field value
        Parameters:
        values - the values to compare
        Returns:
        true if the first component is equal to any of the given values
        Since:
        7.9.7
      • asTag

        public Tag asTag()
        Get the generic tag object of this field.
      • componentsSize

        public abstract int componentsSize()
        Returns the defined amount of components.
        This is not the amount of components present in the field instance, but the total amount of components that this field accepts as defined.
      • getLine

        protected java.lang.String getLine​(Field cp,
                                           java.lang.Integer start,
                                           java.lang.Integer end,
                                           int offset)
        Base implementation for subclasses getLine API.

        Notice that line instance numbers are static and relevant to the field components definition, and not relative to the particular instance value. For example field 35B Line[1] will be the line with the ISIN number, regardless of the ISIN number present or not in the particular field instance. If that ISIN line is not present in the parameter field, the method will return null.

        Also notice that a line may be composed by several components, there is no linear relation between component numbers and lines numbers.

        Parameters:
        cp - a copy of the subclass (this object is altered during method execution)
        start - a reference to a specific line in the field, first line being 1; if null returns all found lines.
        end - a reference to a specific line in the field, first line being 1; if null returns all found lines.
        offset - an optional component number used as offset when counting lines
        Returns:
        found line content or null
      • getComponentLabels

        public abstract java.util.List<java.lang.String> getComponentLabels()
        Returns english label for components.
        The index in the list is in sync with specific field component structure.
        Since:
        7.8.4
        See Also:
        getComponentLabel(int)
      • getComponentLabel

        public java.lang.String getComponentLabel​(java.lang.String componentName)
        Returns english label for the component.
        Parameters:
        componentName - name of the component to get
        Returns:
        found label or null if it is not defined
        Since:
        9.3.12
      • getComponentLabel

        public java.lang.String getComponentLabel​(int number)
        Returns english label for the component.
        Parameters:
        number - one-based index of component, first component of a field should be number one
        Returns:
        found label or null if it is not defined
        Since:
        7.8.4
      • getComponentMap

        protected abstract java.util.Map<java.lang.Integer,​java.lang.String> getComponentMap()
        Returns a mapping between component numbers and their label in camel case format.
        Since:
        7.10.3
      • getLabelMap

        protected abstract java.util.Map<java.lang.String,​java.lang.Integer> getLabelMap()
        Returns a mapping between component labels and the internal component number. Component labels are in lowercase and without spaces and separators. If a for a given component there is more than one label option, both are mapped to the same component number.
        Since:
        9.3.12
      • notNull

        protected final java.util.Locale notNull​(java.util.Locale locale)
        Ensures a not-null locale parameter.
        Parameters:
        locale - a locale or null
        Returns:
        the parameter locale if it is not null or the default locale
        Since:
        7.8.8
      • append

        protected void append​(java.lang.StringBuilder result,
                              int component)
        Appends a not null field component to the builder.
        This helper method is used by subclasses implementation of getValue()
        Parameters:
        result - string where component content is appended
        component - component number
        Since:
        7.9.3
      • toJson

        public java.lang.String toJson()
        Get a json representation of this message with expanded fields content.

        The JSON representation for fields contains the field name and the components with camel case labels, for example:

        {"name":"32A","date":"010203","currency":"USD","amount":"123"}
        Specified by:
        toJson in interface JsonSerializable
        Returns:
        the message content as JSON
        Since:
        7.10.3