com.google.gdata.model
Class Attribute

java.lang.Object
  extended by com.google.gdata.model.Attribute

public final class Attribute
extends java.lang.Object

A data attribute in an instance document. Contains the key that identifies the attribute (name + type) and the value of the attribute.


Method Summary
 AttributeKey<?> getAttributeKey()
          Returns the attribute key of this attribute.
 java.lang.Object getValue()
          Returns the untyped attribute value.
 boolean isLocked()
          Returns true if this attribute has been locked using lock().
 Attribute lock()
          Locks this attribute.
 Attribute setValue(java.lang.Object value)
          Sets the value of the attribute.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

isLocked

public boolean isLocked()
Returns true if this attribute has been locked using lock(). Once an attribute has been locked it cannot be unlocked.


lock

public Attribute lock()
Locks this attribute. Once an attribute has been locked its value cannot be modified.


getAttributeKey

public AttributeKey<?> getAttributeKey()
Returns the attribute key of this attribute.


getValue

public java.lang.Object getValue()
Returns the untyped attribute value.

Returns:
untyped attribute value

setValue

public Attribute setValue(java.lang.Object value)
Sets the value of the attribute.

Parameters:
value - attribute value
Throws:
java.lang.NullPointerException - if the value was null
java.lang.IllegalArgumentException - if the value is not of a valid type
java.lang.IllegalStateException - if this attribute is locked

toString

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