|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectrsvp.model.EmailAddress
public class EmailAddress
This class models an email address.
Field Summary |
---|
Fields inherited from interface rsvp.model.EmailAddressInterface |
---|
serialVersionUID |
Constructor Summary | |
---|---|
EmailAddress(java.lang.String email)
Creates a new EmailAddress from the given String, which must be a valid email address, as defined by EmailAddress.isValid(String). |
Method Summary | |
---|---|
java.lang.String |
getDisplayEmail()
Returns the "displayable form" of the responder's email address. |
java.lang.String |
getEmail()
Returns the address, as a String. |
static boolean |
isValid(java.lang.String address)
Determines whether or not a given String corresponds to a valid email address. |
void |
setEmail(java.lang.String email)
Sets this email address to the given String. |
java.lang.String |
toString()
Returns a String representation of this email address. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public EmailAddress(java.lang.String email)
email
- a valid email addressMethod Detail |
---|
public static boolean isValid(java.lang.String address)
address
-
public java.lang.String toString()
EmailAddressInterface
toString
in interface EmailAddressInterface
toString
in class java.lang.Object
public void setEmail(java.lang.String email)
EmailAddressInterface
setEmail
in interface EmailAddressInterface
email
- an email address; must be "valid," as defined by EmailAddress.isValid(String)public java.lang.String getDisplayEmail()
EmailAddressInterface
Returns the "displayable form" of the responder's email address. This is obscured somewhat to prevent spam. The "displayable form" of an email address consists of:
As an example, the email address fred@flintstones.bedrock.gov would have the displayable form fred@f...gov
Precondition: this EmailAddress has been initialized with a String corresponding to a valid email address. If this is not the case, this method will throw a StateException.
getDisplayEmail
in interface EmailAddressInterface
public java.lang.String getEmail()
EmailAddressInterface
Returns the address, as a String.
Precondition: this EmailAddress has been initialized with a String corresponding to a valid email address. If this is not the case, this method will throw an exception.
getEmail
in interface EmailAddressInterface
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |