public final class MSClassmark extends AbstractLazyEncodedByteArray implements FastSerializable
The API offered by this class is as if the type were specified in ASN.1 as follows. Helper APIs are defined in nested classes for two of the three formats.
MSClassmark ::= CHOICE { mSClassmark1 MSClassmark1, mSClassmark2 MSClassmark2, mSClassmark3 OCTET STRING }
Modifier and Type | Class and Description |
---|---|
static class |
MSClassmark.Choice
Enumeration of discriminating values.
|
static class |
MSClassmark.MSClassmark1
Class MSClassmark1 provides the network with information concerning aspects
of high priority of the mobile station equipment, coded in MSClassmark1 format.
|
static class |
MSClassmark.MSClassmark2
Class MSClassmark2 provides the network with information concerning aspects
of high priority of the mobile station equipment, coded in MSClassmark2 format.
|
isDecoded
encoded
FIELD_ABSENT, FIELD_UNINITIALISED
Constructor and Description |
---|
MSClassmark()
Constructs a new MSClassmark object with no fields set.
|
MSClassmark(byte[] data)
Constructs a new MSClassmark object from network-encoded data.
|
MSClassmark(byte[] data,
int start,
int len)
Constructs a new MSClassmark object from part of network-encoded data.
|
MSClassmark(DataInput in)
Constructs a new MSClassmark object from data deserialized from a stream that was written by
toStream(DataOutput) . |
Modifier and Type | Method and Description |
---|---|
void |
checkFieldsSet()
Checks that all mandatory fields are present.
|
MSClassmark |
clone()
Constructs a copy of this object and everything reachable from it.
|
static MSClassmark |
copyOf(MSClassmark 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.
|
MSClassmark.Choice |
getChoice()
Gets the discriminant for which choice is chosen.
|
static int |
getContainedLength(byte[] data,
int start,
int len)
Determines the length of the encoded value that commences at offset
start in the given data . |
byte[] |
getEncodedForm()
Gets the encoded form.
|
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 :discriminant-name to field-value.
|
MSClassmark.MSClassmark1 |
getMSClassmark1()
Gets the value of MS Classmark 1.
|
MSClassmark.MSClassmark2 |
getMSClassmark2()
Gets the value of MS Classmark 2.
|
byte[] |
getMSClassmark3()
Gets the value of MS Classmark 3.
|
boolean |
isMSClassmark1Chosen()
Tests whether the choice is mSClassmark1.
|
boolean |
isMSClassmark2Chosen()
Tests whether the choice is mSClassmark2.
|
boolean |
isMSClassmark3Chosen()
Tests whether the choice is mSClassmark3.
|
MSClassmark |
setMSClassmark1(MSClassmark.MSClassmark1 value)
Sets the value of MS Classmark 1.
|
MSClassmark |
setMSClassmark2(MSClassmark.MSClassmark2 value)
Sets the value of MS Classmark 2.
|
MSClassmark |
setMSClassmark3(byte[] value)
Sets the value of MS Classmark 3.
|
void |
toStream(DataOutput out)
Serializes this object to a stream in a form suitable for reading by
MSClassmark(DataInput) . |
checkDecode, checkModifyAndDecode
equals, hashCode, toString
checkModify, isReadOnly, setReadOnly
public MSClassmark()
public MSClassmark(byte[] data)
data
- network-encoded dataNullPointerException
- if data is nullpublic MSClassmark(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 MSClassmark(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
MSClassmark(DataInput)
.toStream
in interface FastSerializable
out
- the stream to write toIOException
- if an I/O error occurspublic MSClassmark.Choice getChoice() throws DecodeException
DecodeException
- if encoded state cannot be decodedpublic boolean isMSClassmark1Chosen() throws DecodeException
DecodeException
- if encoded state cannot be decodedpublic boolean isMSClassmark2Chosen() throws DecodeException
DecodeException
- if encoded state cannot be decodedpublic boolean isMSClassmark3Chosen() throws DecodeException
DecodeException
- if encoded state cannot be decodedpublic void checkFieldsSet() throws EncodeException
checkFieldsSet
in class AbstractLazyEncodedDataObject<byte[]>
EncodeException
- if any mandatory field is not presentpublic MSClassmark.MSClassmark1 getMSClassmark1() throws DecodeException
DecodeException
- if encoded state cannot be decodedpublic MSClassmark.MSClassmark2 getMSClassmark2() throws DecodeException
DecodeException
- if encoded state cannot be decodedpublic byte[] getMSClassmark3() throws DecodeException
DecodeException
- if encoded state cannot be decodedpublic MSClassmark setMSClassmark1(MSClassmark.MSClassmark1 value) throws IllegalStateException
value
- MSClassmark1 representation of MS Classmark 1IllegalStateException
public MSClassmark setMSClassmark2(MSClassmark.MSClassmark2 value) throws IllegalStateException
value
- MSClassmark2 representation of MS Classmark 2IllegalStateException
public MSClassmark setMSClassmark3(byte[] value) throws IllegalStateException
value
- byte[] representation of MS Classmark 3IllegalStateException
public static MSClassmark copyOf(MSClassmark from)
from
- the object from which to copypublic MSClassmark 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
- the value of this parameter is ignoredprotected boolean encodedIsInvalid()
public byte[] getEncodedForm() throws EncodeException
EncodeException
- if encoding failspublic static int getContainedLength(byte[] data, int start, int len)
start
in the given data
.
The value is not fully decoded and might not be decodable.
Values of this type are of variable length, so the given length
is returned if the data is long enough, otherwise 0 is returned.data
- network-encoded datastart
- index into data where value commenceslen
- length in data to be consideredprotected void encode() throws EncodeException
encode
in class AbstractLazyEncodedDataObject<byte[]>
EncodeException
- if choice does not match already encoded coding standardprotected void decode() throws DecodeException
decode
in class AbstractLazyEncodedDataObject<byte[]>
DecodeException
- if too few or too many octets to be decoded