public final class SMSReserved extends SMSTPDU implements Immutable
getEncodedForm()
to access the contained encoded data.SMSTPDU.Type
isDecoded
encoded
FIELD_ABSENT, FIELD_UNINITIALISED
Constructor and 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.
|
Modifier and Type | Method and 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 PDU
|
boolean |
isReadOnly()
Check if this object has been set read-only.
|
void |
setReadOnly()
Set this object to be "read-only".
|
checkFieldsSet, decodeRPAck, decodeRPAck, decodeRPError, decodeRPError, decodeRPMOData, decodeRPMOData, decodeRPMTData, decodeRPMTData, encodeRPAck, encodeRPError, encodeRPMOData, encodeRPMTData
checkDecode, checkModifyAndDecode
equals, hashCode, toString
public SMSReserved(byte[] message)
message
- a bytearray containing the encoded PDUNullPointerException
- if message is nullpublic SMSReserved(byte[] message, int start, int len)
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)NullPointerException
- if message is nullIllegalArgumentException
- if start or len are out of rangepublic SMSTPDU.Type getType()
SMSTPDU
public SMSReserved clone()
DataObject
Inherently immutable objects may optionally return the same object without modification from clone(), rather than constructing a new instance.
clone
in interface DataObject
clone
in class AbstractDataObject
public void setReadOnly()
DataObject
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.
setReadOnly
in interface DataObject
setReadOnly
in class AbstractDataObject
public boolean isReadOnly()
DataObject
isReadOnly
in interface DataObject
isReadOnly
in class AbstractDataObject
DataObject.setReadOnly()
protected void checkModify()
AbstractDataObject
checkModify
in class AbstractDataObject
public byte[] getEncodedForm()
SMSTPDU
getEncodedForm
in class SMSTPDU
public Map<String,Object> getFieldsMap(boolean withAbsents)
AbstractFieldsObject
:
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 of AbstractFieldsObject.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.
getFieldsMap
in class AbstractFieldsObject
withAbsents
- whether to put absent optional fields into Mappublic static int getContainedLength(byte[] data, int start, int len)
protected void encode()
AbstractLazyEncodedDataObject
encode
in class AbstractLazyEncodedDataObject<byte[]>
protected void decode()
AbstractLazyEncodedDataObject
isDecoded
to true.decode
in class AbstractLazyEncodedDataObject<byte[]>