Class ForwardingOptions
- java.lang.Object
-
- com.opencloud.util.AbstractDataObject
-
- com.opencloud.util.AbstractFieldsObject
-
- AbstractEncodedDataObject<T>
-
- AbstractLazyEncodedDataObject<byte[]>
-
- AbstractLazyEncodedByteArray
-
- com.opencloud.slee.resources.in.datatypes.map.ForwardingOptions
-
- All Implemented Interfaces:
DataObject
,FastSerializable
,Serializable
- Direct Known Subclasses:
ExtForwOptions
public class ForwardingOptions extends AbstractLazyEncodedByteArray implements FastSerializable
Class ForwardingOptions represents the ASN.1 OCTET STRING type MAP-SS-DataTypes.ForwardingOptions.The API offered by this class is as if the type were specified in ASN.1 as follows.
ForwardingOptions ::= SEQUENCE { notificationToForwardingParty BOOLEAN, redirectingPresentation BOOLEAN, notificationToCallingParty BOOLEAN, forwardingReason ForwardingReason }
The class takes care of encoding the field values into a byte-array and decoding field values from a byte-array, the encoded representation being as tabulated below.Data Encoding - based on comment in ASN.1 module MAP-SS-DataTypes in 3GPP TS 29.002 V10.0.0 (2010-09) §17.7.4 p402 8 7 6 5 4 3 2 1 Octet 1 Notification to forwarding party? Redirecting presentation? Notification to calling party? 0 Forwarding reason 0 0
Field names ending in ? are booleans: 1 for true, 0 for false.- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ForwardingOptions.ForwardingReason
Enumeration of Forwarding Reason constants.
-
Field Summary
Fields Modifier and Type Field Description protected ForwardingOptions.ForwardingReason
ForwardingReason_value
Value of field ForwardingReason.protected boolean
NotificationToCallingParty_present
Whether field NotificationToCallingParty is present.protected boolean
NotificationToCallingParty_value
Value of field NotificationToCallingParty.protected boolean
NotificationToForwardingParty_present
Whether field NotificationToForwardingParty is present.protected boolean
NotificationToForwardingParty_value
Value of field NotificationToForwardingParty.protected boolean
RedirectingPresentation_present
Whether field RedirectingPresentation is present.protected boolean
RedirectingPresentation_value
Value of field RedirectingPresentation.-
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 ForwardingOptions()
Constructs a new ForwardingOptions object with no fields set.ForwardingOptions(boolean notificationToForwardingParty, boolean redirectingPresentation, boolean notificationToCallingParty, ForwardingOptions.ForwardingReason forwardingReason)
Constructs a new ForwardingOptions object from given values for all fields.ForwardingOptions(byte[] data)
Constructs a new ForwardingOptions object from network-encoded data.ForwardingOptions(byte[] data, int start, int len)
Constructs a new ForwardingOptions object from part of network-encoded data.ForwardingOptions(DataInput in)
Constructs a new ForwardingOptions object from data deserialized from a stream that was written bytoStream(DataOutput)
.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
checkFieldsSet()
Checks that all mandatory fields are present.ForwardingOptions
clone()
Constructs a copy of this object and everything reachable from it.static ForwardingOptions
copyOf(ForwardingOptions 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.static int
getContainedLength(byte[] data, int start, int len)
Determines the length of the encoded value that commences at offsetstart
in the givendata
.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 field-name to field-value for the fields of a sequence.ForwardingOptions.ForwardingReason
getForwardingReason()
Gets the value of Forwarding reason.boolean
getNotificationToCallingParty()
Gets the value of Notification to calling party.boolean
getNotificationToForwardingParty()
Gets the value of Notification to forwarding party.boolean
getRedirectingPresentation()
Gets the value of Redirecting presentation.boolean
hasForwardingReason()
Tests whether the field ForwardingReason has a value.boolean
hasNotificationToCallingParty()
Tests whether the field NotificationToCallingParty has a value.boolean
hasNotificationToForwardingParty()
Tests whether the field NotificationToForwardingParty has a value.boolean
hasRedirectingPresentation()
Tests whether the field RedirectingPresentation has a value.ForwardingOptions
setForwardingReason(ForwardingOptions.ForwardingReason value)
Sets the value of Forwarding reason.ForwardingOptions
setNotificationToCallingParty(boolean value)
Sets the value of Notification to calling party.ForwardingOptions
setNotificationToCallingPartyPresent(boolean flag)
Sets the presence or absence of the field NotificationToCallingParty.ForwardingOptions
setNotificationToForwardingParty(boolean value)
Sets the value of Notification to forwarding party.ForwardingOptions
setNotificationToForwardingPartyPresent(boolean flag)
Sets the presence or absence of the field NotificationToForwardingParty.ForwardingOptions
setRedirectingPresentation(boolean value)
Sets the value of Redirecting presentation.ForwardingOptions
setRedirectingPresentationPresent(boolean flag)
Sets the presence or absence of the field RedirectingPresentation.void
toStream(DataOutput out)
Serializes this object to a stream in a form suitable for reading byForwardingOptions(DataInput)
.-
Methods inherited from class com.opencloud.slee.resources.cgin.AbstractLazyEncodedDataObject
checkDecode, checkModifyAndDecode
-
Methods inherited from class com.opencloud.util.AbstractFieldsObject
equals, hashCode, toString
-
Methods inherited from class com.opencloud.util.AbstractDataObject
checkModify, isReadOnly, setReadOnly
-
-
-
-
Field Detail
-
NotificationToForwardingParty_value
protected boolean NotificationToForwardingParty_value
Value of field NotificationToForwardingParty.
-
NotificationToForwardingParty_present
protected boolean NotificationToForwardingParty_present
Whether field NotificationToForwardingParty is present.
-
RedirectingPresentation_value
protected boolean RedirectingPresentation_value
Value of field RedirectingPresentation.
-
RedirectingPresentation_present
protected boolean RedirectingPresentation_present
Whether field RedirectingPresentation is present.
-
NotificationToCallingParty_value
protected boolean NotificationToCallingParty_value
Value of field NotificationToCallingParty.
-
NotificationToCallingParty_present
protected boolean NotificationToCallingParty_present
Whether field NotificationToCallingParty is present.
-
ForwardingReason_value
protected ForwardingOptions.ForwardingReason ForwardingReason_value
Value of field ForwardingReason.
-
-
Constructor Detail
-
ForwardingOptions
public ForwardingOptions()
Constructs a new ForwardingOptions object with no fields set.
-
ForwardingOptions
public ForwardingOptions(byte[] data)
Constructs a new ForwardingOptions object from network-encoded data. The data is not decoded and might not be decodable.- Parameters:
data
- network-encoded data- Throws:
NullPointerException
- if data is null
-
ForwardingOptions
public ForwardingOptions(byte[] data, int start, int len)
Constructs a new ForwardingOptions object from part of network-encoded data. The part starts at indexstart
and islen
bytes long. The data is not decoded and might not be decodable.- Parameters:
data
- network-encoded datastart
- starting offset of network-encoded data in byte arraylen
- default length if not predictable- Throws:
NullPointerException
- if data is nullIllegalArgumentException
- if len is negative
-
ForwardingOptions
public ForwardingOptions(boolean notificationToForwardingParty, boolean redirectingPresentation, boolean notificationToCallingParty, ForwardingOptions.ForwardingReason forwardingReason)
Constructs a new ForwardingOptions object from given values for all fields.- Parameters:
notificationToForwardingParty
- Notification to forwarding partyredirectingPresentation
- Redirecting presentationnotificationToCallingParty
- Notification to calling partyforwardingReason
- Forwarding reason
-
ForwardingOptions
public ForwardingOptions(DataInput in) throws IOException
Constructs a new ForwardingOptions object from data deserialized from a stream that was written bytoStream(DataOutput)
.- Parameters:
in
- the stream to read from- Throws:
EOFException
- if reading is pre-empted by end-of-fileIOException
- if the data cannot be read
-
-
Method Detail
-
toStream
public void toStream(DataOutput out) throws IOException
Serializes this object to a stream in a form suitable for reading byForwardingOptions(DataInput)
.- Specified by:
toStream
in interfaceFastSerializable
- Parameters:
out
- the stream to write to- Throws:
IOException
- if an I/O error occurs
-
hasNotificationToForwardingParty
public boolean hasNotificationToForwardingParty() throws DecodeException
Tests whether the field NotificationToForwardingParty has a value.- Returns:
- whether the field has a value
- Throws:
DecodeException
- if encoded state cannot be decoded
-
setNotificationToForwardingPartyPresent
public ForwardingOptions setNotificationToForwardingPartyPresent(boolean flag) throws IllegalStateException
Sets the presence or absence of the field NotificationToForwardingParty.- Parameters:
flag
- whether the field should be marked as present- Returns:
- this
- Throws:
IllegalStateException
- if this instance has been marked as read-only
-
hasRedirectingPresentation
public boolean hasRedirectingPresentation() throws DecodeException
Tests whether the field RedirectingPresentation has a value.- Returns:
- whether the field has a value
- Throws:
DecodeException
- if encoded state cannot be decoded
-
setRedirectingPresentationPresent
public ForwardingOptions setRedirectingPresentationPresent(boolean flag) throws IllegalStateException
Sets the presence or absence of the field RedirectingPresentation.- Parameters:
flag
- whether the field should be marked as present- Returns:
- this
- Throws:
IllegalStateException
- if this instance has been marked as read-only
-
hasNotificationToCallingParty
public boolean hasNotificationToCallingParty() throws DecodeException
Tests whether the field NotificationToCallingParty has a value.- Returns:
- whether the field has a value
- Throws:
DecodeException
- if encoded state cannot be decoded
-
setNotificationToCallingPartyPresent
public ForwardingOptions setNotificationToCallingPartyPresent(boolean flag) throws IllegalStateException
Sets the presence or absence of the field NotificationToCallingParty.- Parameters:
flag
- whether the field should be marked as present- Returns:
- this
- Throws:
IllegalStateException
- if this instance has been marked as read-only
-
hasForwardingReason
public boolean hasForwardingReason() throws DecodeException
Tests whether the field ForwardingReason has a value.- Returns:
- whether the field has a value
- Throws:
DecodeException
- if encoded state cannot be decoded
-
checkFieldsSet
public void checkFieldsSet() throws EncodeException
Checks that all mandatory fields are present. Should be called immediately before all calls to encode().- Specified by:
checkFieldsSet
in classAbstractLazyEncodedDataObject<byte[]>
- Throws:
EncodeException
- if any mandatory field is not present
-
getNotificationToForwardingParty
public boolean getNotificationToForwardingParty() throws DecodeException
Gets the value of Notification to forwarding party.- Returns:
- boolean representation of Notification to forwarding party
- Throws:
DecodeException
- if encoded state cannot be decoded
-
getRedirectingPresentation
public boolean getRedirectingPresentation() throws DecodeException
Gets the value of Redirecting presentation.- Returns:
- boolean representation of Redirecting presentation
- Throws:
DecodeException
- if encoded state cannot be decoded
-
getNotificationToCallingParty
public boolean getNotificationToCallingParty() throws DecodeException
Gets the value of Notification to calling party.- Returns:
- boolean representation of Notification to calling party
- Throws:
DecodeException
- if encoded state cannot be decoded
-
getForwardingReason
public ForwardingOptions.ForwardingReason getForwardingReason() throws DecodeException
Gets the value of Forwarding reason.- Returns:
- ForwardingReason representation of Forwarding reason
- Throws:
DecodeException
- if encoded state cannot be decoded
-
setNotificationToForwardingParty
public ForwardingOptions setNotificationToForwardingParty(boolean value) throws IllegalStateException
Sets the value of Notification to forwarding party.- Parameters:
value
- boolean representation of Notification to forwarding party- Returns:
- this
- Throws:
IllegalStateException
-
setRedirectingPresentation
public ForwardingOptions setRedirectingPresentation(boolean value) throws IllegalStateException
Sets the value of Redirecting presentation.- Parameters:
value
- boolean representation of Redirecting presentation- Returns:
- this
- Throws:
IllegalStateException
-
setNotificationToCallingParty
public ForwardingOptions setNotificationToCallingParty(boolean value) throws IllegalStateException
Sets the value of Notification to calling party.- Parameters:
value
- boolean representation of Notification to calling party- Returns:
- this
- Throws:
IllegalStateException
-
setForwardingReason
public ForwardingOptions setForwardingReason(ForwardingOptions.ForwardingReason value) throws IllegalStateException
Sets the value of Forwarding reason.- Parameters:
value
- ForwardingReason representation of Forwarding reason- Returns:
- this
- Throws:
IllegalStateException
-
copyOf
public static ForwardingOptions copyOf(ForwardingOptions 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.- Parameters:
from
- the object from which to copy- Returns:
- ForwardingOptions
-
clone
public ForwardingOptions 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
-
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 for the fields of a sequence. For a field of primitive type, the field-value is boxed. For an absent optional field, the field-value is AbstractFieldsObject.FIELD_ABSENT. For an uninitialised mandatory field, the field-value is AbstractFieldsObject.FIELD_UNINITIALISED. For a field of String type, the encoded form is used if the String cannot be decoded. For a type that represents an OCTET STRING that cannot be decoded, a map from "encodedValue" to the byte array value is returned.- Specified by:
getFieldsMap
in classAbstractFieldsObject
- Parameters:
withAbsents
- whether to put absent optional fields into Map- Returns:
- Map from field-name to field-value
-
encodedIsInvalid
protected boolean encodedIsInvalid()
Determines whether the encoded form is invalid.- Returns:
- boolean
-
getEncodedForm
public byte[] getEncodedForm() throws EncodeException
Gets the encoded form.- Returns:
- encoded form
- Throws:
EncodeException
- if encoding fails
-
getContainedLength
public static int getContainedLength(byte[] data, int start, int len)
Determines the length of the encoded value that commences at offsetstart
in the givendata
. The value is not fully decoded and might not be decodable. Values of this type are of a fixed length, so that length is returned if the data is long enough, otherwise 0 is returned.- Parameters:
data
- network-encoded datastart
- index into data where value commenceslen
- length in data to be considered- Returns:
- 1, or 0 if encoded value is not long enough
-
encode
protected void encode()
Computes the encoded form from the decoded form.- Specified by:
encode
in classAbstractLazyEncodedDataObject<byte[]>
-
decode
protected void decode() throws DecodeException
Computes the decoded form from the encoded form.- Specified by:
decode
in classAbstractLazyEncodedDataObject<byte[]>
- Throws:
DecodeException
- if not between 1 and 5 octets to be decoded
-
-