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
    • Constructor Detail

      • CCVariablePart

        public CCVariablePart()
    • Method Detail

      • 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 class AbstractFieldsObject
        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