public class

CustomProperty

extends AbstractExtension
java.lang.Object
   ↳ com.google.gdata.data.AbstractExtension
     ↳ com.google.gdata.data.extensions.CustomProperty

Class Overview

Name-value pair with optional type and unit.

Summary

Constants
String NAME XML "name" attribute name
String TYPE XML "type" attribute name
String UNIT XML "unit" attribute name
String XML_NAME XML element name
Fields
private String name Can be a URI to indicate a specific ontology
private String type Datatype such as string, integer, and date, or an ontology-specific URI
private String unit Units of data - can also be a URI to indicate a specific ontology
private String value Value
[Expand]
Inherited Fields
From class com.google.gdata.data.AbstractExtension
Public Constructors
CustomProperty()
Default mutable constructor.
CustomProperty(String name, String type, String unit, String value)
Immutable constructor.
Public Methods
boolean equals(Object obj)
static ExtensionDescription getDefaultDescription(boolean required, boolean repeatable)
Returns the extension description, specifying whether it is required, and whether it is repeatable.
String getName()
Returns the can be a URI to indicate a specific ontology.
String getType()
Returns the datatype such as string, integer, and date, or an ontology-specific URI.
String getUnit()
Returns the units of data - can also be a URI to indicate a specific ontology.
String getValue()
Returns the value.
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.
int hashCode()
void setName(String name)
Sets the can be a URI to indicate a specific ontology.
void setType(String type)
Sets the datatype such as string, integer, and date, or an ontology-specific URI.
void setUnit(String unit)
Sets the units of data - can also be a URI to indicate a specific ontology.
void setValue(String value)
Sets the value.
String toString()
Protected Methods
void consumeAttributes(AttributeHelper helper)
Consumes attributes from the attribute helper.
void putAttributes(AttributeGenerator generator)
Puts attributes into the attribute generator.
void validate()
Checks the attributes to see if there are any problems.
[Expand]
Inherited Methods
From class com.google.gdata.data.AbstractExtension
From class java.lang.Object
From interface com.google.gdata.data.Extension

Constants

private static final String NAME

XML "name" attribute name

Constant Value: "name"

private static final String TYPE

XML "type" attribute name

Constant Value: "type"

private static final String UNIT

XML "unit" attribute name

Constant Value: "unit"

static final String XML_NAME

XML element name

Constant Value: "customProperty"

Fields

private String name

Can be a URI to indicate a specific ontology

private String type

Datatype such as string, integer, and date, or an ontology-specific URI

private String unit

Units of data - can also be a URI to indicate a specific ontology

private String value

Value

Public Constructors

public CustomProperty ()

Default mutable constructor.

public CustomProperty (String name, String type, String unit, String value)

Immutable constructor.

Parameters
name Can be a URI to indicate a specific ontology.
type Datatype such as string, integer, and date, or an ontology-specific URI.
unit Units of data - can also be a URI to indicate a specific ontology.
value Value.

Public Methods

public boolean equals (Object obj)

Parameters
obj

public static ExtensionDescription getDefaultDescription (boolean required, boolean repeatable)

Returns the extension description, specifying whether it is required, and whether it is repeatable.

Parameters
required Whether it is required
repeatable Whether it is repeatable
Returns
  • extension description

public String getName ()

Returns the can be a URI to indicate a specific ontology.

Returns
  • can be a URI to indicate a specific ontology

public 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

public 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

public String getValue ()

Returns the value.

Returns
  • value

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

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

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

public boolean hasValue ()

Returns whether it has the value.

Returns
  • whether it has the value

public int hashCode ()

public void setName (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

public void setType (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

public void setUnit (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

public void setValue (String value)

Sets the value.

Parameters
value Value or null to reset

public String toString ()

Protected Methods

protected void consumeAttributes (AttributeHelper helper)

Consumes attributes from the attribute helper. May also use consumeContent(boolean) to consume the element's text content. Called from getHandler(ExtensionProfile, String, String, Attributes). Default implementation does nothing, though generally this is discouraged unless there really are no attributes.

Parameters
helper Attribute helper

protected void putAttributes (AttributeGenerator generator)

Puts attributes into the attribute generator. Called from generate(XmlWriter, ExtensionProfile). Default implementation does nothing, though generally this is discouraged unless there really are no attributes.

Parameters
generator Attribute generator

protected void validate ()

Checks the attributes to see if there are any problems. Default implementation does nothing, though generally this is discouraged unless there really are no restrictions.