Class SMSSubmit.ValidityPeriod.EnhancedValidityPeriod.EnhancedDuration

  • All Implemented Interfaces:
    DataObject, Serializable
    Enclosing class:
    SMSSubmit.ValidityPeriod.EnhancedValidityPeriod

    public static final class SMSSubmit.ValidityPeriod.EnhancedValidityPeriod.EnhancedDuration
    extends AbstractLazyEncodedByteArray
    Representation of an EnhancedDuration. Contains data to be incorporated into a SMSSubmit.ValidityPeriod.EnhancedValidityPeriod; it does not get transmitted on a network as is.

    The API offered by this class is as if the type were specified in ASN.1 as follows.

     EnhancedDuration ::= SEQUENCE {
         length  INTEGER OPTIONAL,
         hours   INTEGER OPTIONAL,
         minutes INTEGER OPTIONAL,
         seconds INTEGER OPTIONAL
     }
    The class takes care of encoding the field values into a byte-array and decoding field values from a byte-array, the encoded representation being as tabulated below.

    Data Encoding - based on 3GPP TS 23.040 V9.0.0 (2009-06) §9.2.3.12.3 pp68-69
    76543210
    1 octetReserved (0)Enhanced validity period format discriminates...
    Either1 octetLength
    5 octetsSpare (0)
    or1 octetSeconds
    5 octetsSpare (0)
    or1 octetHours unitsHours tens
    1 octetMinutes unitsMinutes tens
    1 octetSeconds unitsSeconds tens
    3 octetsSpare (0)

    The Enhanced Validity Period Format is a discriminant for how the following octets are decoded. On encoding, the discriminant is automatically set according to which alternative is encoded.
    See Also:
    Serialized Form
    • Constructor Detail

      • EnhancedDuration

        public EnhancedDuration()
        Constructs a new EnhancedDuration object with no fields set.
      • EnhancedDuration

        public EnhancedDuration​(byte[] data)
        Constructs a new EnhancedDuration object from network-encoded data. The data is not decoded and might not be decodable.
        Parameters:
        data - network-encoded data
        Throws:
        NullPointerException - if data is null
      • EnhancedDuration

        public EnhancedDuration​(byte[] data,
                                int start,
                                int len)
        Constructs a new EnhancedDuration object from part of network-encoded data. The part starts at index start and is len bytes long. The data is not decoded and might not be decodable.
        Parameters:
        data - network-encoded data
        start - starting offset of network-encoded data in byte array
        len - default length if not predictable
        Throws:
        NullPointerException - if data is null
        IllegalArgumentException - if len is negative
      • EnhancedDuration

        public EnhancedDuration​(DataInput in)
                         throws IOException
        Constructs a new EnhancedDuration object from data deserialized from a stream that was written by toStream(DataOutput).
        Parameters:
        in - the stream to read from
        Throws:
        EOFException - if reading is pre-empted by end-of-file
        IOException - if the data cannot be read
      • EnhancedDuration

        public EnhancedDuration​(int length)
        Constructs a new EnhancedDuration object from the given arguments.
        Parameters:
        length - length of relative validity period
      • EnhancedDuration

        public EnhancedDuration​(int hours,
                                int minutes,
                                int seconds)
        Constructs a new EnhancedDuration object from the given arguments.
        Parameters:
        hours - hours part of relative validity period
        minutes - minutes part of relative validity period
        seconds - seconds part of relative validity period