public final class MMCode extends AbstractLazyEncodedNamedInteger<MMCode.EncodedValue> implements FastSerializable
The API offered by this class is as if the type were specified in ASN.1 as follows.
MMCode ::= SEQUENCE { encodedValue EncodedValue }
EncodedValue is a NamedInteger.
For each named value of the type, n
, the API defines three Java static fields:
a DataObject n
,
a NamedInteger EncodedValue.n
,
and an int EncodedValue._n
.
The encoding is based on comments in ASN.1 module MAP-MS-DataTypes in 3GPP TS 29.002 V10.0.0 (2010-09) p378.
Modifier and Type | Class and Description |
---|---|
static class |
MMCode.EncodedValue
MMCode constants.
|
Modifier and Type | Field and Description |
---|---|
static MMCode |
GPRS_ATTACH
GPRS attach
|
static MMCode |
IMSI_ATTACH
IMSI attach
|
static MMCode |
LOCATION_UPDATE_IN_SAME_VLR
Location update in same VLR
|
static MMCode |
LOCATION_UPDATE_TO_OTHER_VLR
Location update to other VLR
|
static MMCode |
MS_INITIATED_GPRS_DETACH
MS initiated GPRS detach
|
static MMCode |
MS_INITIATED_IMSI_DETACH
MS initiated IMSI detach
|
static MMCode |
NETWORK_INITIATED_GPRS_DETACH
Network initiated GPRS detach
|
static MMCode |
NETWORK_INITIATED_IMSI_DETACH
Network initiated IMSI detach
|
static MMCode |
NETWORK_INITIATED_TRANSFER_TO_MS_NOT_REACHABLE_FOR_PAGING
Network initiated transfer toMS not reachable for paging
|
static MMCode |
ROUTEING_AREA_UPDATE_IN_SAME_SGSN
Routeing (sic) area update in same SGSN
|
static MMCode |
ROUTEING_AREA_UPDATE_TO_OTHER_SGSN_DISCONNECT_BY_DETACH
Routeing (sic) area update to other SGSN disconnect by detach
|
static MMCode |
ROUTEING_AREA_UPDATE_TO_OTHER_SGSN_UPDATE_FROM_NEW_SGSN
Routeing (sic) area updateTo other SGSN update from new SGSN
|
isDecoded
encoded
FIELD_ABSENT, FIELD_UNINITIALISED
Constructor and Description |
---|
MMCode()
Constructs a new MMCode object with no fields set.
|
MMCode(byte[] data)
Constructs a new MMCode object from network-encoded data.
|
MMCode(byte[] data,
int start,
int len)
Constructs a new MMCode object from part of network-encoded data.
|
MMCode(DataInput in)
Constructs a new MMCode object from data deserialized from a stream that was written by
toStream(DataOutput) . |
MMCode(int arg)
Constructs a new MMCode object from the given int,
making it be read-only (immutable).
|
MMCode(MMCode.EncodedValue encodedValue)
Constructs a new MMCode object from given values for all fields.
|
Modifier and Type | Method and Description |
---|---|
void |
checkFieldsSet()
Checks that all mandatory fields are present.
|
MMCode |
clone()
Constructs a copy of this object and everything reachable from it.
|
static MMCode |
copyOf(MMCode 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 void |
decode()
Computes the decoded form from the encoded form.
|
protected void |
encode()
Computes the encoded form from the decoded form.
|
protected boolean |
encodedIsInvalid()
Determines whether the encoded form is invalid.
|
protected MMCode.EncodedValue |
fromValue(int value)
Converts an int to a NamedInteger.
|
byte[] |
getByteArrayForm()
Gets the byte array encoded form.
|
MMCode.EncodedValue |
getEncodedForm()
Gets the encoded form.
|
MMCode.EncodedValue |
getEncodedValue()
Gets the value of the MMCode value.
|
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.
|
boolean |
hasEncodedValue()
Tests whether the field EncodedValue has a value.
|
MMCode |
setEncodedValue(MMCode.EncodedValue value)
Sets the value of the MMCode value.
|
void |
toStream(DataOutput out)
Serializes this object to a stream in a form suitable for reading by
MMCode(DataInput) . |
checkDecode, checkModifyAndDecode
equals, hashCode, toString
checkModify, isReadOnly, setReadOnly
public static final MMCode LOCATION_UPDATE_IN_SAME_VLR
public static final MMCode LOCATION_UPDATE_TO_OTHER_VLR
public static final MMCode IMSI_ATTACH
public static final MMCode MS_INITIATED_IMSI_DETACH
public static final MMCode NETWORK_INITIATED_IMSI_DETACH
public static final MMCode ROUTEING_AREA_UPDATE_IN_SAME_SGSN
public static final MMCode ROUTEING_AREA_UPDATE_TO_OTHER_SGSN_UPDATE_FROM_NEW_SGSN
public static final MMCode ROUTEING_AREA_UPDATE_TO_OTHER_SGSN_DISCONNECT_BY_DETACH
public static final MMCode GPRS_ATTACH
public static final MMCode MS_INITIATED_GPRS_DETACH
public static final MMCode NETWORK_INITIATED_GPRS_DETACH
public static final MMCode NETWORK_INITIATED_TRANSFER_TO_MS_NOT_REACHABLE_FOR_PAGING
public MMCode()
public MMCode(byte[] data)
data
- network-encoded dataNullPointerException
- if data is nullpublic MMCode(byte[] data, int start, int len)
start
and is len
bytes long.
The data is not decoded and might not be decodable.data
- network-encoded datastart
- starting offset of network-encoded data in byte arraylen
- default length if not predictableNullPointerException
- if data is nullIllegalArgumentException
- if len is negativepublic MMCode(MMCode.EncodedValue encodedValue)
encodedValue
- the MMCode valuepublic MMCode(int arg)
arg
- intpublic MMCode(DataInput in) throws IOException
toStream(DataOutput)
.in
- the stream to read fromEOFException
- if reading is pre-empted by end-of-fileIOException
- if the data cannot be readpublic void toStream(DataOutput out) throws IOException
MMCode(DataInput)
.toStream
in interface FastSerializable
out
- the stream to write toIOException
- if an I/O error occurspublic boolean hasEncodedValue() throws DecodeException
DecodeException
- if encoded state cannot be decodedpublic void checkFieldsSet() throws EncodeException
checkFieldsSet
in class AbstractLazyEncodedDataObject<MMCode.EncodedValue>
EncodeException
- if any mandatory field is not presentpublic MMCode.EncodedValue getEncodedValue() throws DecodeException
DecodeException
- if encoded state cannot be decodedpublic MMCode setEncodedValue(MMCode.EncodedValue value) throws IllegalStateException
value
- EncodedValue representation of the MMCode valueIllegalStateException
public static MMCode copyOf(MMCode from)
from
- the object from which to copypublic MMCode clone()
clone
in interface DataObject
clone
in class AbstractDataObject
public static FieldAccessor[] getFieldAccessors()
public Map<String,Object> getFieldsMap(boolean withAbsents)
getFieldsMap
in class AbstractFieldsObject
withAbsents
- whether to put absent optional fields into Mapprotected boolean encodedIsInvalid()
public MMCode.EncodedValue getEncodedForm() throws EncodeException
EncodeException
- if encoding failspublic byte[] getByteArrayForm() throws EncodeException
EncodeException
- if encoding failsprotected MMCode.EncodedValue fromValue(int value)
fromValue
in class AbstractLazyEncodedNamedInteger<MMCode.EncodedValue>
value
- intprotected void encode() throws EncodeException
encode
in class AbstractLazyEncodedDataObject<MMCode.EncodedValue>
EncodeException
- if EncodedValue is not in range [0,255]protected void decode() throws DecodeException
decode
in class AbstractLazyEncodedDataObject<MMCode.EncodedValue>
DecodeException
- if decoding fails