D
- the datatype of the attributepublic final class AttributeKey<D> extends MetadataKey<D>
equals(Object)
to another attribute key if
their IDs are equal and the datatypes are the same.matches(MetadataKey)
another attribute key if
the ID is a match for the ID of the other key, and the datatype is assignable
from the other key's datatype.Modifier and Type | Method and Description |
---|---|
int |
compareTo(MetadataKey<?> other)
Compares first on ID, then on datatype.
|
boolean |
equals(java.lang.Object obj) |
int |
hashCode() |
boolean |
matches(MetadataKey<?> other)
Returns
true if this key is a match for the given key. |
static AttributeKey<java.lang.String> |
of(QName id)
Construct and return a new attribute key with the default datatype of
String.
|
static <T> AttributeKey<T> |
of(QName id,
java.lang.Class<? extends T> datatype)
Construct and return a new attribute key with the given id and datatype.
|
java.lang.String |
toString() |
getDatatype, getId
public static AttributeKey<java.lang.String> of(QName id)
null
.public static <T> AttributeKey<T> of(QName id, java.lang.Class<? extends T> datatype)
null
, or a
NullPointerException
will be thrown.public boolean matches(MetadataKey<?> other)
true
if this key is a match for the given key. This key
is a match for the other key if the other key is also an attribute key and
if its ID and datatype match.matches
in class MetadataKey<D>
public int compareTo(MetadataKey<?> other)
public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public java.lang.String toString()
toString
in class MetadataKey<D>