Class CAPIPSSPCapabilities

  • All Implemented Interfaces:
    DataObject, FastSerializable, Serializable

    public final class CAPIPSSPCapabilities
    extends AbstractLazyEncodedByteArray
    implements FastSerializable
    Class CAPIPSSPCapabilities represents the specialised resource functions (SRFs) available using CAP on a service switching point (SSP). It represents the ASN.1 OCTET STRING type CAP-datatypes.IPSSPCapabilities.

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

     CAPIPSSPCapabilities ::= SEQUENCE {
         iPRoutingAddressSupported          BOOLEAN,
         voiceBackSupported                 BOOLEAN,
         voiceInformationViaSpeechSupported BOOLEAN,
         voiceInformationViaVoiceSupported  BOOLEAN,
         voiceGenerationFromTextSupported   BOOLEAN,
         bilateralPart                      OCTET STRING (SIZE (3)) 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 comment in ASN.1 module CAP-datatypes
    87654321
    Octet 10ReservedReservedGeneration of voice announcements from text supported?VoiceInformation supported via voice recognition?VoiceInformation supported via speech recognition?VoiceBack supported?IPRoutingAddress supported?
    0 to 3 octetsBilateral part: network operator / equipment vendor specific

    In the above table, the octet numbering is that used in the cited comment, and field names ending in ? are booleans: 1 for true, 0 for false.
    See Also:
    Serialized Form
    • Constructor Detail

      • CAPIPSSPCapabilities

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

        public CAPIPSSPCapabilities​(byte[] data)
        Constructs a new CAPIPSSPCapabilities 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
      • CAPIPSSPCapabilities

        public CAPIPSSPCapabilities​(byte[] data,
                                    int start,
                                    int len)
        Constructs a new CAPIPSSPCapabilities 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
      • CAPIPSSPCapabilities

        public CAPIPSSPCapabilities​(DataInput in)
                             throws IOException
        Constructs a new CAPIPSSPCapabilities 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
    • Method Detail

      • hasIPRoutingAddressSupported

        public boolean hasIPRoutingAddressSupported()
                                             throws DecodeException
        Tests whether the field IPRoutingAddressSupported has a value.
        Returns:
        whether the field has a value
        Throws:
        DecodeException - if encoded state cannot be decoded
      • setIPRoutingAddressSupportedPresent

        public CAPIPSSPCapabilities setIPRoutingAddressSupportedPresent​(boolean flag)
                                                                 throws IllegalStateException
        Sets the presence or absence of the field IPRoutingAddressSupported.
        Parameters:
        flag - whether the field should be marked as present
        Returns:
        this
        Throws:
        IllegalStateException - if this instance has been marked as read-only
      • hasVoiceBackSupported

        public boolean hasVoiceBackSupported()
                                      throws DecodeException
        Tests whether the field VoiceBackSupported has a value.
        Returns:
        whether the field has a value
        Throws:
        DecodeException - if encoded state cannot be decoded
      • setVoiceBackSupportedPresent

        public CAPIPSSPCapabilities setVoiceBackSupportedPresent​(boolean flag)
                                                          throws IllegalStateException
        Sets the presence or absence of the field VoiceBackSupported.
        Parameters:
        flag - whether the field should be marked as present
        Returns:
        this
        Throws:
        IllegalStateException - if this instance has been marked as read-only
      • hasVoiceInformationViaSpeechSupported

        public boolean hasVoiceInformationViaSpeechSupported()
                                                      throws DecodeException
        Tests whether the field VoiceInformationViaSpeechSupported has a value.
        Returns:
        whether the field has a value
        Throws:
        DecodeException - if encoded state cannot be decoded
      • setVoiceInformationViaSpeechSupportedPresent

        public CAPIPSSPCapabilities setVoiceInformationViaSpeechSupportedPresent​(boolean flag)
                                                                          throws IllegalStateException
        Sets the presence or absence of the field VoiceInformationViaSpeechSupported.
        Parameters:
        flag - whether the field should be marked as present
        Returns:
        this
        Throws:
        IllegalStateException - if this instance has been marked as read-only
      • hasVoiceInformationViaVoiceSupported

        public boolean hasVoiceInformationViaVoiceSupported()
                                                     throws DecodeException
        Tests whether the field VoiceInformationViaVoiceSupported has a value.
        Returns:
        whether the field has a value
        Throws:
        DecodeException - if encoded state cannot be decoded
      • setVoiceInformationViaVoiceSupportedPresent

        public CAPIPSSPCapabilities setVoiceInformationViaVoiceSupportedPresent​(boolean flag)
                                                                         throws IllegalStateException
        Sets the presence or absence of the field VoiceInformationViaVoiceSupported.
        Parameters:
        flag - whether the field should be marked as present
        Returns:
        this
        Throws:
        IllegalStateException - if this instance has been marked as read-only
      • hasVoiceGenerationFromTextSupported

        public boolean hasVoiceGenerationFromTextSupported()
                                                    throws DecodeException
        Tests whether the field VoiceGenerationFromTextSupported has a value.
        Returns:
        whether the field has a value
        Throws:
        DecodeException - if encoded state cannot be decoded
      • setVoiceGenerationFromTextSupportedPresent

        public CAPIPSSPCapabilities setVoiceGenerationFromTextSupportedPresent​(boolean flag)
                                                                        throws IllegalStateException
        Sets the presence or absence of the field VoiceGenerationFromTextSupported.
        Parameters:
        flag - whether the field should be marked as present
        Returns:
        this
        Throws:
        IllegalStateException - if this instance has been marked as read-only
      • hasBilateralPart

        public boolean hasBilateralPart()
                                 throws DecodeException
        Tests whether the field BilateralPart has a value.
        Returns:
        whether the field has a value
        Throws:
        DecodeException - if encoded state cannot be decoded
      • getIPRoutingAddressSupported

        public boolean getIPRoutingAddressSupported()
                                             throws DecodeException
        Gets the value of whether IP routing address is supported.
        Returns:
        boolean representation of whether IP routing address is supported
        Throws:
        DecodeException - if encoded state cannot be decoded
      • getVoiceBackSupported

        public boolean getVoiceBackSupported()
                                      throws DecodeException
        Gets the value of whether voice back is supported.
        Returns:
        boolean representation of whether voice back is supported
        Throws:
        DecodeException - if encoded state cannot be decoded
      • getVoiceInformationViaSpeechSupported

        public boolean getVoiceInformationViaSpeechSupported()
                                                      throws DecodeException
        Gets the value of whether voice information via speech is supported.
        Returns:
        boolean representation of whether voice information via speech is supported
        Throws:
        DecodeException - if encoded state cannot be decoded
      • getVoiceInformationViaVoiceSupported

        public boolean getVoiceInformationViaVoiceSupported()
                                                     throws DecodeException
        Gets the value of whether voice information via voice is supported.
        Returns:
        boolean representation of whether voice information via voice is supported
        Throws:
        DecodeException - if encoded state cannot be decoded
      • getVoiceGenerationFromTextSupported

        public boolean getVoiceGenerationFromTextSupported()
                                                    throws DecodeException
        Gets the value of whether voice generation from text is supported.
        Returns:
        boolean representation of whether voice generation from text is supported
        Throws:
        DecodeException - if encoded state cannot be decoded
      • getBilateralPart

        public byte[] getBilateralPart()
                                throws DecodeException
        Gets the value of the bilateral part.
        Returns:
        byte[] representation of the bilateral part
        Throws:
        DecodeException - if encoded state cannot be decoded
      • setIPRoutingAddressSupported

        public CAPIPSSPCapabilities setIPRoutingAddressSupported​(boolean value)
                                                          throws IllegalStateException
        Sets the value of whether IP routing address is supported.
        Parameters:
        value - boolean representation of whether IP routing address is supported
        Returns:
        this
        Throws:
        IllegalStateException
      • setVoiceInformationViaSpeechSupported

        public CAPIPSSPCapabilities setVoiceInformationViaSpeechSupported​(boolean value)
                                                                   throws IllegalStateException
        Sets the value of whether voice information via speech is supported.
        Parameters:
        value - boolean representation of whether voice information via speech is supported
        Returns:
        this
        Throws:
        IllegalStateException
      • setVoiceInformationViaVoiceSupported

        public CAPIPSSPCapabilities setVoiceInformationViaVoiceSupported​(boolean value)
                                                                  throws IllegalStateException
        Sets the value of whether voice information via voice is supported.
        Parameters:
        value - boolean representation of whether voice information via voice is supported
        Returns:
        this
        Throws:
        IllegalStateException
      • setVoiceGenerationFromTextSupported

        public CAPIPSSPCapabilities setVoiceGenerationFromTextSupported​(boolean value)
                                                                 throws IllegalStateException
        Sets the value of whether voice generation from text is supported.
        Parameters:
        value - boolean representation of whether voice generation from text is supported
        Returns:
        this
        Throws:
        IllegalStateException
      • copyOf

        public static CAPIPSSPCapabilities copyOf​(CAPIPSSPCapabilities from)
        Creates a new object of this type, cloning the values of common fields from the given object of any subclass of the same base type.
        Parameters:
        from - the object from which to copy
        Returns:
        CAPIPSSPCapabilities
      • getFieldAccessors

        public static FieldAccessor[] getFieldAccessors()
        Gets a new array of the accessors for fields of this type.
        Returns:
        FieldAccessor[]
      • getFieldsMap

        public Map<String,​Object> getFieldsMap​(boolean withAbsents)
        Gets a Map from field-name to field-value for the fields of a sequence. For a field of primitive type, the field-value is boxed. For an absent optional field, the field-value is AbstractFieldsObject.FIELD_ABSENT. For an uninitialised mandatory field, the field-value is AbstractFieldsObject.FIELD_UNINITIALISED. For a field of String type, the encoded form is used if the String cannot be decoded. For a type that represents an OCTET STRING that cannot be decoded, a map from "encodedValue" to the byte array value is returned.
        Specified by:
        getFieldsMap in class AbstractFieldsObject
        Parameters:
        withAbsents - whether to put absent optional fields into Map
        Returns:
        Map from field-name to field-value
      • encodedIsInvalid

        protected boolean encodedIsInvalid()
        Determines whether the encoded form is invalid.
        Returns:
        boolean
      • getEncodedForm

        public byte[] getEncodedForm()
                              throws EncodeException
        Gets the encoded form.
        Returns:
        encoded form
        Throws:
        EncodeException - if encoding fails