Class BearerCapability.ITU_T.Ericsson
- java.lang.Object
-
- com.opencloud.util.AbstractDataObject
-
- com.opencloud.util.AbstractFieldsObject
-
- AbstractEncodedDataObject<T>
-
- AbstractLazyEncodedDataObject<byte[]>
-
- AbstractLazyEncodedByteArray
-
- com.opencloud.slee.resources.in.datatypes.cc.BearerCapability.ITU_T.Ericsson
-
- All Implemented Interfaces:
DataObject,Serializable
- Enclosing class:
- BearerCapability.ITU_T
public static final class BearerCapability.ITU_T.Ericsson extends AbstractLazyEncodedByteArray
Class Ericsson represents the Ericsson-specific data within a BearerCapability.ITU_T. 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.
Ericsson ::= SEQUENCE { structure Structure, configuration Configuration, establishment Establishment, ericsson4b Ericsson4b OPTIONAL }Data Encoding - based on comment in Ericsson-INAP-CS1-Datatypes.asn 8 7 6 5 4 3 2 1 Octet 4a ext. 0/1 Structure Configuration Establishment Octet 4b* ext. 1 Symmetry Reverse information transfer rate
The octet numbering in the above table results from renumbering Ericsson's 2a and 2b to fit into the numbering used in ITU-T Q.931 (05/98) §4.5.5 p58.- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classBearerCapability.ITU_T.Ericsson.ConfigurationEricsson Configuration constants.static classBearerCapability.ITU_T.Ericsson.Ericsson4bClass Ericsson4b represents the data within octet 4b of the Ericsson-specific data.static classBearerCapability.ITU_T.Ericsson.EstablishmentEricsson Establishment constants.static classBearerCapability.ITU_T.Ericsson.StructureEricsson Structure constants.
-
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 Ericsson()Constructs a new Ericsson object with no fields set.Ericsson(byte[] data)Constructs a new Ericsson object from network-encoded data.Ericsson(byte[] data, int start, int len)Constructs a new Ericsson object from part of network-encoded data.Ericsson(DataInput in)Constructs a new Ericsson 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 voidcheckFieldsSet()Checks that all mandatory fields are present.BearerCapability.ITU_T.Ericssonclone()Constructs a copy of this object and everything reachable from it.static BearerCapability.ITU_T.EricssoncopyOf(BearerCapability.ITU_T.Ericsson 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 voiddecode()Computes the decoded form from the encoded form.protected voidencode()Computes the encoded form from the decoded form.protected booleanencodedIsInvalid()Determines whether the encoded form is invalid.BearerCapability.ITU_T.Ericsson.ConfigurationgetConfiguration()Gets the value of the configuration.static intgetContainedLength(byte[] data, int start, int len)Determines the length of the encoded value that commences at offsetstartin the givendata.byte[]getEncodedForm()Gets the encoded form.BearerCapability.ITU_T.Ericsson.Ericsson4bgetEricsson4b()Gets the value of the Ericsson-specific octet 4b data.BearerCapability.ITU_T.Ericsson.EstablishmentgetEstablishment()Gets the value of the establishment.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 field-name to field-value for the fields of a sequence.BearerCapability.ITU_T.Ericsson.StructuregetStructure()Gets the value of the structure.booleanhasConfiguration()Tests whether the field Configuration has a value.booleanhasEricsson4b()Tests whether the field Ericsson4b has a value.booleanhasEstablishment()Tests whether the field Establishment has a value.booleanhasStructure()Tests whether the field Structure has a value.BearerCapability.ITU_T.EricssonsetConfiguration(BearerCapability.ITU_T.Ericsson.Configuration value)Sets the value of the configuration.BearerCapability.ITU_T.EricssonsetEricsson4b(BearerCapability.ITU_T.Ericsson.Ericsson4b value)Sets the value of the Ericsson-specific octet 4b data.BearerCapability.ITU_T.EricssonsetEstablishment(BearerCapability.ITU_T.Ericsson.Establishment value)Sets the value of the establishment.BearerCapability.ITU_T.EricssonsetStructure(BearerCapability.ITU_T.Ericsson.Structure value)Sets the value of the structure.voidtoStream(DataOutput out)Serializes this object to a stream in a form suitable for reading by {@link #BearerCapability.ITU_T.Ericsson(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, setReadOnly
-
-
-
-
Constructor Detail
-
Ericsson
public Ericsson()
Constructs a new Ericsson object with no fields set.
-
Ericsson
public Ericsson(byte[] data)
Constructs a new Ericsson 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
-
Ericsson
public Ericsson(byte[] data, int start, int len)Constructs a new Ericsson object from part of network-encoded data. The part starts at indexstartand islenbytes 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
-
Ericsson
public Ericsson(DataInput in) throws IOException
Constructs a new Ericsson 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.Ericsson(DataInput)}.- Parameters:
out- the stream to write to- Throws:
IOException- if an I/O error occurs
-
hasStructure
public boolean hasStructure() throws DecodeExceptionTests whether the field Structure has a value.- Returns:
- whether the field has a value
- Throws:
DecodeException- if encoded state cannot be decoded
-
hasConfiguration
public boolean hasConfiguration() throws DecodeExceptionTests whether the field Configuration has a value.- Returns:
- whether the field has a value
- Throws:
DecodeException- if encoded state cannot be decoded
-
hasEstablishment
public boolean hasEstablishment() throws DecodeExceptionTests whether the field Establishment has a value.- Returns:
- whether the field has a value
- Throws:
DecodeException- if encoded state cannot be decoded
-
hasEricsson4b
public boolean hasEricsson4b() throws DecodeExceptionTests whether the field Ericsson4b has a value.- Returns:
- whether the field has a value
- Throws:
DecodeException- if encoded state cannot be decoded
-
checkFieldsSet
public void checkFieldsSet() throws EncodeExceptionChecks that all mandatory fields are present. Should be called immediately before all calls to encode().- Specified by:
checkFieldsSetin classAbstractLazyEncodedDataObject<byte[]>- Throws:
EncodeException- if any mandatory field is not present
-
getStructure
public BearerCapability.ITU_T.Ericsson.Structure getStructure() throws DecodeException
Gets the value of the structure.- Returns:
- Structure representation of the structure
- Throws:
DecodeException- if encoded state cannot be decoded
-
getConfiguration
public BearerCapability.ITU_T.Ericsson.Configuration getConfiguration() throws DecodeException
Gets the value of the configuration.- Returns:
- Configuration representation of the configuration
- Throws:
DecodeException- if encoded state cannot be decoded
-
getEstablishment
public BearerCapability.ITU_T.Ericsson.Establishment getEstablishment() throws DecodeException
Gets the value of the establishment.- Returns:
- Establishment representation of the establishment
- Throws:
DecodeException- if encoded state cannot be decoded
-
getEricsson4b
public BearerCapability.ITU_T.Ericsson.Ericsson4b getEricsson4b() throws DecodeException
Gets the value of the Ericsson-specific octet 4b data.- Returns:
- Ericsson4b representation of the Ericsson-specific octet 4b data
- Throws:
DecodeException- if encoded state cannot be decoded
-
setStructure
public BearerCapability.ITU_T.Ericsson setStructure(BearerCapability.ITU_T.Ericsson.Structure value) throws IllegalStateException
Sets the value of the structure.- Parameters:
value- Structure representation of the structure- Returns:
- this
- Throws:
IllegalStateException
-
setConfiguration
public BearerCapability.ITU_T.Ericsson setConfiguration(BearerCapability.ITU_T.Ericsson.Configuration value) throws IllegalStateException
Sets the value of the configuration.- Parameters:
value- Configuration representation of the configuration- Returns:
- this
- Throws:
IllegalStateException
-
setEstablishment
public BearerCapability.ITU_T.Ericsson setEstablishment(BearerCapability.ITU_T.Ericsson.Establishment value) throws IllegalStateException
Sets the value of the establishment.- Parameters:
value- Establishment representation of the establishment- Returns:
- this
- Throws:
IllegalStateException
-
setEricsson4b
public BearerCapability.ITU_T.Ericsson setEricsson4b(BearerCapability.ITU_T.Ericsson.Ericsson4b value) throws IllegalStateException
Sets the value of the Ericsson-specific octet 4b data.- Parameters:
value- Ericsson4b representation of the Ericsson-specific octet 4b data- Returns:
- this
- Throws:
IllegalStateException
-
copyOf
public static BearerCapability.ITU_T.Ericsson copyOf(BearerCapability.ITU_T.Ericsson 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:
- Ericsson
-
clone
public BearerCapability.ITU_T.Ericsson clone()
Constructs a copy of this object and everything reachable from it.- Specified by:
clonein interfaceDataObject- Specified by:
clonein 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:
getFieldsMapin 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 byte[] getEncodedForm() throws EncodeExceptionGets the encoded form.- Returns:
- encoded form
- Throws:
EncodeException- if encoding fails
-
getContainedLength
public static int getContainedLength(byte[] data, int start, int len)Determines the length of the encoded value that commences at offsetstartin the givendata. The value is not fully decoded and might not be decodable. If the encoded value ends with a filling field, then the givenlenis returned. If the encoded value is so currupt that its length cannot be determined, then0is returned.- Parameters:
data- network-encoded datastart- index into data where value commenceslen- length in data to be considered- Returns:
- length of encoded value, or 0 if not decodable
- Throws:
NullPointerException- if data is null
-
encode
protected void encode() throws EncodeExceptionComputes the encoded form from the decoded form.- Specified by:
encodein classAbstractLazyEncodedDataObject<byte[]>- Throws:
EncodeException- if any mandatory field is out of range
-
decode
protected void decode()
Computes the decoded form from the encoded form.- Specified by:
decodein classAbstractLazyEncodedDataObject<byte[]>
-
-