public class ImmutableDescriptor extends Object implements Descriptor
Modifier and Type | Field and Description |
---|---|
static ImmutableDescriptor |
EMPTY_DESCRIPTOR
An empty descriptor.
|
Constructor and Description |
---|
ImmutableDescriptor(Map<String,?> fields)
Construct a descriptor where the names and values of the fields
are the keys and values of the given Map.
|
ImmutableDescriptor(String... fields)
Construct a descriptor containing the given fields.
|
ImmutableDescriptor(String[] fieldNames,
Object[] fieldValues)
Construct a descriptor containing the given fields and values.
|
Modifier and Type | Method and Description |
---|---|
Descriptor |
clone()
Returns a descriptor which is equal to this descriptor.
|
boolean |
equals(Object o)
Compares this descriptor to the given object.
|
String[] |
getFieldNames()
Returns all the field names in the descriptor.
|
String[] |
getFields()
Returns all of the fields contained in this descriptor as a string array.
|
Object |
getFieldValue(String fieldName)
Returns the value for a specific field name, or null if no value
is present for that name.
|
Object[] |
getFieldValues(String... fieldNames)
Returns all the field values in the descriptor as an array of Objects.
|
int |
hashCode()
Returns the hash code value for this descriptor.
|
boolean |
isValid()
Returns true if all of the fields have legal values given their
names.
|
void |
removeField(String fieldName)
Removes a field from the descriptor.
|
void |
setField(String fieldName,
Object fieldValue)
This operation is unsupported since this class is immutable.
|
void |
setFields(String[] fieldNames,
Object[] fieldValues)
This operation is unsupported since this class is immutable.
|
String |
toString()
Returns a string representation of the object.
|
static ImmutableDescriptor |
union(Descriptor... descriptors)
Return an
ImmutableDescriptor whose contents are the union of
the given descriptors. |