|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.arsdigita.kernel.EmailAddress
Represents an email address. While this class does not extend DomainObject and is not a domain object class, it does provide email verification methods, which in turn may manipulate domain objects and persist the changes.
The verification-related data about an email address is persistent data, but the persistence details do not concern developers using this class. Furthermore, developers can instantiate this class for any email address, regardless of whether there is persistent data about the verification status of the email. Persistent data about verification status is only created when necessary. For example, a call to setIsBouncing() will result in persistent storage of the bouncing status for this email address.
The primary reason for not making this class extend DomainObject is so that developers can use it for any random email address without that email address necessarily being a persistent object stored somewhere in the database.
Field Summary | |
static String |
versionId
|
Constructor Summary | |
EmailAddress(DataObject emailData)
Creates a new EmailAddress instance backed by a data object of type com.arsdigita.kernel.EmailAddress. |
|
EmailAddress(String emailAddress)
Creates a new EmailAddress instance that encapsulates emailAddress. |
Method Summary | |
boolean |
equals(Object o)
Checks whether the object specified by o is equal to this. |
String |
getEmailAddress()
Gets the string email address encapsualted by this object. |
protected DomainObject |
getEmailDomainObject()
Gets or creates a new DomainObject for this email address,
encapsulating a data object of type
com.arsdigita.kernel.EmailAddress . |
int |
hashCode()
|
boolean |
isBouncing()
Checks whether this email is set as bouncing. |
boolean |
isVerified()
Sets whether this email has been verified. |
void |
setIsBouncing(boolean isBouncing)
Sets whether email is bouncing. |
void |
setIsVerified(boolean isVerified)
Sets whether this email is verified. |
String |
toString()
Gets the string email address encapsualted by this object. |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final String versionId
Constructor Detail |
public EmailAddress(String emailAddress)
emailAddress
- the email address to encapsulatepublic EmailAddress(DataObject emailData)
emailData
- the data object to encapsulate in the new domain
objectMethod Detail |
public boolean isBouncing()
true
if this email is set as bouncing;
false
otherwise.public boolean isVerified()
true
if this email has been verified;
false
otherwise.public void setIsBouncing(boolean isBouncing)
isBouncing
- true
if this email is set as
bouncing, false
otherwisepublic void setIsVerified(boolean isVerified)
isVerified
- true
if this email is verified,
false
otherwisepublic String getEmailAddress()
public String toString()
public boolean equals(Object o)
true
if the o is not null, is an
instance of EmailAddress, and encapsulates the same email address
(that is, if
o.getEmailAddress().toLower() ==
this.getEmailAddress().toLower()
).
public int hashCode()
protected DomainObject getEmailDomainObject()
DomainObject
for this email address,
encapsulating a data object of type
com.arsdigita.kernel.EmailAddress
.
First tries to retrieve a DomainObject
for this email address. If none exists, a new one is created.
However, the new DomainObject
will *not*
persist until one of the setXXX methods in this class is
called or the returned DomainObject
's save() method
is called.
This method is primarily useful for other domain objects whose
encapsulated data objects have associations to
com.arsdigita.kernel.EmailAddress
.
Such domain object classes can use
getEmailDomainObject().addToAssociation()
.
For example, the method
Party.addEmailAddress(EmailAddress emailAddress)
internally calls
emailAddress.getDomainObject().addToAssociation(
(DataAssociation) get ("emailAddress")
)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |