Modifier and Type | Field and Description |
---|---|
public static final ImmutableDescriptor | EMPTY_DESCRIPTOR
An empty descriptor. |
private transient int | |
private final String[] | names
The names of the fields in this ImmutableDescriptor with their original case. |
private static final long | |
private final Object[] | values
The values of the fields in this ImmutableDescriptor. |
Access | Constructor and Description |
---|---|
public | ImmutableDescriptor(String[]
the field names fieldNames, Object[] the field values fieldValues)Construct a descriptor containing the given fields and values. |
public | ImmutableDescriptor(String...
the field names fields)Construct a descriptor containing the given fields. |
public | ImmutableDescriptor(Map<String, ?>
the field names and values fields)Construct a descriptor where the names and values of the fields are the keys and values of the given Map. |
Modifier and Type | Method and Description |
---|---|
private static void | |
public Descriptor | clone()
Overrides java. Implements javax. Returns a descriptor which is equal to this descriptor. |
public boolean | Returns: true if the objects are the same; false
otherwise.the object to compare with. o)Overrides java. Implements javax. Compares this descriptor to the given object. |
private int | |
private static int | |
public final String[] | getFieldNames()
Implements javax. Returns all the field names in the descriptor. |
public final String[] | getFields()
Implements javax. Returns all of the fields contained in this descriptor as a string array. |
public final Object | getFieldValue(String
the field name. fieldName)Implements javax. Returns the value for a specific field name, or null if no value is present for that name. |
public final Object[] | getFieldValues(String...
String array of the names of the fields that
the values should be returned for. If the array is empty then
an empty array will be returned. If the array is null then all
values will be returned, as if the parameter were the array
returned by fieldNames)getFieldNames() . If a field name in the
array does not exist, including the case where it is null or
the empty string, then null is returned for the matching array
element being returned.Implements javax. Returns all the field values in the descriptor as an array of Objects. |
public int | Returns: A hash code value for this object.Overrides java. Implements javax. Returns the hash code value for this descriptor. |
private static void | |
private static boolean | |
public boolean | Returns: true if the values are legal.Implements javax. Returns true if all of the fields have legal values given their names. |
private static SortedMap | |
private static SortedMap | |
pack-priv static Descriptor | |
private Object | Returns: the replacement object, which may bethis .This method can replace a deserialized instance of this class with another instance. |
public final void | removeField(String
String name of the field to be removed.
If the field name is illegal or the field is not found,
no exception is thrown. fieldName)Implements javax. Removes a field from the descriptor. |
public final void | setField(String
The field name to be set. Cannot be null or empty. fieldName, Object The field value to be set for the field
name. Can be null if that is a valid value for the field. fieldValue)Implements javax. This operation is unsupported since this class is immutable. |
public final void | setFields(String[]
String array of field names. The array and array
elements cannot be null. fieldNames, Object[] Object array of the corresponding field values.
The array cannot be null. Elements of the array can be null. fieldValues)Implements javax. This operation is unsupported since this class is immutable. |
public String | |
public static ImmutableDescriptor | Returns: anImmutableDescriptor that is the union of the given
descriptors. The returned object may be identical to one of the
input descriptors if it is an ImmutableDescriptor that contains all of
the required fields.the descriptors to be combined. Any of the
descriptors can be null, in which case it is skipped. descriptors)Return an |
private static void |
EMPTY_DESCRIPTOR | back to summary |
---|---|
public static final ImmutableDescriptor EMPTY_DESCRIPTOR An empty descriptor. |
hashCode | back to summary |
---|---|
private transient int hashCode |
names | back to summary |
---|---|
private final String[] names The names of the fields in this ImmutableDescriptor with their
original case. The names must be in alphabetical order as determined
by |
serialVersionUID | back to summary |
---|---|
private static final long serialVersionUID |
values | back to summary |
---|---|
private final Object[] values The values of the fields in this ImmutableDescriptor. The
elements in this array match the corresponding elements in the
|
ImmutableDescriptor | back to summary |
---|---|
public ImmutableDescriptor(String[] fieldNames, Object[] fieldValues) Construct a descriptor containing the given fields and values.
|
ImmutableDescriptor | back to summary |
---|---|
public ImmutableDescriptor(String... fields) Construct a descriptor containing the given fields. Each String
must be of the form
|
ImmutableDescriptor | back to summary |
---|---|
public ImmutableDescriptor(Map<String, ?> fields) Construct a descriptor where the names and values of the fields are the keys and values of the given Map.
|
checkIllegalFieldName | back to summary |
---|---|
private static void checkIllegalFieldName(String name) |
clone | back to summary |
---|---|
public Descriptor clone() Overrides java. Implements javax. Returns a descriptor which is equal to this descriptor. Changes to the returned descriptor will have no effect on this descriptor, and vice versa. This method returns the object on which it is called. A subclass can override it to return another object provided the contract is respected.
|
equals | back to summary |
---|---|
public boolean equals(Object o) Overrides java. Implements javax. Compares this descriptor to the given object. The objects are equal if the given object is also a Descriptor, and if the two Descriptors have the same field names (possibly differing in case) and the same associated values. The respective values for a field in the two Descriptors are equal if the following conditions hold:
|
fieldIndex | back to summary |
---|---|
private int fieldIndex(String name) |
findNonEmpty | back to summary |
---|---|
private static int findNonEmpty(Descriptor[] ds, int start) |
getFieldNames | back to summary |
---|---|
public final String[] getFieldNames() Implements javax. Doc from javax. Returns all the field names in the descriptor.
|
getFields | back to summary |
---|---|
public final String[] getFields() Implements javax. Doc from javax. Returns all of the fields contained in this descriptor as a string array.
|
getFieldValue | back to summary |
---|---|
public final Object getFieldValue(String fieldName) Implements javax. Doc from javax. Returns the value for a specific field name, or null if no value is present for that name. |
getFieldValues | back to summary |
---|---|
public final Object[] getFieldValues(String... fieldNames) Implements javax. Doc from javax. Returns all the field values in the descriptor as an array of Objects. The
returned values are in the same order as the
|
hashCode | back to summary |
---|---|
public int hashCode() Overrides java. Implements javax. Returns the hash code value for this descriptor. The hash
code is computed as the sum of the hash codes for each field in
the descriptor. The hash code of a field with name
|
illegal | back to summary |
---|---|
private static void illegal(String message) |
isEmpty | back to summary |
---|---|
private static boolean isEmpty(Descriptor d) |
isValid | back to summary |
---|---|
public boolean isValid() Implements javax. Returns true if all of the fields have legal values given their names. This method always returns true, but a subclass can override it to return false when appropriate.
|
makeMap | back to summary |
---|---|
private static SortedMap |
makeMap | back to summary |
---|---|
private static SortedMap |
nonNullDescriptor | back to summary |
---|---|
pack-priv static Descriptor nonNullDescriptor(Descriptor d) |
readResolve | back to summary |
---|---|
private Object readResolve() throws InvalidObjectException This method can replace a deserialized instance of this
class with another instance. For example, it might replace
a deserialized empty ImmutableDescriptor with
|
removeField | back to summary |
---|---|
public final void removeField(String fieldName) Implements javax. Removes a field from the descriptor.
|
setField | back to summary |
---|---|
public final void setField(String fieldName, Object fieldValue) throws RuntimeOperationsException Implements javax. This operation is unsupported since this class is immutable. If
this call would change a mutable descriptor with the same contents,
then a
|
setFields | back to summary |
---|---|
public final void setFields(String[] fieldNames, Object[] fieldValues) throws RuntimeOperationsException Implements javax. This operation is unsupported since this class is immutable. If
this call would change a mutable descriptor with the same contents,
then a
|
toString | back to summary |
---|---|
public String toString() Overrides java. Doc from java. Returns a string representation of the object.
Satisfying this method's contract implies a non- |
union | back to summary |
---|---|
public static ImmutableDescriptor union(Descriptor... descriptors) Return an In the simplest case, there is only one descriptor and the
returned Descriptor d = something(); ImmutableDescriptor copy = ImmutableDescriptor.union(d);
|
unsupported | back to summary |
---|---|
private static void unsupported() |