Class BearerCapability.ITU_T.Layer1Capability.Details.UnrestrictedDigital
- java.lang.Object
-
- com.opencloud.util.AbstractDataObject
-
- com.opencloud.util.AbstractFieldsObject
-
- AbstractEncodedDataObject<T>
-
- AbstractLazyEncodedDataObject<T>
-
- AbstractLazyEncodedNamedInteger<BearerCapability.ITU_T.Layer1Capability.Details.UnrestrictedDigital.EncodedValue>
-
- com.opencloud.slee.resources.in.datatypes.cc.BearerCapability.ITU_T.Layer1Capability.Details.UnrestrictedDigital
-
- All Implemented Interfaces:
DataObject
,Serializable
- Enclosing class:
- BearerCapability.ITU_T.Layer1Capability.Details
public static final class BearerCapability.ITU_T.Layer1Capability.Details.UnrestrictedDigital extends AbstractLazyEncodedNamedInteger<BearerCapability.ITU_T.Layer1Capability.Details.UnrestrictedDigital.EncodedValue>
Class UnrestrictedDigital represents data that is relevant when TransferCapability is UNRESTRICTED_DIGITAL and Layer1Protocol is V120 or V110 or I460 or X30. It represents part of a larger octet string; it is not transmitted on a network by itself.The API offered by this class is as if the type were specified in ASN.1 as follows.
UnrestrictedDigital ::= CHOICE { v110 V110, v120 V120 }
The class takes care of encoding the field values into a NamedInteger and decoding field values from a NamedInteger, the encoded representation being as tabulated below.Data Encoding - based on ITU-T Q.931 (05/98) §4.5.5 p58 8 7 6 5 4 3 2 1 Octet 5b* ext. 0/1 Intermediate rate NIC on Tx NIC on Rx Flow control on Tx Flow control on Rx Discriminant (0) Octet 5b* ext. 0/1 Intermediate rate NIC on Tx NIC on Rx Flow control on Tx Flow control on Rx Discriminant (1)
The octet numbering in the above table is that used in the cited standard for the octets encoded here.- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
BearerCapability.ITU_T.Layer1Capability.Details.UnrestrictedDigital.Choice
Enumeration of discriminating values.static class
BearerCapability.ITU_T.Layer1Capability.Details.UnrestrictedDigital.EncodedValue
Representation of UnrestrictedDigital values as NamedIntegers.static class
BearerCapability.ITU_T.Layer1Capability.Details.UnrestrictedDigital.V110
Class V110 represents data that is relevant when TransferCapability is UNRESTRICTED_DIGITAL and Layer1Protocol is V110 or I460 or X30.static class
BearerCapability.ITU_T.Layer1Capability.Details.UnrestrictedDigital.V120
Class V120 represents data that is relevant when TransferCapability is UNRESTRICTED_DIGITAL and Layer1Protocol is V120.
-
Field Summary
-
Fields inherited from class com.opencloud.slee.resources.cgin.AbstractLazyEncodedDataObject
isDecoded
-
Fields inherited from class com.opencloud.slee.resources.cgin.AbstractEncodedDataObject
encoded
-
Fields inherited from class com.opencloud.util.AbstractFieldsObject
FIELD_ABSENT, FIELD_UNINITIALISED
-
-
Constructor Summary
Constructors Constructor Description UnrestrictedDigital()
Constructs a new UnrestrictedDigital object with no fields set.UnrestrictedDigital(byte[] data)
Constructs a new UnrestrictedDigital object from network-encoded data.UnrestrictedDigital(byte[] data, int start, int len)
Constructs a new UnrestrictedDigital object from part of network-encoded data.UnrestrictedDigital(DataInput in)
Constructs a new UnrestrictedDigital object from data deserialized from a stream that was written bytoStream(DataOutput)
.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
checkFieldsSet()
Checks that all mandatory fields are present.BearerCapability.ITU_T.Layer1Capability.Details.UnrestrictedDigital
clone()
Constructs a copy of this object and everything reachable from it.static BearerCapability.ITU_T.Layer1Capability.Details.UnrestrictedDigital
copyOf(BearerCapability.ITU_T.Layer1Capability.Details.UnrestrictedDigital 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.protected void
decode()
Computes the decoded form from the encoded form.protected void
encode()
Computes the encoded form from the decoded form.protected boolean
encodedIsInvalid()
Determines whether the encoded form is invalid.protected BearerCapability.ITU_T.Layer1Capability.Details.UnrestrictedDigital.EncodedValue
fromValue(int value)
Converts an int to a NamedInteger.byte[]
getByteArrayForm()
Gets the byte array encoded form.BearerCapability.ITU_T.Layer1Capability.Details.UnrestrictedDigital.Choice
getChoice()
Gets the discriminant for which choice is chosen.BearerCapability.ITU_T.Layer1Capability.Details.UnrestrictedDigital.EncodedValue
getEncodedForm()
Gets the encoded form.static FieldAccessor[]
getFieldAccessors()
Gets a new array of the accessors for fields of this type.Map<String,Object>
getFieldsMap(boolean withAbsents)
Gets a Map from :discriminant-name to field-value.BearerCapability.ITU_T.Layer1Capability.Details.UnrestrictedDigital.V110
getV110()
Gets the value of data relevant when TransferCapability is UNRESTRICTED_DIGITAL and Layer1Protocol is V110 or I460 or X30.BearerCapability.ITU_T.Layer1Capability.Details.UnrestrictedDigital.V120
getV120()
Gets the value of data relevant when TransferCapability is UNRESTRICTED_DIGITAL and Layer1Protocol is V120.boolean
isV110Chosen()
Tests whether the choice is v110.boolean
isV120Chosen()
Tests whether the choice is v120.void
setReadOnly()
Sets this and all its fields to be immutable.BearerCapability.ITU_T.Layer1Capability.Details.UnrestrictedDigital
setV110(BearerCapability.ITU_T.Layer1Capability.Details.UnrestrictedDigital.V110 value)
Sets the value of data relevant when TransferCapability is UNRESTRICTED_DIGITAL and Layer1Protocol is V110 or I460 or X30.BearerCapability.ITU_T.Layer1Capability.Details.UnrestrictedDigital
setV120(BearerCapability.ITU_T.Layer1Capability.Details.UnrestrictedDigital.V120 value)
Sets the value of data relevant when TransferCapability is UNRESTRICTED_DIGITAL and Layer1Protocol is V120.void
toStream(DataOutput out)
Serializes this object to a stream in a form suitable for reading by {@link #BearerCapability.ITU_T.Layer1Capability.Details.UnrestrictedDigital(DataInput)}.-
Methods inherited from class com.opencloud.slee.resources.cgin.AbstractLazyEncodedDataObject
checkDecode, checkModifyAndDecode
-
Methods inherited from class com.opencloud.util.AbstractFieldsObject
equals, hashCode, toString
-
Methods inherited from class com.opencloud.util.AbstractDataObject
checkModify, isReadOnly
-
-
-
-
Constructor Detail
-
UnrestrictedDigital
public UnrestrictedDigital()
Constructs a new UnrestrictedDigital object with no fields set.
-
UnrestrictedDigital
public UnrestrictedDigital(byte[] data)
Constructs a new UnrestrictedDigital 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
-
UnrestrictedDigital
public UnrestrictedDigital(byte[] data, int start, int len)
Constructs a new UnrestrictedDigital object from part of network-encoded data. The part starts at indexstart
and islen
bytes long. The data is not decoded and might not be decodable.- Parameters:
data
- network-encoded datastart
- starting offset of network-encoded data in byte arraylen
- default length if not predictable- Throws:
NullPointerException
- if data is nullIllegalArgumentException
- if len is negative
-
UnrestrictedDigital
public UnrestrictedDigital(DataInput in) throws IOException
Constructs a new UnrestrictedDigital object from data deserialized from a stream that was written bytoStream(DataOutput)
.- Parameters:
in
- the stream to read from- Throws:
EOFException
- if reading is pre-empted by end-of-fileIOException
- if the data cannot be read
-
-
Method Detail
-
toStream
public void toStream(DataOutput out) throws IOException
Serializes this object to a stream in a form suitable for reading by {@link #BearerCapability.ITU_T.Layer1Capability.Details.UnrestrictedDigital(DataInput)}.- Parameters:
out
- the stream to write to- Throws:
IOException
- if an I/O error occurs
-
getChoice
public BearerCapability.ITU_T.Layer1Capability.Details.UnrestrictedDigital.Choice getChoice() throws DecodeException
Gets the discriminant for which choice is chosen.- Returns:
- enumerated constant
- Throws:
DecodeException
- if encoded state cannot be decoded
-
isV110Chosen
public boolean isV110Chosen() throws DecodeException
Tests whether the choice is v110.- Returns:
- true if chosen, false if not
- Throws:
DecodeException
- if encoded state cannot be decoded
-
isV120Chosen
public boolean isV120Chosen() throws DecodeException
Tests whether the choice is v120.- Returns:
- true if chosen, false if not
- Throws:
DecodeException
- if encoded state cannot be decoded
-
checkFieldsSet
public void checkFieldsSet() throws EncodeException
Checks that all mandatory fields are present. Should be called immediately before all calls to encode().- Specified by:
checkFieldsSet
in classAbstractLazyEncodedDataObject<BearerCapability.ITU_T.Layer1Capability.Details.UnrestrictedDigital.EncodedValue>
- Throws:
EncodeException
- if any mandatory field is not present
-
getV110
public BearerCapability.ITU_T.Layer1Capability.Details.UnrestrictedDigital.V110 getV110() throws DecodeException
Gets the value of data relevant when TransferCapability is UNRESTRICTED_DIGITAL and Layer1Protocol is V110 or I460 or X30.- Returns:
- V110 representation of data relevant when TransferCapability is UNRESTRICTED_DIGITAL and Layer1Protocol is V110 or I460 or X30, if choice is data relevant when TransferCapability is UNRESTRICTED_DIGITAL and Layer1Protocol is V110 or I460 or X30, else null
- Throws:
DecodeException
- if encoded state cannot be decoded
-
getV120
public BearerCapability.ITU_T.Layer1Capability.Details.UnrestrictedDigital.V120 getV120() throws DecodeException
Gets the value of data relevant when TransferCapability is UNRESTRICTED_DIGITAL and Layer1Protocol is V120.- Returns:
- V120 representation of data relevant when TransferCapability is UNRESTRICTED_DIGITAL and Layer1Protocol is V120, if choice is data relevant when TransferCapability is UNRESTRICTED_DIGITAL and Layer1Protocol is V120, else null
- Throws:
DecodeException
- if encoded state cannot be decoded
-
setV110
public BearerCapability.ITU_T.Layer1Capability.Details.UnrestrictedDigital setV110(BearerCapability.ITU_T.Layer1Capability.Details.UnrestrictedDigital.V110 value) throws IllegalStateException
Sets the value of data relevant when TransferCapability is UNRESTRICTED_DIGITAL and Layer1Protocol is V110 or I460 or X30.- Parameters:
value
- V110 representation of data relevant when TransferCapability is UNRESTRICTED_DIGITAL and Layer1Protocol is V110 or I460 or X30- Returns:
- this
- Throws:
IllegalStateException
-
setV120
public BearerCapability.ITU_T.Layer1Capability.Details.UnrestrictedDigital setV120(BearerCapability.ITU_T.Layer1Capability.Details.UnrestrictedDigital.V120 value) throws IllegalStateException
Sets the value of data relevant when TransferCapability is UNRESTRICTED_DIGITAL and Layer1Protocol is V120.- Parameters:
value
- V120 representation of data relevant when TransferCapability is UNRESTRICTED_DIGITAL and Layer1Protocol is V120- Returns:
- this
- Throws:
IllegalStateException
-
copyOf
public static BearerCapability.ITU_T.Layer1Capability.Details.UnrestrictedDigital copyOf(BearerCapability.ITU_T.Layer1Capability.Details.UnrestrictedDigital 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:
- UnrestrictedDigital
-
clone
public BearerCapability.ITU_T.Layer1Capability.Details.UnrestrictedDigital clone()
Constructs a copy of this object and everything reachable from it.- Specified by:
clone
in interfaceDataObject
- Specified by:
clone
in classAbstractDataObject
- Returns:
- copy of object
-
setReadOnly
public void setReadOnly()
Sets this and all its fields to be immutable.- Specified by:
setReadOnly
in interfaceDataObject
- Overrides:
setReadOnly
in classAbstractDataObject
-
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 :discriminant-name to field-value. If choice is not set, returns a Map from : to AbstractFieldsObject.FIELD_UNINITIALISED. For a field of primitive type, the field-value is boxed. 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 classAbstractFieldsObject
- Parameters:
withAbsents
- the value of this parameter is ignored- Returns:
- Map from :discriminant-name to field-value
-
encodedIsInvalid
protected boolean encodedIsInvalid()
Determines whether the encoded form is invalid.- Returns:
- boolean
-
getEncodedForm
public BearerCapability.ITU_T.Layer1Capability.Details.UnrestrictedDigital.EncodedValue getEncodedForm() throws EncodeException
Gets the encoded form.- Returns:
- encoded form
- Throws:
EncodeException
- if encoding fails
-
getByteArrayForm
public byte[] getByteArrayForm() throws EncodeException
Gets the byte array encoded form. The size of the array is the least of 1, 2, 4, or 8 according to the type's bounds. The most significant byte of the numeric value is in the lowest indexed byte of the array.- Returns:
- byte array form
- Throws:
EncodeException
- if encoding fails
-
fromValue
protected BearerCapability.ITU_T.Layer1Capability.Details.UnrestrictedDigital.EncodedValue fromValue(int value)
Converts an int to a NamedInteger. Reuses any existing instance where possible.- Specified by:
fromValue
in classAbstractLazyEncodedNamedInteger<BearerCapability.ITU_T.Layer1Capability.Details.UnrestrictedDigital.EncodedValue>
- Parameters:
value
- int- Returns:
- NamedInteger
-
encode
protected void encode() throws EncodeException
Computes the encoded form from the decoded form.- Specified by:
encode
in classAbstractLazyEncodedDataObject<BearerCapability.ITU_T.Layer1Capability.Details.UnrestrictedDigital.EncodedValue>
- Throws:
EncodeException
- if address cannot be encoded
-
decode
protected void decode()
Computes the decoded form from the encoded form.
-
-