Class CCVariablePart
-
- All Implemented Interfaces:
DataObject
,Serializable
public class CCVariablePart extends AbstractFieldsObject
API for CC-DataTypes.VariablePart. Generated from the following ASN.1 type definition and the adaptations below.VariablePart ::= CHOICE { integer Integer4, number Digits, time OCTET STRING, date OCTET STRING, price OCTET STRING } CC-DataTypes { VariablePart { @extendible date { @encodeMethod getInapEncodedForm @import com.opencloud.slee.resources.in.datatypes.cc.YearMonthDay } number { @import com.opencloud.slee.resources.in.datatypes.cc.GenericDigits } price { @import com.opencloud.slee.resources.in.datatypes.cc.PriceInHundredthsOfUnits } time { @import com.opencloud.slee.resources.in.datatypes.cc.HourMinute } } }
Used in array as field type by
CCMessageID.VariableMessage
.- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
CCVariablePart.Choice
API for CC-DataTypes.VariablePart.Choice.
-
Field Summary
-
Fields inherited from class com.opencloud.util.AbstractFieldsObject
FIELD_ABSENT, FIELD_UNINITIALISED
-
-
Constructor Summary
Constructors Constructor Description CCVariablePart()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description CCVariablePart
clone()
Constructs a copy of this object and everything reachable from it.static CCVariablePart
copyOf(CCVariablePart 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.CCVariablePart.Choice
getChoice()
Gets the discriminant of the current choice.YearMonthDay
getDate()
Gets the value of the date choice.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 associated-value.int
getInteger()
Gets the value of the integer choice.GenericDigits
getNumber()
Gets the value of the number choice.PriceInHundredthsOfUnits
getPrice()
Gets the value of the price choice.HourMinute
getTime()
Gets the value of the time choice.boolean
isDateChosen()
Tests whether the choice is date.boolean
isIntegerChosen()
Tests whether the choice is integer.boolean
isNumberChosen()
Tests whether the choice is number.boolean
isPriceChosen()
Tests whether the choice is price.boolean
isTimeChosen()
Tests whether the choice is time.protected void
setChoice(CCVariablePart.Choice arg)
Sets the discriminant of the current choice.CCVariablePart
setDate(YearMonthDay value)
Sets the value of the date choice.CCVariablePart
setInteger(int value)
Sets the value of the integer choice.CCVariablePart
setNumber(GenericDigits value)
Sets the value of the number choice.CCVariablePart
setPrice(PriceInHundredthsOfUnits value)
Sets the value of the price choice.void
setReadOnly()
Sets this and all its fields to be immutable.CCVariablePart
setTime(HourMinute value)
Sets the value of the time choice.-
Methods inherited from class com.opencloud.util.AbstractFieldsObject
equals, hashCode, toString
-
Methods inherited from class com.opencloud.util.AbstractDataObject
checkModify, isReadOnly
-
-
-
-
Method Detail
-
clone
public CCVariablePart 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
-
copyOf
public static CCVariablePart copyOf(CCVariablePart 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:
- CCVariablePart
-
getChoice
public CCVariablePart.Choice getChoice()
Gets the discriminant of the current choice.- Returns:
- the current discriminant
-
getDate
public YearMonthDay getDate()
Gets the value of the date choice.- Returns:
- value of the choice, if choice is date, else null
-
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 :discriminant-name to associated-value. For a value of primitive type, the value is boxed. If choice is not set, returns a map from : to AbstractFieldsObject.FIELD_UNINITIALISED.- Specified by:
getFieldsMap
in classAbstractFieldsObject
- Parameters:
withAbsents
- ignored, as value cannot be optional- Returns:
- Map from :discriminant-name to associated-value
-
getInteger
public int getInteger() throws IllegalStateException
Gets the value of the integer choice.- Returns:
- value of the choice, if choice is integer
- Throws:
IllegalStateException
- if choice is not integer
-
getNumber
public GenericDigits getNumber()
Gets the value of the number choice.- Returns:
- value of the choice, if choice is number, else null
-
getPrice
public PriceInHundredthsOfUnits getPrice()
Gets the value of the price choice.- Returns:
- value of the choice, if choice is price, else null
-
getTime
public HourMinute getTime()
Gets the value of the time choice.- Returns:
- value of the choice, if choice is time, else null
-
isDateChosen
public boolean isDateChosen()
Tests whether the choice is date.- Returns:
- true if chosen, false if not
-
isIntegerChosen
public boolean isIntegerChosen()
Tests whether the choice is integer.- Returns:
- true if chosen, false if not
-
isNumberChosen
public boolean isNumberChosen()
Tests whether the choice is number.- Returns:
- true if chosen, false if not
-
isPriceChosen
public boolean isPriceChosen()
Tests whether the choice is price.- Returns:
- true if chosen, false if not
-
isTimeChosen
public boolean isTimeChosen()
Tests whether the choice is time.- Returns:
- true if chosen, false if not
-
setChoice
protected void setChoice(CCVariablePart.Choice arg)
Sets the discriminant of the current choice.- Parameters:
arg
- the new discriminant
-
setDate
public CCVariablePart setDate(YearMonthDay value) throws IllegalStateException, NullPointerException
Sets the value of the date choice.- Parameters:
value
- the new value for the choice- Returns:
- this
- Throws:
IllegalStateException
- if this instance has been marked as read-onlyNullPointerException
- if the given value is null
-
setInteger
public CCVariablePart setInteger(int value) throws IllegalStateException
Sets the value of the integer choice.- Parameters:
value
- the new value for the choice- Returns:
- this
- Throws:
IllegalStateException
- if this instance has been marked as read-only
-
setNumber
public CCVariablePart setNumber(GenericDigits value) throws IllegalStateException, NullPointerException
Sets the value of the number choice.- Parameters:
value
- the new value for the choice- Returns:
- this
- Throws:
IllegalStateException
- if this instance has been marked as read-onlyNullPointerException
- if the given value is null
-
setPrice
public CCVariablePart setPrice(PriceInHundredthsOfUnits value) throws IllegalStateException, NullPointerException
Sets the value of the price choice.- Parameters:
value
- the new value for the choice- Returns:
- this
- Throws:
IllegalStateException
- if this instance has been marked as read-onlyNullPointerException
- if the given value is null
-
setReadOnly
public void setReadOnly()
Sets this and all its fields to be immutable.- Specified by:
setReadOnly
in interfaceDataObject
- Overrides:
setReadOnly
in classAbstractDataObject
-
setTime
public CCVariablePart setTime(HourMinute value) throws IllegalStateException, NullPointerException
Sets the value of the time choice.- Parameters:
value
- the new value for the choice- Returns:
- this
- Throws:
IllegalStateException
- if this instance has been marked as read-onlyNullPointerException
- if the given value is null
-
-