Class GenericNumberWithB
- java.lang.Object
-
- com.opencloud.util.AbstractDataObject
-
- com.opencloud.util.AbstractFieldsObject
-
- AbstractEncodedDataObject<T>
-
- AbstractLazyEncodedDataObject<byte[]>
-
- AbstractLazyEncodedByteArray
-
- com.opencloud.slee.resources.in.datatypes.cc.GenericNumber
-
- com.opencloud.slee.resources.in.datatypes.cc.GenericNumberWithB
-
- All Implemented Interfaces:
DataObject
,FastSerializable
,Serializable
public final class GenericNumberWithB extends GenericNumber
Class GenericNumberWithB represents a GenericNumber in which the additional character 'B' is permitted in the decoded form, encoding to 0xB.Each digit of the address field is encoded into a semi-octet, and if there is an odd number of digits then the last semi-octet is assigned a filler. Unless overridden by a particular
StringCodec
, the filler is 0 and the encoding to semi-octets is as tabulated below.Decoded character 0 1 2 3 4 5 6 7 8 9 B Encoded hexadecimal 0 1 2 3 4 5 6 7 8 9 A B C D E F - See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.opencloud.slee.resources.in.datatypes.cc.GenericNumber
GenericNumber.Nature, GenericNumber.NumberingPlan, GenericNumber.NumberQualifier, GenericNumber.Presentation, GenericNumber.Screening
-
-
Field Summary
Fields Modifier and Type Field Description static BCDStringCodec<GenericNumber>
ADDRESS_CODEC
BCD string codec for field Address.-
Fields inherited from class com.opencloud.slee.resources.in.datatypes.cc.GenericNumber
Address_value, Nature_value, NumberIncomplete_present, NumberIncomplete_value, NumberingPlan_value, NumberQualifier_value, Presentation_value, Screening_value
-
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 GenericNumberWithB()
Constructs a new GenericNumberWithB object with no fields set.GenericNumberWithB(byte[] data)
Constructs a new GenericNumberWithB object from network-encoded data.GenericNumberWithB(byte[] data, int start, int len)
Constructs a new GenericNumberWithB object from part of network-encoded data.GenericNumberWithB(GenericNumber.NumberQualifier numberQualifier, GenericNumber.Nature nature, boolean numberIncomplete, GenericNumber.NumberingPlan numberingPlan, GenericNumber.Presentation presentation, GenericNumber.Screening screening, String address)
Constructs a new GenericNumberWithB object from given values for all fields.GenericNumberWithB(GenericNumber.NumberQualifier numberQualifier, GenericNumber.Nature nature, boolean numberIncomplete, GenericNumber.NumberingPlan numberingPlan, GenericNumber.Presentation presentation, GenericNumber.Screening screening, String address, StringCodec<GenericNumber> Address_codec)
Constructs a new GenericNumberWithB object from given arguments, using the given codecs for encoding fields of type String.GenericNumberWithB(DataInput in)
Constructs a new GenericNumberWithB object from data deserialized from a stream that was written byGenericNumber.toStream(DataOutput)
.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static GenericNumberWithB
copyOf(GenericNumber 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.StringCodec<GenericNumber>
getAddressCodec()
Gets the codec used for field Address.GenericNumberWithB
setAddress(String value)
Sets the value of the number digits.GenericNumberWithB
setAddress(String value, StringCodec<GenericNumber> codec)
Sets the value of the number digits using the given codec.GenericNumberWithB
setAddressEncoded(EncodedStringWithIndicators encoded)
Sets the encoded value of the number digits to a clone of the given EncodedStringIndicators.GenericNumberWithB
setNature(GenericNumber.Nature value)
Sets the value of the nature of address indicator.GenericNumberWithB
setNumberIncomplete(boolean value)
Sets the value of the number incomplete indicator.GenericNumberWithB
setNumberIncompletePresent(boolean flag)
Sets the presence or absence of the field NumberIncomplete.GenericNumberWithB
setNumberingPlan(GenericNumber.NumberingPlan value)
Sets the value of the numbering plan indicator.GenericNumberWithB
setNumberQualifier(GenericNumber.NumberQualifier value)
Sets the value of the number qualifier indicator.GenericNumberWithB
setPresentation(GenericNumber.Presentation value)
Sets the value of the address presentation restricted indicator.GenericNumberWithB
setScreening(GenericNumber.Screening value)
Sets the value of the screening indicator.-
Methods inherited from class com.opencloud.slee.resources.in.datatypes.cc.GenericNumber
checkFieldsSet, clone, decode, encode, encodedIsInvalid, getAddress, getAddress, getAddressEncoded, getContainedLength, getEncodedForm, getFieldAccessors, getFieldsMap, getNature, getNumberIncomplete, getNumberingPlan, getNumberQualifier, getPresentation, getScreening, hasAddress, hasNature, hasNumberIncomplete, hasNumberingPlan, hasNumberQualifier, hasPresentation, hasScreening, toStream
-
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
-
ADDRESS_CODEC
public static final BCDStringCodec<GenericNumber> ADDRESS_CODEC
BCD string codec for field Address.
-
-
Constructor Detail
-
GenericNumberWithB
public GenericNumberWithB()
Constructs a new GenericNumberWithB object with no fields set.
-
GenericNumberWithB
public GenericNumberWithB(byte[] data)
Constructs a new GenericNumberWithB 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
-
GenericNumberWithB
public GenericNumberWithB(byte[] data, int start, int len)
Constructs a new GenericNumberWithB 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
-
GenericNumberWithB
public GenericNumberWithB(GenericNumber.NumberQualifier numberQualifier, GenericNumber.Nature nature, boolean numberIncomplete, GenericNumber.NumberingPlan numberingPlan, GenericNumber.Presentation presentation, GenericNumber.Screening screening, String address)
Constructs a new GenericNumberWithB object from given values for all fields.- Parameters:
numberQualifier
- the number qualifier indicatornature
- the nature of address indicatornumberIncomplete
- the number incomplete indicatornumberingPlan
- the numbering plan indicatorpresentation
- the address presentation restricted indicatorscreening
- the screening indicatoraddress
- the number digits
-
GenericNumberWithB
public GenericNumberWithB(GenericNumber.NumberQualifier numberQualifier, GenericNumber.Nature nature, boolean numberIncomplete, GenericNumber.NumberingPlan numberingPlan, GenericNumber.Presentation presentation, GenericNumber.Screening screening, String address, StringCodec<GenericNumber> Address_codec)
Constructs a new GenericNumberWithB object from given arguments, using the given codecs for encoding fields of type String.- Parameters:
numberQualifier
- the number qualifier indicatornature
- the nature of address indicatornumberIncomplete
- the number incomplete indicatornumberingPlan
- the numbering plan indicatorpresentation
- the address presentation restricted indicatorscreening
- the screening indicatoraddress
- the number digitsAddress_codec
- StringCodec for address
-
GenericNumberWithB
public GenericNumberWithB(DataInput in) throws IOException
Constructs a new GenericNumberWithB object from data deserialized from a stream that was written byGenericNumber.toStream(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
-
setNumberIncompletePresent
public GenericNumberWithB setNumberIncompletePresent(boolean flag) throws IllegalStateException
Sets the presence or absence of the field NumberIncomplete.- Overrides:
setNumberIncompletePresent
in classGenericNumber
- Parameters:
flag
- whether the field should be marked as present- Returns:
- this
- Throws:
IllegalStateException
- if this instance has been marked as read-only
-
setNumberQualifier
public GenericNumberWithB setNumberQualifier(GenericNumber.NumberQualifier value) throws IllegalStateException
Sets the value of the number qualifier indicator.- Overrides:
setNumberQualifier
in classGenericNumber
- Parameters:
value
- NumberQualifier representation of the number qualifier indicator- Returns:
- this
- Throws:
IllegalStateException
-
setNature
public GenericNumberWithB setNature(GenericNumber.Nature value) throws IllegalStateException
Sets the value of the nature of address indicator.- Overrides:
setNature
in classGenericNumber
- Parameters:
value
- Nature representation of the nature of address indicator- Returns:
- this
- Throws:
IllegalStateException
-
setNumberIncomplete
public GenericNumberWithB setNumberIncomplete(boolean value) throws IllegalStateException
Sets the value of the number incomplete indicator.- Overrides:
setNumberIncomplete
in classGenericNumber
- Parameters:
value
- boolean representation of the number incomplete indicator- Returns:
- this
- Throws:
IllegalStateException
-
setNumberingPlan
public GenericNumberWithB setNumberingPlan(GenericNumber.NumberingPlan value) throws IllegalStateException
Sets the value of the numbering plan indicator.- Overrides:
setNumberingPlan
in classGenericNumber
- Parameters:
value
- NumberingPlan representation of the numbering plan indicator- Returns:
- this
- Throws:
IllegalStateException
-
setPresentation
public GenericNumberWithB setPresentation(GenericNumber.Presentation value) throws IllegalStateException
Sets the value of the address presentation restricted indicator.- Overrides:
setPresentation
in classGenericNumber
- Parameters:
value
- Presentation representation of the address presentation restricted indicator- Returns:
- this
- Throws:
IllegalStateException
-
setScreening
public GenericNumberWithB setScreening(GenericNumber.Screening value) throws IllegalStateException
Sets the value of the screening indicator.- Overrides:
setScreening
in classGenericNumber
- Parameters:
value
- Screening representation of the screening indicator- Returns:
- this
- Throws:
IllegalStateException
-
setAddress
public GenericNumberWithB setAddress(String value) throws IllegalStateException
Sets the value of the number digits.- Overrides:
setAddress
in classGenericNumber
- Parameters:
value
- String representation of the number digits- Returns:
- this
- Throws:
IllegalStateException
-
setAddress
public GenericNumberWithB setAddress(String value, StringCodec<GenericNumber> codec) throws IllegalArgumentException
Sets the value of the number digits using the given codec. If the given codec is null, uses the standard codec.- Overrides:
setAddress
in classGenericNumber
- Parameters:
value
- String representation of the number digitscodec
- StringCodec to use for encoding- Returns:
- this
- Throws:
IllegalArgumentException
-
setAddressEncoded
public GenericNumberWithB setAddressEncoded(EncodedStringWithIndicators encoded)
Sets the encoded value of the number digits to a clone of the given EncodedStringIndicators.- Overrides:
setAddressEncoded
in classGenericNumber
- Parameters:
encoded
- EncodedStringWithIndicators representation of the number digits- Returns:
- this
-
copyOf
public static GenericNumberWithB copyOf(GenericNumber 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:
- GenericNumberWithB
-
getAddressCodec
public StringCodec<GenericNumber> getAddressCodec()
Gets the codec used for field Address.- Overrides:
getAddressCodec
in classGenericNumber
- Returns:
- StringCodec
-
-