Class SMSReserved
- java.lang.Object
-
- com.opencloud.util.AbstractDataObject
-
- com.opencloud.util.AbstractFieldsObject
-
- AbstractEncodedDataObject<T>
-
- AbstractLazyEncodedDataObject<byte[]>
-
- AbstractLazyEncodedByteArray
-
- com.opencloud.slee.resources.in.datatypes.sms.SMSTPDU
-
- com.opencloud.slee.resources.in.datatypes.sms.SMSReserved
-
- All Implemented Interfaces:
DataObject
,Immutable
,Serializable
public final class SMSReserved extends SMSTPDU implements Immutable
Representation of a SMS TPDU with an unsupported MTI/role combination. This class does no encoding or decoding, and simply acts as an immutable data-holder object. CallgetEncodedForm()
to access the contained encoded data.- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.opencloud.slee.resources.in.datatypes.sms.SMSTPDU
SMSTPDU.Type
-
-
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 SMSReserved(byte[] message)
Wrap an arbitrary SMS TPDU in an immutable SMSReserved instance.SMSReserved(byte[] message, int start, int len)
Wrap an arbitrary SMS TPDU in an immutable SMSReserved instance.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
checkModify()
Checks whether this DataObject is mutable.SMSReserved
clone()
Perform a deep copy of this object.protected void
decode()
Computes the decoded form of the state from the encoded form.protected void
encode()
Computes the encoded form of the state from the decoded form.static int
getContainedLength(byte[] data, int start, int len)
byte[]
getEncodedForm()
Encode this message to the network form.Map<String,Object>
getFieldsMap(boolean withAbsents)
Gets a Map from field-name to field-value for all fields defined by the concrete subclass of AbstractFieldsObject in use.SMSTPDU.Type
getType()
Return the message type of this PDUboolean
isReadOnly()
Check if this object has been set read-only.void
setReadOnly()
Set this object to be "read-only".-
Methods inherited from class com.opencloud.slee.resources.in.datatypes.sms.SMSTPDU
checkFieldsSet, decodeRPAck, decodeRPAck, decodeRPError, decodeRPError, decodeRPMOData, decodeRPMOData, decodeRPMTData, decodeRPMTData, encodeRPAck, encodeRPError, encodeRPMOData, encodeRPMTData
-
Methods inherited from class com.opencloud.slee.resources.cgin.AbstractLazyEncodedDataObject
checkDecode, checkModifyAndDecode
-
Methods inherited from class com.opencloud.util.AbstractFieldsObject
equals, hashCode, toString
-
-
-
-
Constructor Detail
-
SMSReserved
public SMSReserved(byte[] message)
Wrap an arbitrary SMS TPDU in an immutable SMSReserved instance. The encoded data is not decoded at all.- Parameters:
message
- a bytearray containing the encoded PDU- Throws:
NullPointerException
- if message is null
-
SMSReserved
public SMSReserved(byte[] message, int start, int len)
Wrap an arbitrary SMS TPDU in an immutable SMSReserved instance. The encoded data is not decoded at all.- Parameters:
message
- a bytearray containing the encoded PDUstart
- the offset within 'message' to begin decodinglen
- the number of valid bytes after 'offset' to decode (must be at least 1)- Throws:
NullPointerException
- if message is nullIllegalArgumentException
- if start or len are out of range
-
-
Method Detail
-
getType
public SMSTPDU.Type getType()
Description copied from class:SMSTPDU
Return the message type of this PDU
-
clone
public SMSReserved clone()
Description copied from interface:DataObject
Perform a deep copy of this object. Read-only state of the object is not copied; the new object will be read-write by default.Inherently immutable objects may optionally return the same object without modification from clone(), rather than constructing a new instance.
- Specified by:
clone
in interfaceDataObject
- Specified by:
clone
in classAbstractDataObject
- Returns:
- a new object that is a deep copy of this object; for immutable objects, the same object may optionally be returned.
-
setReadOnly
public void setReadOnly()
Description copied from interface:DataObject
Set this object to be "read-only". Any subsequent attempt to modify this object will throw IllegalStateException. Once an object has been made read-only, it cannot be later set to read-write - this is a "one-way" operation.Note that a read-only object is not necessarily immutable; if reference types are returned from accessors, then callers could theoretically mutate those objects even if the top-level object is marked as read-only. The ability to make objects read-only is intended to catch programming errors (e.g. attempting to modify a data object passed as part of a SLEE event), not to provide an absolute guarantee of immutability.
Calling setReadOnly() on an object that is already read-only is a no-op.
Some DataObject implementations may be inherently immutable. In those cases, they are considered always read-only.
- Specified by:
setReadOnly
in interfaceDataObject
- Overrides:
setReadOnly
in classAbstractDataObject
-
isReadOnly
public boolean isReadOnly()
Description copied from interface:DataObject
Check if this object has been set read-only.- Specified by:
isReadOnly
in interfaceDataObject
- Overrides:
isReadOnly
in classAbstractDataObject
- Returns:
- true if the object is read-only or inherently immutable
- See Also:
DataObject.setReadOnly()
-
checkModify
protected void checkModify()
Description copied from class:AbstractDataObject
Checks whether this DataObject is mutable.- Overrides:
checkModify
in classAbstractDataObject
-
getEncodedForm
public byte[] getEncodedForm()
Description copied from class:SMSTPDU
Encode this message to the network form. If the message is already encoded, the existing encoding is reused.- Specified by:
getEncodedForm
in classSMSTPDU
- Returns:
- a bytearray containing the encoded form
-
getFieldsMap
public Map<String,Object> getFieldsMap(boolean withAbsents)
Description copied from class:AbstractFieldsObject
Gets a Map from field-name to field-value for all fields defined by the concrete subclass of AbstractFieldsObject in use. A CHOICE should be distinguished from a SEQUENCE by the sole name/value pair having the character:
prefixed on its name.For a field of primitive type, the field-value should be boxed.
If
withAbsents
==true
, then absent optional fields should also be included with a field-value ofAbstractFieldsObject.FIELD_ABSENT
. Otherwise, absent fields should be omitted from the map entirely.Uninitialised mandatory fields should be included with a field-value of
AbstractFieldsObject.FIELD_UNINITIALISED
. This includes an uninitialised choice.- Specified by:
getFieldsMap
in classAbstractFieldsObject
- Parameters:
withAbsents
- whether to put absent optional fields into Map- Returns:
- Map from field-name to field-value
-
getContainedLength
public static int getContainedLength(byte[] data, int start, int len)
-
encode
protected void encode()
Description copied from class:AbstractLazyEncodedDataObject
Computes the encoded form of the state from the decoded form. Should check that individual field values are within appropriate ranges, and different fields have mutually consistent values, but needn't repeat the checks done by checkFieldsSet(). The computed encoded form should equal that from which the decoded form could have been calculated using decode(), i.e. encode o decode = id.- Specified by:
encode
in classAbstractLazyEncodedDataObject<byte[]>
-
decode
protected void decode()
Description copied from class:AbstractLazyEncodedDataObject
Computes the decoded form of the state from the encoded form. The computed decoded form should equal that from which the encoded form could have been calculated using encode(), i.e. decode o encode = id. If a field cannot be decoded without further information, such as a DigitCodec to be used for decoding a digit string, then the encoded form of that field should be copied and kept for decoding by that field's getter, which will be given the further information. The caller should setisDecoded
to true.- Specified by:
decode
in classAbstractLazyEncodedDataObject<byte[]>
-
-