public class CCVariablePart extends AbstractFieldsObject
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
.
Modifier and Type | Class and Description |
---|---|
static class |
CCVariablePart.Choice
API for CC-DataTypes.VariablePart.Choice.
|
FIELD_ABSENT, FIELD_UNINITIALISED
Constructor and Description |
---|
CCVariablePart() |
Modifier and Type | Method and 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.
|
equals, hashCode, toString
checkModify, isReadOnly
public CCVariablePart clone()
clone
in interface DataObject
clone
in class AbstractDataObject
public static CCVariablePart copyOf(CCVariablePart from)
from
- the object from which to copypublic CCVariablePart.Choice getChoice()
public YearMonthDay getDate()
public static FieldAccessor[] getFieldAccessors()
public Map<String,Object> getFieldsMap(boolean withAbsents)
getFieldsMap
in class AbstractFieldsObject
withAbsents
- ignored, as value cannot be optionalpublic int getInteger() throws IllegalStateException
IllegalStateException
- if choice is not integerpublic GenericDigits getNumber()
public PriceInHundredthsOfUnits getPrice()
public HourMinute getTime()
public boolean isDateChosen()
public boolean isIntegerChosen()
public boolean isNumberChosen()
public boolean isPriceChosen()
public boolean isTimeChosen()
protected void setChoice(CCVariablePart.Choice arg)
arg
- the new discriminantpublic CCVariablePart setDate(YearMonthDay value) throws IllegalStateException, NullPointerException
value
- the new value for the choiceIllegalStateException
- if this instance has been marked as read-onlyNullPointerException
- if the given value is nullpublic CCVariablePart setInteger(int value) throws IllegalStateException
value
- the new value for the choiceIllegalStateException
- if this instance has been marked as read-onlypublic CCVariablePart setNumber(GenericDigits value) throws IllegalStateException, NullPointerException
value
- the new value for the choiceIllegalStateException
- if this instance has been marked as read-onlyNullPointerException
- if the given value is nullpublic CCVariablePart setPrice(PriceInHundredthsOfUnits value) throws IllegalStateException, NullPointerException
value
- the new value for the choiceIllegalStateException
- if this instance has been marked as read-onlyNullPointerException
- if the given value is nullpublic void setReadOnly()
setReadOnly
in interface DataObject
setReadOnly
in class AbstractDataObject
public CCVariablePart setTime(HourMinute value) throws IllegalStateException, NullPointerException
value
- the new value for the choiceIllegalStateException
- if this instance has been marked as read-onlyNullPointerException
- if the given value is null