Class BearerCapability.ITU_T.Layer1Capability.Details.UnrestrictedDigital.V110
- java.lang.Object
-
- com.opencloud.util.AbstractDataObject
-
- com.opencloud.util.AbstractFieldsObject
-
- AbstractEncodedDataObject<T>
-
- AbstractLazyEncodedDataObject<T>
-
- AbstractLazyEncodedNamedInteger<BearerCapability.ITU_T.Layer1Capability.Details.UnrestrictedDigital.V110.EncodedValue>
-
- com.opencloud.slee.resources.in.datatypes.cc.BearerCapability.ITU_T.Layer1Capability.Details.UnrestrictedDigital.V110
-
- All Implemented Interfaces:
DataObject
,Serializable
- Enclosing class:
- BearerCapability.ITU_T.Layer1Capability.Details.UnrestrictedDigital
public static final class BearerCapability.ITU_T.Layer1Capability.Details.UnrestrictedDigital.V110 extends AbstractLazyEncodedNamedInteger<BearerCapability.ITU_T.Layer1Capability.Details.UnrestrictedDigital.V110.EncodedValue>
Class V110 represents data that is relevant when TransferCapability is UNRESTRICTED_DIGITAL and Layer1Protocol is V110 or I460 or X30. It is also used where the Layer1Protocol is not V120 and octet 5b has been supplied. 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.
V110 ::= SEQUENCE { intermediateRate IntermediateRate, networkIndependentClockOnTransmit NetworkIndependentClockOnTransmit, networkIndependentClockOnReceive NetworkIndependentClockOnReceive, flowControlOnTransmit FlowControlOnTransmit, flowControlOnReceive FlowControlOnReceive }
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 Intermediate rate NIC on Tx NIC on Rx Flow control on Tx Flow control on Rx 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 V110()
Constructs a new V110 object with no fields set.V110(byte[] data)
Constructs a new V110 object from network-encoded data.V110(byte[] data, int start, int len)
Constructs a new V110 object from part of network-encoded data.V110(int arg)
Constructs a new V110 object from the given int, making it be read-only (immutable).V110(BearerCapability.ITU_T.Layer1Capability.Details.UnrestrictedDigital.V110.IntermediateRate intermediateRate, BearerCapability.ITU_T.Layer1Capability.Details.UnrestrictedDigital.V110.NetworkIndependentClockOnTransmit networkIndependentClockOnTransmit, BearerCapability.ITU_T.Layer1Capability.Details.UnrestrictedDigital.V110.NetworkIndependentClockOnReceive networkIndependentClockOnReceive, BearerCapability.ITU_T.Layer1Capability.Details.UnrestrictedDigital.V110.FlowControlOnTransmit flowControlOnTransmit, BearerCapability.ITU_T.Layer1Capability.Details.UnrestrictedDigital.V110.FlowControlOnReceive flowControlOnReceive)
Constructs a new V110 object from given values for all fields.V110(DataInput in)
Constructs a new V110 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
-
V110
public V110()
Constructs a new V110 object with no fields set.
-
V110
public V110(byte[] data)
Constructs a new V110 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
-
V110
public V110(byte[] data, int start, int len)
Constructs a new V110 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
-
V110
public V110(BearerCapability.ITU_T.Layer1Capability.Details.UnrestrictedDigital.V110.IntermediateRate intermediateRate, BearerCapability.ITU_T.Layer1Capability.Details.UnrestrictedDigital.V110.NetworkIndependentClockOnTransmit networkIndependentClockOnTransmit, BearerCapability.ITU_T.Layer1Capability.Details.UnrestrictedDigital.V110.NetworkIndependentClockOnReceive networkIndependentClockOnReceive, BearerCapability.ITU_T.Layer1Capability.Details.UnrestrictedDigital.V110.FlowControlOnTransmit flowControlOnTransmit, BearerCapability.ITU_T.Layer1Capability.Details.UnrestrictedDigital.V110.FlowControlOnReceive flowControlOnReceive)
Constructs a new V110 object from given values for all fields.- Parameters:
intermediateRate
- the intermediate ratenetworkIndependentClockOnTransmit
- whether required to send data with network independent clocknetworkIndependentClockOnReceive
- whether can accept data with network independent clockflowControlOnTransmit
- whether required to send data with flow control mechanismflowControlOnReceive
- whether can accept data with flow control mechanism
-
V110
public V110(int arg)
Constructs a new V110 object from the given int, making it be read-only (immutable).- Parameters:
arg
- int
-
V110
public V110(DataInput in) throws IOException
Constructs a new V110 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.V110(DataInput)}.- Parameters:
out
- the stream to write to- Throws:
IOException
- if an I/O error occurs
-
hasIntermediateRate
public boolean hasIntermediateRate() throws DecodeException
Tests whether the field IntermediateRate has a value.- Returns:
- whether the field has a value
- Throws:
DecodeException
- if encoded state cannot be decoded
-
hasNetworkIndependentClockOnTransmit
public boolean hasNetworkIndependentClockOnTransmit() throws DecodeException
Tests whether the field NetworkIndependentClockOnTransmit has a value.- Returns:
- whether the field has a value
- Throws:
DecodeException
- if encoded state cannot be decoded
-
hasNetworkIndependentClockOnReceive
public boolean hasNetworkIndependentClockOnReceive() throws DecodeException
Tests whether the field NetworkIndependentClockOnReceive has a value.- Returns:
- whether the field has a value
- Throws:
DecodeException
- if encoded state cannot be decoded
-
hasFlowControlOnTransmit
public boolean hasFlowControlOnTransmit() throws DecodeException
Tests whether the field FlowControlOnTransmit has a value.- Returns:
- whether the field has a value
- Throws:
DecodeException
- if encoded state cannot be decoded
-
hasFlowControlOnReceive
public boolean hasFlowControlOnReceive() throws DecodeException
Tests whether the field FlowControlOnReceive 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.V110.EncodedValue>
- Throws:
EncodeException
- if any mandatory field is not present
-
getIntermediateRate
public BearerCapability.ITU_T.Layer1Capability.Details.UnrestrictedDigital.V110.IntermediateRate getIntermediateRate() throws DecodeException
Gets the value of the intermediate rate.- Returns:
- IntermediateRate representation of the intermediate rate
- Throws:
DecodeException
- if encoded state cannot be decoded
-
getNetworkIndependentClockOnTransmit
public BearerCapability.ITU_T.Layer1Capability.Details.UnrestrictedDigital.V110.NetworkIndependentClockOnTransmit getNetworkIndependentClockOnTransmit() throws DecodeException
Gets the value of whether required to send data with network independent clock.- Returns:
- NetworkIndependentClockOnTransmit representation of whether required to send data with network independent clock
- Throws:
DecodeException
- if encoded state cannot be decoded
-
getNetworkIndependentClockOnReceive
public BearerCapability.ITU_T.Layer1Capability.Details.UnrestrictedDigital.V110.NetworkIndependentClockOnReceive getNetworkIndependentClockOnReceive() throws DecodeException
Gets the value of whether can accept data with network independent clock.- Returns:
- NetworkIndependentClockOnReceive representation of whether can accept data with network independent clock
- Throws:
DecodeException
- if encoded state cannot be decoded
-
getFlowControlOnTransmit
public BearerCapability.ITU_T.Layer1Capability.Details.UnrestrictedDigital.V110.FlowControlOnTransmit getFlowControlOnTransmit() throws DecodeException
Gets the value of whether required to send data with flow control mechanism.- Returns:
- FlowControlOnTransmit representation of whether required to send data with flow control mechanism
- Throws:
DecodeException
- if encoded state cannot be decoded
-
getFlowControlOnReceive
public BearerCapability.ITU_T.Layer1Capability.Details.UnrestrictedDigital.V110.FlowControlOnReceive getFlowControlOnReceive() throws DecodeException
Gets the value of whether can accept data with flow control mechanism.- Returns:
- FlowControlOnReceive representation of whether can accept data with flow control mechanism
- Throws:
DecodeException
- if encoded state cannot be decoded
-
setIntermediateRate
public BearerCapability.ITU_T.Layer1Capability.Details.UnrestrictedDigital.V110 setIntermediateRate(BearerCapability.ITU_T.Layer1Capability.Details.UnrestrictedDigital.V110.IntermediateRate value) throws IllegalStateException
Sets the value of the intermediate rate.- Parameters:
value
- IntermediateRate representation of the intermediate rate- Returns:
- this
- Throws:
IllegalStateException
-
setNetworkIndependentClockOnTransmit
public BearerCapability.ITU_T.Layer1Capability.Details.UnrestrictedDigital.V110 setNetworkIndependentClockOnTransmit(BearerCapability.ITU_T.Layer1Capability.Details.UnrestrictedDigital.V110.NetworkIndependentClockOnTransmit value) throws IllegalStateException
Sets the value of whether required to send data with network independent clock.- Parameters:
value
- NetworkIndependentClockOnTransmit representation of whether required to send data with network independent clock- Returns:
- this
- Throws:
IllegalStateException
-
setNetworkIndependentClockOnReceive
public BearerCapability.ITU_T.Layer1Capability.Details.UnrestrictedDigital.V110 setNetworkIndependentClockOnReceive(BearerCapability.ITU_T.Layer1Capability.Details.UnrestrictedDigital.V110.NetworkIndependentClockOnReceive value) throws IllegalStateException
Sets the value of whether can accept data with network independent clock.- Parameters:
value
- NetworkIndependentClockOnReceive representation of whether can accept data with network independent clock- Returns:
- this
- Throws:
IllegalStateException
-
setFlowControlOnTransmit
public BearerCapability.ITU_T.Layer1Capability.Details.UnrestrictedDigital.V110 setFlowControlOnTransmit(BearerCapability.ITU_T.Layer1Capability.Details.UnrestrictedDigital.V110.FlowControlOnTransmit value) throws IllegalStateException
Sets the value of whether required to send data with flow control mechanism.- Parameters:
value
- FlowControlOnTransmit representation of whether required to send data with flow control mechanism- Returns:
- this
- Throws:
IllegalStateException
-
setFlowControlOnReceive
public BearerCapability.ITU_T.Layer1Capability.Details.UnrestrictedDigital.V110 setFlowControlOnReceive(BearerCapability.ITU_T.Layer1Capability.Details.UnrestrictedDigital.V110.FlowControlOnReceive value) throws IllegalStateException
Sets the value of whether can accept data with flow control mechanism.- Parameters:
value
- FlowControlOnReceive representation of whether can accept data with flow control mechanism- Returns:
- this
- Throws:
IllegalStateException
-
copyOf
public static BearerCapability.ITU_T.Layer1Capability.Details.UnrestrictedDigital.V110 copyOf(BearerCapability.ITU_T.Layer1Capability.Details.UnrestrictedDigital.V110 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:
- V110
-
clone
public BearerCapability.ITU_T.Layer1Capability.Details.UnrestrictedDigital.V110 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.V110.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.V110.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.V110.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.V110.EncodedValue>
- Throws:
EncodeException
- if IntermediateRate is not in range [1,3]
-
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.V110.EncodedValue>
- Throws:
DecodeException
- if decoding fails
-
-