com.google.gdata.model.gd
Class CustomProperty

java.lang.Object
  extended by com.google.gdata.model.Element
      extended by com.google.gdata.model.gd.CustomProperty

public class CustomProperty
extends Element

Name-value pair with optional type and unit.


Field Summary
static ElementKey<java.lang.String,CustomProperty> KEY
          The key for this element.
static AttributeKey<java.lang.String> NAME
          Can be a URI to indicate a specific ontology.
static AttributeKey<java.lang.String> TYPE
          Datatype such as string, integer, and date, or an ontology-specific URI.
static AttributeKey<java.lang.String> UNIT
          Units of data - can also be a URI to indicate a specific ontology.
 
Constructor Summary
  CustomProperty()
          Constructs an instance using the default key.
protected CustomProperty(ElementKey<java.lang.String,? extends CustomProperty> key)
          Subclass constructor, allows subclasses to supply their own element key.
protected CustomProperty(ElementKey<java.lang.String,? extends CustomProperty> key, Element source)
          Constructs a new instance by doing a shallow copy of data from an existing Element instance.
  CustomProperty(java.lang.String value)
          Constructs a new instance with the given value.
 
Method Summary
 boolean equals(java.lang.Object obj)
           
 java.lang.String getName()
          Returns the can be a URI to indicate a specific ontology.
 java.lang.String getType()
          Returns the datatype such as string, integer, and date, or an ontology-specific URI.
 java.lang.String getUnit()
          Returns the units of data - can also be a URI to indicate a specific ontology.
 java.lang.String getValue()
          Returns the value.
 int hashCode()
           
 boolean hasName()
          Returns whether it has the can be a URI to indicate a specific ontology.
 boolean hasType()
          Returns whether it has the datatype such as string, integer, and date, or an ontology-specific URI.
 boolean hasUnit()
          Returns whether it has the units of data - can also be a URI to indicate a specific ontology.
 boolean hasValue()
          Returns whether it has the value.
 CustomProperty lock()
          Locks this element.
static void registerMetadata(MetadataRegistry registry)
          Registers the metadata for this element.
 CustomProperty setName(java.lang.String name)
          Sets the can be a URI to indicate a specific ontology.
 CustomProperty setType(java.lang.String type)
          Sets the datatype such as string, integer, and date, or an ontology-specific URI.
 CustomProperty setUnit(java.lang.String unit)
          Sets the units of data - can also be a URI to indicate a specific ontology.
 CustomProperty setValue(java.lang.String value)
          Sets the value.
 
Methods inherited from class com.google.gdata.model.Element
adapt, adapt, addElement, addElement, addElement, clear, createElement, createElement, eq, getAttributeCount, getAttributeIterator, getAttributeIterator, getAttributeValue, getAttributeValue, getDefaultKey, getElement, getElement, getElementCount, getElementId, getElementIterator, getElementIterator, getElementKey, getElements, getElements, getElementSet, getElementSet, getElementValue, getElementValue, getTextValue, getTextValue, hasAttribute, hasAttribute, hasElement, hasElement, hasTextValue, isLocked, narrow, removeAttribute, removeAttribute, removeAttributeValue, removeAttributeValue, removeElement, removeElement, removeElement, removeElement, replaceElement, resolve, resolve, sameClassAs, setAttributeValue, setAttributeValue, setElement, setElement, setElement, setTextValue, toString, validate, visit
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

KEY

public static final ElementKey<java.lang.String,CustomProperty> KEY
The key for this element.


NAME

public static final AttributeKey<java.lang.String> NAME
Can be a URI to indicate a specific ontology.


TYPE

public static final AttributeKey<java.lang.String> TYPE
Datatype such as string, integer, and date, or an ontology-specific URI.


UNIT

public static final AttributeKey<java.lang.String> UNIT
Units of data - can also be a URI to indicate a specific ontology.

Constructor Detail

CustomProperty

public CustomProperty()
Constructs an instance using the default key.


CustomProperty

protected CustomProperty(ElementKey<java.lang.String,? extends CustomProperty> key)
Subclass constructor, allows subclasses to supply their own element key.


CustomProperty

protected CustomProperty(ElementKey<java.lang.String,? extends CustomProperty> key,
                         Element source)
Constructs a new instance by doing a shallow copy of data from an existing Element instance. Will use the given ElementKey as the key for the element. This constructor is used when adapting from one element key to another. You cannot call this constructor directly, instead use Element.createElement(ElementKey, Element).

Parameters:
key - The key to use for this element.
source - source element

CustomProperty

public CustomProperty(java.lang.String value)
Constructs a new instance with the given value.

Parameters:
value - value.
Method Detail

registerMetadata

public static void registerMetadata(MetadataRegistry registry)
Registers the metadata for this element.


lock

public CustomProperty lock()
Description copied from class: Element
Locks this element. A locked element cannot have any changes made to its content or its attributes or child elements. This will also lock all attributes and child elements as well. Once this method has been called, this element can be safely published to other threads.

Overrides:
lock in class Element

getName

public java.lang.String getName()
Returns the can be a URI to indicate a specific ontology.

Returns:
can be a URI to indicate a specific ontology

setName

public CustomProperty setName(java.lang.String name)
Sets the can be a URI to indicate a specific ontology.

Parameters:
name - can be a URI to indicate a specific ontology or null to reset
Returns:
this to enable chaining setters

hasName

public boolean hasName()
Returns whether it has the can be a URI to indicate a specific ontology.

Returns:
whether it has the can be a URI to indicate a specific ontology

getType

public java.lang.String getType()
Returns the datatype such as string, integer, and date, or an ontology-specific URI.

Returns:
datatype such as string, integer, and date, or an ontology-specific URI

setType

public CustomProperty setType(java.lang.String type)
Sets the datatype such as string, integer, and date, or an ontology-specific URI.

Parameters:
type - datatype such as string, integer, and date, or an ontology-specific URI or null to reset
Returns:
this to enable chaining setters

hasType

public boolean hasType()
Returns whether it has the datatype such as string, integer, and date, or an ontology-specific URI.

Returns:
whether it has the datatype such as string, integer, and date, or an ontology-specific URI

getUnit

public java.lang.String getUnit()
Returns the units of data - can also be a URI to indicate a specific ontology.

Returns:
units of data - can also be a URI to indicate a specific ontology

setUnit

public CustomProperty setUnit(java.lang.String unit)
Sets the units of data - can also be a URI to indicate a specific ontology.

Parameters:
unit - units of data - can also be a URI to indicate a specific ontology or null to reset
Returns:
this to enable chaining setters

hasUnit

public boolean hasUnit()
Returns whether it has the units of data - can also be a URI to indicate a specific ontology.

Returns:
whether it has the units of data - can also be a URI to indicate a specific ontology

getValue

public java.lang.String getValue()
Returns the value.

Returns:
value

setValue

public CustomProperty setValue(java.lang.String value)
Sets the value.

Parameters:
value - value or null to reset
Returns:
this to enable chaining setters

hasValue

public boolean hasValue()
Returns whether it has the value.

Returns:
whether it has the value

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class Element

hashCode

public int hashCode()
Overrides:
hashCode in class Element