ccc.api.types
Class EmailAddress

java.lang.Object
  extended by ccc.api.types.EmailAddress
All Implemented Interfaces:
java.io.Serializable

public class EmailAddress
extends java.lang.Object
implements java.io.Serializable

An email address.

Represents the textual string of an RFC 2822 email address. Domain literals and quoted identifiers are not supported. Only literal equality (i.e. not logical equality) is provided by this class.

Author:
Civic Computing Ltd.
See Also:
Serialized Form

Constructor Summary
protected EmailAddress()
          Constructor.
  EmailAddress(java.lang.String newText)
          Constructor.
 
Method Summary
 boolean equals(java.lang.Object o)
          
 java.lang.String getText()
          Accessor.
 int hashCode()
          
static boolean isValidText(java.lang.String email)
          Utility method that checks to see if the specified string is a valid email address according to the RFC 2822 specification.
 void setText(java.lang.String text)
          Set the text for this email address.
 java.lang.String toString()
          
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

EmailAddress

protected EmailAddress()
Constructor.


EmailAddress

public EmailAddress(java.lang.String newText)
Constructor.

Parameters:
newText - The text representation of the email address.
Method Detail

getText

public java.lang.String getText()
Accessor.

Returns:
The text representation of the email.

setText

public void setText(java.lang.String text)
Set the text for this email address.

Parameters:
text - The text representation.

isValidText

public static boolean isValidText(java.lang.String email)
Utility method that checks to see if the specified string is a valid email address according to the RFC 2822 specification.

Parameters:
email - The email address string to test for validity.
Returns:
True if the given text valid according to RFC 2822, false otherwise.

equals

public boolean equals(java.lang.Object o)

Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()

Overrides:
hashCode in class java.lang.Object

toString

public java.lang.String toString()

Overrides:
toString in class java.lang.Object


Copyright © 2010. All Rights Reserved.