Class ContainingOctetString
-
- All Implemented Interfaces:
DataObject
,Serializable
public class ContainingOctetString extends ExtendibleOctetString
A ContainingOctetString is an ExtendibleOctetString that contains a DataObject. This allows any type of value to be contained.ContainingOctetString ::= SEQUENCE { byteArray SEQUENCE OF INTEGER (-128 .. 127) OPTIONAL, contained OPTIONAL -- OPEN }
ContainingOctetString is used as the representation of values of open type.- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class com.opencloud.util.AbstractFieldsObject
FIELD_ABSENT, FIELD_UNINITIALISED
-
-
Constructor Summary
Constructors Constructor Description ContainingOctetString()
Nullary constructor.ContainingOctetString(byte[] byteArray)
Constructs from a given initial byte array.ContainingOctetString(byte[] byteArray, Throwable decodingError)
Constructs from a given initial byte array and a Throwable from trying to decode that array.ContainingOctetString(DataObject value)
Constructs from a given DataObject value.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description ContainingOctetString
clone()
Constructs a copy of this object and everything reachable from it.static ContainingOctetString
copyOf(ContainingOctetString from)
Creates a new object of this type, initialising its field values from those of the given object.DataObject
getContainedValue()
Gets the contained value.Throwable
getDecodingError()
Get the decoding error associated with this ContainingOctetString.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 containing just the byte array field.boolean
hasContainedValue()
Tests whether a contained value is present.ContainingOctetString
setByteArray(byte[] value)
Sets the value of the field byteArray.ContainingOctetString
setContainedValue(DataObject value)
Sets the contained value.-
Methods inherited from class com.opencloud.slee.resources.cgin.ExtendibleOctetString
getByteArray, hasByteArray
-
Methods inherited from class com.opencloud.util.AbstractFieldsObject
equals, hashCode, toString
-
Methods inherited from class com.opencloud.util.AbstractDataObject
checkModify, isReadOnly, setReadOnly
-
-
-
-
Constructor Detail
-
ContainingOctetString
public ContainingOctetString()
Nullary constructor.
-
ContainingOctetString
public ContainingOctetString(byte[] byteArray)
Constructs from a given initial byte array.- Parameters:
byteArray
- byte array
-
ContainingOctetString
public ContainingOctetString(byte[] byteArray, Throwable decodingError)
Constructs from a given initial byte array and a Throwable from trying to decode that array.- Parameters:
byteArray
- byte arraydecodingError
- Throwable
-
ContainingOctetString
public ContainingOctetString(DataObject value)
Constructs from a given DataObject value.- Parameters:
value
- DataObject
-
-
Method Detail
-
clone
public ContainingOctetString 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
-
copyOf
public static ContainingOctetString copyOf(ContainingOctetString from)
Creates a new object of this type, initialising its field values from those of the given object.- Parameters:
from
- the object from which to copy- Returns:
- new ContainingOctetString
-
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 containing just the byte array field.- Overrides:
getFieldsMap
in classExtendibleOctetString
- Parameters:
withAbsents
- whether to put absent optional fields into Map- Returns:
- Map from field-name to field-value
-
getContainedValue
public DataObject getContainedValue()
Gets the contained value.- Returns:
- contained value, or null if not present
-
hasContainedValue
public boolean hasContainedValue()
Tests whether a contained value is present.- Returns:
- boolean
-
setContainedValue
public ContainingOctetString setContainedValue(DataObject value) throws IllegalStateException
Sets the contained value.- Parameters:
value
- the new contained value- Returns:
- this
- Throws:
IllegalStateException
- if this instance has been marked as read-only
-
setByteArray
public ContainingOctetString setByteArray(byte[] value) throws IllegalStateException
Sets the value of the field byteArray.- Overrides:
setByteArray
in classExtendibleOctetString
- Parameters:
value
- the new value for the field- Returns:
- this
- Throws:
IllegalStateException
- if this instance has been marked as read-only
-
getDecodingError
public Throwable getDecodingError()
Get the decoding error associated with this ContainingOctetString. This is only non-null if this instance was built with a decoding error.- Returns:
- the decoding error if present, or
null
if this instance was not built with a decoding error
-
-