public class

Relation

extends AbstractExtension
java.lang.Object
   ↳ com.google.gdata.data.AbstractExtension
     ↳ com.google.gdata.data.contacts.Relation

Class Overview

Contact's relation.

Summary

Nested Classes
enum Relation.Rel Relation type. 
Constants
String LABEL XML "label" attribute name
String REL XML "rel" attribute name
String XML_NAME XML element name
Fields
private static final EnumToAttributeValue<Relation.Rel> REL_ENUM_TO_ATTRIBUTE_VALUE
private String label Label
private Relation.Rel rel Relation type
private String value Value
[Expand]
Inherited Fields
From class com.google.gdata.data.AbstractExtension
Public Constructors
Relation()
Default mutable constructor.
Relation(String label, Relation.Rel rel, 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 getLabel()
Returns the label.
Relation.Rel getRel()
Returns the relation type.
String getValue()
Returns the value.
boolean hasLabel()
Returns whether it has the label.
boolean hasRel()
Returns whether it has the relation type.
boolean hasValue()
Returns whether it has the value.
int hashCode()
void setLabel(String label)
Sets the label.
void setRel(Relation.Rel rel)
Sets the relation type.
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 LABEL

XML "label" attribute name

Constant Value: "label"

private static final String REL

XML "rel" attribute name

Constant Value: "rel"

static final String XML_NAME

XML element name

Constant Value: "relation"

Fields

private static final EnumToAttributeValue<Relation.Rel> REL_ENUM_TO_ATTRIBUTE_VALUE

private String label

Label

private Relation.Rel rel

Relation type

private String value

Value

Public Constructors

public Relation ()

Default mutable constructor.

public Relation (String label, Relation.Rel rel, String value)

Immutable constructor.

Parameters
label Label.
rel Relation type.
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 getLabel ()

Returns the label.

Returns
  • label

public Relation.Rel getRel ()

Returns the relation type.

Returns
  • relation type

public String getValue ()

Returns the value.

Returns
  • value

public boolean hasLabel ()

Returns whether it has the label.

Returns
  • whether it has the label

public boolean hasRel ()

Returns whether it has the relation type.

Returns
  • whether it has the relation type

public boolean hasValue ()

Returns whether it has the value.

Returns
  • whether it has the value

public int hashCode ()

public void setLabel (String label)

Sets the label.

Parameters
label Label or null to reset

public void setRel (Relation.Rel rel)

Sets the relation type.

Parameters
rel Relation type 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.