public abstract class AbstractFieldsObject extends AbstractDataObject
equals(),
hashCode() and toString() are defined in terms of
fields' names and values.| Modifier and Type | Field and Description |
|---|---|
static Object |
FIELD_ABSENT
Unique non-null value to represent the absence of an optional field in Maps.
|
static Object |
FIELD_UNINITIALISED
Unique non-null value to represent an uninitialized mandatory field in Maps.
|
| Constructor and Description |
|---|
AbstractFieldsObject() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object obj)
Compares some other Object to this one for equality by value (not reference).
|
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.
|
int |
hashCode()
Returns a hash code value for this object.
|
String |
toString()
Stringize this AbstractFieldsObject to ASN.1 value notation.
|
checkModify, clone, isReadOnly, setReadOnlypublic static final Object FIELD_ABSENT
public static final Object FIELD_UNINITIALISED
public abstract Map<String,Object> getFieldsMap(boolean withAbsents)
: 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.
withAbsents - whether to put absent optional fields into Mappublic String toString()
{ 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:
'C0FFEE'H (ASN.1 OCTET STRING hstring syntax)
{ a, b, c, d } (ASN.1 SEQUENCE OF syntax)
Absent optional fields are not included in the stringized form.
Uninitialised mandatory fields are shown as "-- UNINITIALISED --". This includes an uninitialised choice.
public boolean equals(Object obj)