|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.google.gdata.model.MetadataKey<D>
com.google.gdata.model.ElementKey<D,E>
D - the datatype of the elementE - the element type of the elementpublic final class ElementKey<D,E extends Element>
A key referring to a particular element. Holds the ID of the element and the expected datatype and element type. Element keys support value-based equality, natural ordering, and matching.
equals(Object) to another element key if their
IDs are equivalent or both null, and their datatypes, and element
types are the same.matches(MetadataKey) another element key if the
ID is a match for the ID of the other key, and the datatype and element type
are both assignable from the other key's datatype and element type.
| Method Summary | ||
|---|---|---|
int |
compareTo(MetadataKey<?> other)
Compares first on ID, then on element type, then on datatype. |
|
boolean |
equals(java.lang.Object obj)
|
|
java.lang.Class<? extends E> |
getElementType()
Returns the element type of the element. |
|
int |
hashCode()
|
|
boolean |
matches(MetadataKey<?> other)
Returns true if this key is a match for the given key. |
|
static ElementKey<java.lang.String,Element> |
of(QName id)
Return a default element key using a string datatype and Element as the element type. |
|
static
|
of(QName id,
java.lang.Class<? extends T> datatype,
java.lang.Class<? extends V> elementType)
Construct an element key with the given id, datatype, and element type. |
|
static
|
of(QName id,
java.lang.Class<? extends V> elementType)
Construct an element key with the given id and element type, but with a Void datatype. |
|
java.lang.String |
toString()
|
|
| Methods inherited from class com.google.gdata.model.MetadataKey |
|---|
getDatatype, getId |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Method Detail |
|---|
public static ElementKey<java.lang.String,Element> of(QName id)
Element as the element type. The id must not be null.
public static <V extends Element> ElementKey<java.lang.Void,V> of(QName id,
java.lang.Class<? extends V> elementType)
Void datatype. This is used for elements without text content.
The elementType must not be null. A null id is only
valid for element types that are a subclass of Element, and are
used as a key referring to all instances of that element type.
public static <T,V extends Element> ElementKey<T,V> of(QName id,
java.lang.Class<? extends T> datatype,
java.lang.Class<? extends V> elementType)
The elementType must not be null. A null id is only
valid for element types that are a subclass of Element, and are
used as a key referring to all instances of that element type.
public java.lang.Class<? extends E> getElementType()
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 element key and if
the ID, datatype, and element types all match.
matches in class MetadataKey<D>public int compareTo(MetadataKey<?> other)
public int hashCode()
hashCode in class java.lang.Objectpublic boolean equals(java.lang.Object obj)
equals in class java.lang.Objectpublic java.lang.String toString()
toString in class MetadataKey<D>
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||