com.google.gdata.model.gd
Class Email

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

public class Email
extends Element

Describes an email address.


Nested Class Summary
static class Email.Rel
          Email type.
 
Field Summary
static AttributeKey<java.lang.String> ADDRESS
          Email address.
static AttributeKey<java.lang.String> DISPLAY_NAME
          DisplayName.
static ElementKey<java.lang.Void,Email> KEY
          The key for this element.
static AttributeKey<java.lang.String> LABEL
          Label.
static AttributeKey<java.lang.Boolean> PRIMARY
          Whether this is the primary email address.
static AttributeKey<java.lang.String> REL
          Email type.
 
Constructor Summary
  Email()
          Constructs an instance using the default key.
protected Email(ElementKey<?,? extends Email> key)
          Subclass constructor, allows subclasses to supply their own element key.
protected Email(ElementKey<?,? extends Email> key, Element source)
          Constructs a new instance by doing a shallow copy of data from an existing Element instance.
 
Method Summary
 boolean equals(java.lang.Object obj)
           
 java.lang.String getAddress()
          Returns the email address.
 java.lang.String getDisplayName()
          Returns the displayName.
 java.lang.String getLabel()
          Returns the label.
 java.lang.Boolean getPrimary()
          Returns the whether this is the primary email address.
 java.lang.String getRel()
          Returns the email type.
 boolean hasAddress()
          Returns whether it has the email address.
 boolean hasDisplayName()
          Returns whether it has the displayName.
 int hashCode()
           
 boolean hasLabel()
          Returns whether it has the label.
 boolean hasPrimary()
          Returns whether it has the whether this is the primary email address.
 boolean hasRel()
          Returns whether it has the email type.
 Email lock()
          Locks this element.
static void registerMetadata(MetadataRegistry registry)
          Registers the metadata for this element.
 Email setAddress(java.lang.String address)
          Sets the email address.
 Email setDisplayName(java.lang.String displayName)
          Sets the displayName.
 Email setLabel(java.lang.String label)
          Sets the label.
 Email setPrimary(java.lang.Boolean primary)
          Sets the whether this is the primary email address.
 Email setRel(java.lang.String rel)
          Sets the email type.
 
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.Void,Email> KEY
The key for this element.


ADDRESS

public static final AttributeKey<java.lang.String> ADDRESS
Email address.


DISPLAY_NAME

public static final AttributeKey<java.lang.String> DISPLAY_NAME
DisplayName.


LABEL

public static final AttributeKey<java.lang.String> LABEL
Label.


PRIMARY

public static final AttributeKey<java.lang.Boolean> PRIMARY
Whether this is the primary email address.


REL

public static final AttributeKey<java.lang.String> REL
Email type.

Constructor Detail

Email

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


Email

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


Email

protected Email(ElementKey<?,? extends Email> 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
Method Detail

registerMetadata

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


lock

public Email 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

getAddress

public java.lang.String getAddress()
Returns the email address.

Returns:
email address

setAddress

public Email setAddress(java.lang.String address)
Sets the email address.

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

hasAddress

public boolean hasAddress()
Returns whether it has the email address.

Returns:
whether it has the email address

getDisplayName

public java.lang.String getDisplayName()
Returns the displayName.

Returns:
displayName

setDisplayName

public Email setDisplayName(java.lang.String displayName)
Sets the displayName.

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

hasDisplayName

public boolean hasDisplayName()
Returns whether it has the displayName.

Returns:
whether it has the displayName

getLabel

public java.lang.String getLabel()
Returns the label.

Returns:
label

setLabel

public Email setLabel(java.lang.String label)
Sets the label.

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

hasLabel

public boolean hasLabel()
Returns whether it has the label.

Returns:
whether it has the label

getPrimary

public java.lang.Boolean getPrimary()
Returns the whether this is the primary email address.

Returns:
whether this is the primary email address

setPrimary

public Email setPrimary(java.lang.Boolean primary)
Sets the whether this is the primary email address.

Parameters:
primary - whether this is the primary email address or null to reset
Returns:
this to enable chaining setters

hasPrimary

public boolean hasPrimary()
Returns whether it has the whether this is the primary email address.

Returns:
whether it has the whether this is the primary email address

getRel

public java.lang.String getRel()
Returns the email type.

Returns:
email type

setRel

public Email setRel(java.lang.String rel)
Sets the email type.

Parameters:
rel - email type or null to reset
Returns:
this to enable chaining setters

hasRel

public boolean hasRel()
Returns whether it has the email type.

Returns:
whether it has the email type

equals

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

hashCode

public int hashCode()
Overrides:
hashCode in class Element