Class AbstractFieldsObject

    • Field Detail

      • FIELD_ABSENT

        public static final Object FIELD_ABSENT
        Unique non-null value to represent the absence of an optional field in Maps.
      • FIELD_UNINITIALISED

        public static final Object FIELD_UNINITIALISED
        Unique non-null value to represent an uninitialized mandatory field in Maps.
    • Constructor Detail

      • AbstractFieldsObject

        public AbstractFieldsObject()
    • Method Detail

      • getFieldsMap

        public abstract Map<String,​Object> getFieldsMap​(boolean withAbsents)
        Gets a Map from field-name to field-value for all fields defined by the concrete subclass of AbstractFieldsObject in use. A CHOICE should be distinguished from a SEQUENCE by the sole name/value pair having the character : prefixed on its name.

        For a field of primitive type, the field-value should be boxed.

        If withAbsents == true, then absent optional fields should also be included with a field-value of FIELD_ABSENT. Otherwise, absent fields should be omitted from the map entirely.

        Uninitialised mandatory fields should be included with a field-value of FIELD_UNINITIALISED. This includes an uninitialised choice.

        Parameters:
        withAbsents - whether to put absent optional fields into Map
        Returns:
        Map from field-name to field-value
      • toString

        public String toString()
        Stringize this AbstractFieldsObject to ASN.1 value notation. If a SEQUENCE, then a list of comma-separated name/value pairs, surrounded by curly braces:
         { field1Name field1Value, field2Name field2Value, ...., fieldNName fieldNValue }
        
        If a CHOICE, then a labelled value:
         label : value.
        

        Field values are stringized in a form that depends on their type:

        • for byte[]: 'C0FFEE'H (ASN.1 OCTET STRING hstring syntax)
        • for other arrays: { a, b, c, d } (ASN.1 SEQUENCE OF syntax)
        • for all other types: their toString() representation

        Absent optional fields are not included in the stringized form.

        Uninitialised mandatory fields are shown as "-- UNINITIALISED --". This includes an uninitialised choice.

        Overrides:
        toString in class Object
        Returns:
        a string representation of this instance
      • equals

        public boolean equals​(Object obj)
        Compares some other Object to this one for equality by value (not reference). The objects are considered equal iff they have the same field-values, regardless of whether the objects are of the same ASN.1 type.
        Overrides:
        equals in class Object
        Returns:
        whether the given Object is an AbstractFieldsObject with the same field-values
      • hashCode

        public int hashCode()
        Returns a hash code value for this object.
        Overrides:
        hashCode in class Object
        Returns:
        hash code