public final class

AttributeKey

extends MetadataKey<D>
java.lang.Object
   ↳ com.google.gdata.model.MetadataKey<D>
     ↳ com.google.gdata.model.AttributeKey<D>

Class Overview

A key referring to a particular attribute. Holds the ID of the attribute and the expected datatype. Attribute keys support value-based equality, natural ordering, and matching.

  • An attribute key is equals(Object) to another attribute key if their IDs are equal and the datatypes are the same.
  • An attribute key's natural ordering is based first on name and then on datatype.
  • An attribute key 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.

Summary

[Expand]
Inherited Fields
From class com.google.gdata.model.MetadataKey
Public Methods
int compareTo(MetadataKey<?> other)
Compares first on ID, then on datatype.
boolean equals(Object obj)
int hashCode()
boolean matches(MetadataKey<?> other)
Returns true if this key is a match for the given key.
static AttributeKey<String> of(QName id)
Construct and return a new attribute key with the default datatype of String.
static <T> AttributeKey<T> of(QName id, Class<? extends T> datatype)
Construct and return a new attribute key with the given id and datatype.
String toString()
[Expand]
Inherited Methods
From class com.google.gdata.model.MetadataKey
From class java.lang.Object
From interface java.lang.Comparable

Public Methods

public int compareTo (MetadataKey<?> other)

Compares first on ID, then on datatype.

Parameters
other

public boolean equals (Object obj)

Parameters
obj

public int hashCode ()

public boolean matches (MetadataKey<?> other)

Returns 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.

Parameters
other

public static AttributeKey<String> of (QName id)

Construct and return a new attribute key with the default datatype of String. The id must not be null.

Parameters
id

public static AttributeKey<T> of (QName id, Class<? extends T> datatype)

Construct and return a new attribute key with the given id and datatype. Both id and datatype must not be null, or a NullPointerException will be thrown.

Parameters
id
datatype

public String toString ()