com.google.gdata.model
Class MetadataKey<D>

java.lang.Object
  extended by com.google.gdata.model.MetadataKey<D>
Type Parameters:
D - the datatype of this key
All Implemented Interfaces:
java.lang.Comparable<MetadataKey<?>>
Direct Known Subclasses:
AttributeKey, ElementKey

public abstract class MetadataKey<D>
extends java.lang.Object
implements java.lang.Comparable<MetadataKey<?>>

A key representing a particular metadata instance. All metadata keys have at least an ID and a datatype. Metadata keys have a natural ordering based first on key type, then on the natural ordering within that key type. Metadata keys also support equivalence and matching, both of which are defined by subtypes. See AttributeKey and ElementKey for the details.


Method Summary
 java.lang.Class<? extends D> getDatatype()
          Returns the datatype of the property.
 QName getId()
          Returns the id of the property.
abstract  boolean matches(MetadataKey<?> other)
          Returns true if this key matches the given key.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.lang.Comparable
compareTo
 

Method Detail

getId

public QName getId()
Returns the id of the property. This is the canonical name of the property, and will stay the same across transforms and contexts. It is based on the XML schema for the atom representation.

Returns:
the unique identifier of the property.

getDatatype

public java.lang.Class<? extends D> getDatatype()
Returns the datatype of the property. This the type of the attribute value or the text content of an element.

Returns:
the datatype of the property

matches

public abstract boolean matches(MetadataKey<?> other)
Returns true if this key matches the given key.


toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object