Class CharArraySection

    • Constructor Detail

      • CharArraySection

        public CharArraySection​(TransmissionMetrics aTransmissionMetrics)
        Constructs an according instance from the given configuration. The configuration attributes are taken from the TransmissionMetrics configuration object, though only those attributes are supported which are also supported by the other constructors!
        Parameters:
        aTransmissionMetrics - The TransmissionMetrics to be used for configuring this instance.
      • CharArraySection

        public CharArraySection​(TransmissionMetrics aTransmissionMetrics,
                                char... aValue)
        Constructs an according instance from the given configuration. The configuration attributes are taken from the TransmissionMetrics configuration object, though only those attributes are supported which are also supported by the other constructors!
        Parameters:
        aTransmissionMetrics - The TransmissionMetrics to be used for configuring this instance.
        aValue - The payload to be contained by the CharArraySection.
      • CharArraySection

        public CharArraySection​(TransmissionMetrics aTransmissionMetrics,
                                Character... aValue)
        Constructs an according instance from the given configuration. The configuration attributes are taken from the TransmissionMetrics configuration object, though only those attributes are supported which are also supported by the other constructors!
        Parameters:
        aTransmissionMetrics - The TransmissionMetrics to be used for configuring this instance.
        aValue - The payload to be contained by the CharArraySection.
      • CharArraySection

        public CharArraySection​(String aAlias,
                                TransmissionMetrics aTransmissionMetrics)
        Constructs an according instance from the given configuration. The configuration attributes are taken from the TransmissionMetrics configuration object, though only those attributes are supported which are also supported by the other constructors!
        Parameters:
        aAlias - The alias which identifies the content of this instance.
        aTransmissionMetrics - The TransmissionMetrics to be used for configuring this instance.
      • CharArraySection

        public CharArraySection​(String aAlias,
                                TransmissionMetrics aTransmissionMetrics,
                                char... aValue)
        Constructs an according instance from the given configuration. The configuration attributes are taken from the TransmissionMetrics configuration object, though only those attributes are supported which are also supported by the other constructors!
        Parameters:
        aAlias - The alias which identifies the content of this instance.
        aTransmissionMetrics - The TransmissionMetrics to be used for configuring this instance.
        aValue - The payload to be contained by the CharArraySection.
      • CharArraySection

        public CharArraySection​(String aAlias,
                                TransmissionMetrics aTransmissionMetrics,
                                Character... aValue)
        Constructs an according instance from the given configuration. The configuration attributes are taken from the TransmissionMetrics configuration object, though only those attributes are supported which are also supported by the other constructors!
        Parameters:
        aAlias - The alias which identifies the content of this instance.
        aTransmissionMetrics - The TransmissionMetrics to be used for configuring this instance.
        aValue - The payload to be contained by the CharArraySection.
      • CharArraySection

        public CharArraySection()
        Constructs an empty CharArraySection. Uses UTF-16 by default for encoding.
      • CharArraySection

        public CharArraySection​(Charset aCharset)
        Constructs an empty CharArraySection.
        Parameters:
        aCharset - The charset to be used for encoding.
      • CharArraySection

        public CharArraySection​(String aAlias)
        Constructs an empty CharArraySection. Uses UTF-16 by default for encoding.
        Parameters:
        aAlias - The alias which identifies the content of this segment.
      • CharArraySection

        public CharArraySection​(String aAlias,
                                Charset aCharset)
        Constructs an empty CharArraySection.
        Parameters:
        aAlias - The alias which identifies the content of this segment.
        aCharset - The charset to be used for encoding.
      • CharArraySection

        public CharArraySection​(String aAlias,
                                Charset aCharset,
                                char... aPayload)
        Constructs a CharArraySection with the given char array payload. Uses TransmissionMetrics.DEFAULT_ENCODING by default for encoding.
        Parameters:
        aAlias - The alias which identifies the content of this segment.
        aCharset - The charset to be used for encoding.
        aPayload - The payload to be contained by the PayloadSection.
    • Method Detail

      • withPayload

        public CharArraySection withPayload​(char[] aValue)
        Specified by:
        withPayload in interface org.refcodes.mixin.PayloadAccessor.PayloadBuilder<char[],​PayloadTransmission<char[]>>
      • getLength

        public int getLength()
        Determines the overall length of this Transmission. In case of nested Transmission instances, all length values from all sub-segments are accumulated to the result as well.
        Specified by:
        getLength in interface org.refcodes.mixin.LengthAccessor
        Specified by:
        getLength in interface Transmission
        Returns:
        The (overall) length of the Transmission (including any sub-segments).
      • getEncoding

        public Charset getEncoding()
        Specified by:
        getEncoding in interface org.refcodes.mixin.EncodingAccessor<Charset>
      • setPayload

        public void setPayload​(Character[] aPayload)
        Convenience method to convert the array of wrapper types into its counterpart with primitive types before invoking AbstractPayloadSection.setPayload(Object).
        Parameters:
        aPayload - The payload with the wrapper types.
      • withPayload

        public CharArraySection withPayload​(Character[] aPayload)
        Convenience method to convert the array of wrapper types into its counterpart with primitive types before invoking withPayload(char[]).
        Parameters:
        aPayload - The payload with the wrapper types.
        Returns:
        This instance as of the builder pattern.