Class SMSReserved

    • Constructor Detail

      • SMSReserved

        public SMSReserved​(byte[] message)
        Wrap an arbitrary SMS TPDU in an immutable SMSReserved instance. The encoded data is not decoded at all.
        Parameters:
        message - a bytearray containing the encoded PDU
        Throws:
        NullPointerException - if message is null
      • SMSReserved

        public SMSReserved​(byte[] message,
                           int start,
                           int len)
        Wrap an arbitrary SMS TPDU in an immutable SMSReserved instance. The encoded data is not decoded at all.
        Parameters:
        message - a bytearray containing the encoded PDU
        start - the offset within 'message' to begin decoding
        len - the number of valid bytes after 'offset' to decode (must be at least 1)
        Throws:
        NullPointerException - if message is null
        IllegalArgumentException - if start or len are out of range
    • Method Detail

      • getType

        public SMSTPDU.Type getType()
        Description copied from class: SMSTPDU
        Return the message type of this PDU
        Specified by:
        getType in class SMSTPDU
        Returns:
        the type
      • clone

        public SMSReserved clone()
        Description copied from interface: DataObject
        Perform a deep copy of this object. Read-only state of the object is not copied; the new object will be read-write by default.

        Inherently immutable objects may optionally return the same object without modification from clone(), rather than constructing a new instance.

        Specified by:
        clone in interface DataObject
        Specified by:
        clone in class AbstractDataObject
        Returns:
        a new object that is a deep copy of this object; for immutable objects, the same object may optionally be returned.
      • setReadOnly

        public void setReadOnly()
        Description copied from interface: DataObject
        Set this object to be "read-only". Any subsequent attempt to modify this object will throw IllegalStateException. Once an object has been made read-only, it cannot be later set to read-write - this is a "one-way" operation.

        Note that a read-only object is not necessarily immutable; if reference types are returned from accessors, then callers could theoretically mutate those objects even if the top-level object is marked as read-only. The ability to make objects read-only is intended to catch programming errors (e.g. attempting to modify a data object passed as part of a SLEE event), not to provide an absolute guarantee of immutability.

        Calling setReadOnly() on an object that is already read-only is a no-op.

        Some DataObject implementations may be inherently immutable. In those cases, they are considered always read-only.

        Specified by:
        setReadOnly in interface DataObject
        Overrides:
        setReadOnly in class AbstractDataObject
      • getEncodedForm

        public byte[] getEncodedForm()
        Description copied from class: SMSTPDU
        Encode this message to the network form. If the message is already encoded, the existing encoding is reused.
        Specified by:
        getEncodedForm in class SMSTPDU
        Returns:
        a bytearray containing the encoded form
      • getFieldsMap

        public Map<String,​Object> getFieldsMap​(boolean withAbsents)
        Description copied from class: AbstractFieldsObject
        Gets a Map from field-name to field-value for all fields defined by the concrete subclass of AbstractFieldsObject in use. A CHOICE should be distinguished from a SEQUENCE by the sole name/value pair having the character : prefixed on its name.

        For a field of primitive type, the field-value should be boxed.

        If withAbsents == true, then absent optional fields should also be included with a field-value of AbstractFieldsObject.FIELD_ABSENT. Otherwise, absent fields should be omitted from the map entirely.

        Uninitialised mandatory fields should be included with a field-value of AbstractFieldsObject.FIELD_UNINITIALISED. This includes an uninitialised choice.

        Specified by:
        getFieldsMap in class AbstractFieldsObject
        Parameters:
        withAbsents - whether to put absent optional fields into Map
        Returns:
        Map from field-name to field-value
      • getContainedLength

        public static int getContainedLength​(byte[] data,
                                             int start,
                                             int len)
      • encode

        protected void encode()
        Description copied from class: AbstractLazyEncodedDataObject
        Computes the encoded form of the state from the decoded form. Should check that individual field values are within appropriate ranges, and different fields have mutually consistent values, but needn't repeat the checks done by checkFieldsSet(). The computed encoded form should equal that from which the decoded form could have been calculated using decode(), i.e. encode o decode = id.
        Specified by:
        encode in class AbstractLazyEncodedDataObject<byte[]>
      • decode

        protected void decode()
        Description copied from class: AbstractLazyEncodedDataObject
        Computes the decoded form of the state from the encoded form. The computed decoded form should equal that from which the encoded form could have been calculated using encode(), i.e. decode o encode = id. If a field cannot be decoded without further information, such as a DigitCodec to be used for decoding a digit string, then the encoded form of that field should be copied and kept for decoding by that field's getter, which will be given the further information. The caller should set isDecoded to true.
        Specified by:
        decode in class AbstractLazyEncodedDataObject<byte[]>