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 classCCVariablePart.ChoiceAPI 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 CCVariablePartclone()Constructs a copy of this object and everything reachable from it.static CCVariablePartcopyOf(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.ChoicegetChoice()Gets the discriminant of the current choice.YearMonthDaygetDate()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.intgetInteger()Gets the value of the integer choice.GenericDigitsgetNumber()Gets the value of the number choice.PriceInHundredthsOfUnitsgetPrice()Gets the value of the price choice.HourMinutegetTime()Gets the value of the time choice.booleanisDateChosen()Tests whether the choice is date.booleanisIntegerChosen()Tests whether the choice is integer.booleanisNumberChosen()Tests whether the choice is number.booleanisPriceChosen()Tests whether the choice is price.booleanisTimeChosen()Tests whether the choice is time.protected voidsetChoice(CCVariablePart.Choice arg)Sets the discriminant of the current choice.CCVariablePartsetDate(YearMonthDay value)Sets the value of the date choice.CCVariablePartsetInteger(int value)Sets the value of the integer choice.CCVariablePartsetNumber(GenericDigits value)Sets the value of the number choice.CCVariablePartsetPrice(PriceInHundredthsOfUnits value)Sets the value of the price choice.voidsetReadOnly()Sets this and all its fields to be immutable.CCVariablePartsetTime(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:
clonein interfaceDataObject- Specified by:
clonein 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:
getFieldsMapin classAbstractFieldsObject- Parameters:
withAbsents- ignored, as value cannot be optional- Returns:
- Map from :discriminant-name to associated-value
-
getInteger
public int getInteger() throws IllegalStateExceptionGets 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:
setReadOnlyin interfaceDataObject- Overrides:
setReadOnlyin 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
-
-