Class CS1CounterAndValue

    • Constructor Detail

      • CS1CounterAndValue

        public CS1CounterAndValue()
        Constructs an object with uninitialised state.
      • CS1CounterAndValue

        public CS1CounterAndValue​(int CounterID_param,
                                  int CounterValue_param)
        Constructs an object from given values for all fields.
        Parameters:
        CounterID_param - value for that field
        CounterValue_param - value for that field
    • Method Detail

      • copyOf

        public static CS1CounterAndValue copyOf​(CS1CounterAndValue 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:
        CS1CounterAndValue
      • getCounterID

        public int getCounterID()
        Gets the value of the field counterID.
        Returns:
        value of field counterID
      • getCounterValue

        public int getCounterValue()
        Gets the value of the field counterValue.
        Returns:
        value of field counterValue
      • 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 field-name to field-value. For a field of primitive type, the field-value is boxed. For an absent optional field, the field-value is AbstractFieldsObject.FIELD_ABSENT. For an unitialised mandatory field, the field-value is AbstractFieldsObject.FIELD_UNINITIALISED.
        Specified by:
        getFieldsMap in class AbstractFieldsObject
        Parameters:
        withAbsents - whether to put absent optional fields into Map
        Returns:
        Map from field-name to field-value
      • hasCounterID

        public boolean hasCounterID()
        Tests whether the field counterID has a value.
        Returns:
        whether the field counterID has a value
      • hasCounterValue

        public boolean hasCounterValue()
        Tests whether the field counterValue has a value.
        Returns:
        whether the field counterValue has a value
      • setCounterID

        public CS1CounterAndValue setCounterID​(int value)
                                        throws IllegalStateException
        Sets the value of the field counterID and marks the field as present.
        Parameters:
        value - the new value for the field
        Returns:
        this
        Throws:
        IllegalStateException - if this instance has been marked as read-only
      • setCounterValue

        public CS1CounterAndValue setCounterValue​(int value)
                                           throws IllegalStateException
        Sets the value of the field counterValue and marks the field as present.
        Parameters:
        value - the new value for the field
        Returns:
        this
        Throws:
        IllegalStateException - if this instance has been marked as read-only