Class BearerCapability.ITU_T.Layer1Capability.Details.UnrestrictedDigital.V120
- java.lang.Object
-
- com.opencloud.util.AbstractDataObject
-
- com.opencloud.util.AbstractFieldsObject
-
- AbstractEncodedDataObject<T>
-
- AbstractLazyEncodedDataObject<T>
-
- AbstractLazyEncodedNamedInteger<BearerCapability.ITU_T.Layer1Capability.Details.UnrestrictedDigital.V120.EncodedValue>
-
- com.opencloud.slee.resources.in.datatypes.cc.BearerCapability.ITU_T.Layer1Capability.Details.UnrestrictedDigital.V120
-
- All Implemented Interfaces:
DataObject
,Serializable
- Enclosing class:
- BearerCapability.ITU_T.Layer1Capability.Details.UnrestrictedDigital
public static final class BearerCapability.ITU_T.Layer1Capability.Details.UnrestrictedDigital.V120 extends AbstractLazyEncodedNamedInteger<BearerCapability.ITU_T.Layer1Capability.Details.UnrestrictedDigital.V120.EncodedValue>
Class V120 represents data that is relevant when TransferCapability is UNRESTRICTED_DIGITAL and Layer1Protocol is V120. 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.
V120 ::= SEQUENCE { rateAdaptationHeader RateAdaptationHeader, multipleFrameEstablishment MultipleFrameEstablishment, mode Mode, lLINegotiation LLINegotiation, messageOriginator MessageOriginator, negotiation Negotiation }
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 ITU-T Q.931 (05/98) §4.5.5 p58 8 7 6 5 4 3 2 1 Octet 5b 0 Rate adaptation header Multiframe Mode LLI negotiation Message originator Negotiation Spare (0)
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
-
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 V120()
Constructs a new V120 object with no fields set.V120(byte[] data)
Constructs a new V120 object from network-encoded data.V120(byte[] data, int start, int len)
Constructs a new V120 object from part of network-encoded data.V120(int arg)
Constructs a new V120 object from the given int, making it be read-only (immutable).V120(BearerCapability.ITU_T.Layer1Capability.Details.UnrestrictedDigital.V120.RateAdaptationHeader rateAdaptationHeader, BearerCapability.ITU_T.Layer1Capability.Details.UnrestrictedDigital.V120.MultipleFrameEstablishment multipleFrameEstablishment, BearerCapability.ITU_T.Layer1Capability.Details.UnrestrictedDigital.V120.Mode mode, BearerCapability.ITU_T.Layer1Capability.Details.UnrestrictedDigital.V120.LLINegotiation lLINegotiation, BearerCapability.ITU_T.Layer1Capability.Details.UnrestrictedDigital.V120.MessageOriginator messageOriginator, BearerCapability.ITU_T.Layer1Capability.Details.UnrestrictedDigital.V120.Negotiation negotiation)
Constructs a new V120 object from given values for all fields.V120(DataInput in)
Constructs a new V120 object from data deserialized from a stream that was written bytoStream(DataOutput)
.
-
Method Summary
-
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, setReadOnly
-
-
-
-
Constructor Detail
-
V120
public V120()
Constructs a new V120 object with no fields set.
-
V120
public V120(byte[] data)
Constructs a new V120 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
-
V120
public V120(byte[] data, int start, int len)
Constructs a new V120 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
-
V120
public V120(BearerCapability.ITU_T.Layer1Capability.Details.UnrestrictedDigital.V120.RateAdaptationHeader rateAdaptationHeader, BearerCapability.ITU_T.Layer1Capability.Details.UnrestrictedDigital.V120.MultipleFrameEstablishment multipleFrameEstablishment, BearerCapability.ITU_T.Layer1Capability.Details.UnrestrictedDigital.V120.Mode mode, BearerCapability.ITU_T.Layer1Capability.Details.UnrestrictedDigital.V120.LLINegotiation lLINegotiation, BearerCapability.ITU_T.Layer1Capability.Details.UnrestrictedDigital.V120.MessageOriginator messageOriginator, BearerCapability.ITU_T.Layer1Capability.Details.UnrestrictedDigital.V120.Negotiation negotiation)
Constructs a new V120 object from given values for all fields.- Parameters:
rateAdaptationHeader
- whether rate adaptation header is includedmultipleFrameEstablishment
- whether multiple frame establishment is supportedmode
- the mode of operationlLINegotiation
- the logical link identifier negotationmessageOriginator
- assignor/assigneenegotiation
- in-band/out-band negotiation
-
V120
public V120(int arg)
Constructs a new V120 object from the given int, making it be read-only (immutable).- Parameters:
arg
- int
-
V120
public V120(DataInput in) throws IOException
Constructs a new V120 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.V120(DataInput)}.- Parameters:
out
- the stream to write to- Throws:
IOException
- if an I/O error occurs
-
hasRateAdaptationHeader
public boolean hasRateAdaptationHeader() throws DecodeException
Tests whether the field RateAdaptationHeader has a value.- Returns:
- whether the field has a value
- Throws:
DecodeException
- if encoded state cannot be decoded
-
hasMultipleFrameEstablishment
public boolean hasMultipleFrameEstablishment() throws DecodeException
Tests whether the field MultipleFrameEstablishment has a value.- Returns:
- whether the field has a value
- Throws:
DecodeException
- if encoded state cannot be decoded
-
hasMode
public boolean hasMode() throws DecodeException
Tests whether the field Mode has a value.- Returns:
- whether the field has a value
- Throws:
DecodeException
- if encoded state cannot be decoded
-
hasLLINegotiation
public boolean hasLLINegotiation() throws DecodeException
Tests whether the field LLINegotiation has a value.- Returns:
- whether the field has a value
- Throws:
DecodeException
- if encoded state cannot be decoded
-
hasMessageOriginator
public boolean hasMessageOriginator() throws DecodeException
Tests whether the field MessageOriginator has a value.- Returns:
- whether the field has a value
- Throws:
DecodeException
- if encoded state cannot be decoded
-
hasNegotiation
public boolean hasNegotiation() throws DecodeException
Tests whether the field Negotiation has a value.- Returns:
- whether the field has a value
- 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.V120.EncodedValue>
- Throws:
EncodeException
- if any mandatory field is not present
-
getRateAdaptationHeader
public BearerCapability.ITU_T.Layer1Capability.Details.UnrestrictedDigital.V120.RateAdaptationHeader getRateAdaptationHeader() throws DecodeException
Gets the value of whether rate adaptation header is included.- Returns:
- RateAdaptationHeader representation of whether rate adaptation header is included
- Throws:
DecodeException
- if encoded state cannot be decoded
-
getMultipleFrameEstablishment
public BearerCapability.ITU_T.Layer1Capability.Details.UnrestrictedDigital.V120.MultipleFrameEstablishment getMultipleFrameEstablishment() throws DecodeException
Gets the value of whether multiple frame establishment is supported.- Returns:
- MultipleFrameEstablishment representation of whether multiple frame establishment is supported
- Throws:
DecodeException
- if encoded state cannot be decoded
-
getMode
public BearerCapability.ITU_T.Layer1Capability.Details.UnrestrictedDigital.V120.Mode getMode() throws DecodeException
Gets the value of the mode of operation.- Returns:
- Mode representation of the mode of operation
- Throws:
DecodeException
- if encoded state cannot be decoded
-
getLLINegotiation
public BearerCapability.ITU_T.Layer1Capability.Details.UnrestrictedDigital.V120.LLINegotiation getLLINegotiation() throws DecodeException
Gets the value of the logical link identifier negotation.- Returns:
- LLINegotiation representation of the logical link identifier negotation
- Throws:
DecodeException
- if encoded state cannot be decoded
-
getMessageOriginator
public BearerCapability.ITU_T.Layer1Capability.Details.UnrestrictedDigital.V120.MessageOriginator getMessageOriginator() throws DecodeException
Gets the value of assignor/assignee.- Returns:
- MessageOriginator representation of assignor/assignee
- Throws:
DecodeException
- if encoded state cannot be decoded
-
getNegotiation
public BearerCapability.ITU_T.Layer1Capability.Details.UnrestrictedDigital.V120.Negotiation getNegotiation() throws DecodeException
Gets the value of in-band/out-band negotiation.- Returns:
- Negotiation representation of in-band/out-band negotiation
- Throws:
DecodeException
- if encoded state cannot be decoded
-
setRateAdaptationHeader
public BearerCapability.ITU_T.Layer1Capability.Details.UnrestrictedDigital.V120 setRateAdaptationHeader(BearerCapability.ITU_T.Layer1Capability.Details.UnrestrictedDigital.V120.RateAdaptationHeader value) throws IllegalStateException
Sets the value of whether rate adaptation header is included.- Parameters:
value
- RateAdaptationHeader representation of whether rate adaptation header is included- Returns:
- this
- Throws:
IllegalStateException
-
setMultipleFrameEstablishment
public BearerCapability.ITU_T.Layer1Capability.Details.UnrestrictedDigital.V120 setMultipleFrameEstablishment(BearerCapability.ITU_T.Layer1Capability.Details.UnrestrictedDigital.V120.MultipleFrameEstablishment value) throws IllegalStateException
Sets the value of whether multiple frame establishment is supported.- Parameters:
value
- MultipleFrameEstablishment representation of whether multiple frame establishment is supported- Returns:
- this
- Throws:
IllegalStateException
-
setMode
public BearerCapability.ITU_T.Layer1Capability.Details.UnrestrictedDigital.V120 setMode(BearerCapability.ITU_T.Layer1Capability.Details.UnrestrictedDigital.V120.Mode value) throws IllegalStateException
Sets the value of the mode of operation.- Parameters:
value
- Mode representation of the mode of operation- Returns:
- this
- Throws:
IllegalStateException
-
setLLINegotiation
public BearerCapability.ITU_T.Layer1Capability.Details.UnrestrictedDigital.V120 setLLINegotiation(BearerCapability.ITU_T.Layer1Capability.Details.UnrestrictedDigital.V120.LLINegotiation value) throws IllegalStateException
Sets the value of the logical link identifier negotation.- Parameters:
value
- LLINegotiation representation of the logical link identifier negotation- Returns:
- this
- Throws:
IllegalStateException
-
setMessageOriginator
public BearerCapability.ITU_T.Layer1Capability.Details.UnrestrictedDigital.V120 setMessageOriginator(BearerCapability.ITU_T.Layer1Capability.Details.UnrestrictedDigital.V120.MessageOriginator value) throws IllegalStateException
Sets the value of assignor/assignee.- Parameters:
value
- MessageOriginator representation of assignor/assignee- Returns:
- this
- Throws:
IllegalStateException
-
setNegotiation
public BearerCapability.ITU_T.Layer1Capability.Details.UnrestrictedDigital.V120 setNegotiation(BearerCapability.ITU_T.Layer1Capability.Details.UnrestrictedDigital.V120.Negotiation value) throws IllegalStateException
Sets the value of in-band/out-band negotiation.- Parameters:
value
- Negotiation representation of in-band/out-band negotiation- Returns:
- this
- Throws:
IllegalStateException
-
copyOf
public static BearerCapability.ITU_T.Layer1Capability.Details.UnrestrictedDigital.V120 copyOf(BearerCapability.ITU_T.Layer1Capability.Details.UnrestrictedDigital.V120 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:
- V120
-
clone
public BearerCapability.ITU_T.Layer1Capability.Details.UnrestrictedDigital.V120 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
-
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 classAbstractFieldsObject
- 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 BearerCapability.ITU_T.Layer1Capability.Details.UnrestrictedDigital.V120.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.V120.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.V120.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.V120.EncodedValue>
- Throws:
EncodeException
- if encoding fails
-
decode
protected void decode() throws DecodeException
Computes the decoded form from the encoded form.- Specified by:
decode
in classAbstractLazyEncodedDataObject<BearerCapability.ITU_T.Layer1Capability.Details.UnrestrictedDigital.V120.EncodedValue>
- Throws:
DecodeException
- if decoding fails
-
-