.. java:import:: org.joda.time DateTime .. java:import:: org.motechproject.commons.date.util DateUtil .. java:import:: org.motechproject.mds.annotations Entity .. java:import:: org.motechproject.mds.annotations Field .. java:import:: java.util Objects EmailRecord =========== .. java:package:: org.motechproject.email.domain :noindex: .. java:type:: @Entity public class EmailRecord The \ ``EmailRecord``\ class represents a record of a sent Email. This class is exposed as an \ :java:ref:`org.motechproject.mds.annotations.Entity`\ through Motech Data Services. **See also:** :java:ref:`org.motechproject.mds.annotations` Constructors ------------ EmailRecord ^^^^^^^^^^^ .. java:constructor:: public EmailRecord() :outertype: EmailRecord Creates a new instance of \ ``EmailRecord``\ , with all fields set to null. EmailRecord ^^^^^^^^^^^ .. java:constructor:: public EmailRecord(String fromAddress, String toAddress, String subject, String message, DateTime deliveryTime, DeliveryStatus deliveryStatus) :outertype: EmailRecord Creates a new instance of \ ``EmailRecord``\ , with all fields set to the values specified in the parameters. :param fromAddress: the email address of the sender :param toAddress: the email address of the recipient :param subject: the subject of the email :param message: the body of the email :param deliveryTime: the date and time that the email was sent :param deliveryStatus: the delivery status of the email Methods ------- equals ^^^^^^ .. java:method:: @Override public boolean equals(Object obj) :outertype: EmailRecord Indicates whether some other object is "equal to" this one. Returns true if this EmailRecord and the object to compare have reference equality or their field values are all equal. :param obj: The reference object with which to compare. :return: true if this object is the same as the obj argument; false otherwise. getDeliveryStatus ^^^^^^^^^^^^^^^^^ .. java:method:: public DeliveryStatus getDeliveryStatus() :outertype: EmailRecord Gets the delivery status. :return: the delivery status of the message getDeliveryTime ^^^^^^^^^^^^^^^ .. java:method:: public DateTime getDeliveryTime() :outertype: EmailRecord Gets the delivery time. :return: the time that the email was sent getFromAddress ^^^^^^^^^^^^^^ .. java:method:: public String getFromAddress() :outertype: EmailRecord Gets the email address of the sender. :return: the sender of the message getId ^^^^^ .. java:method:: public Long getId() :outertype: EmailRecord getMessage ^^^^^^^^^^ .. java:method:: public String getMessage() :outertype: EmailRecord Gets the message body. :return: the body of the message getSubject ^^^^^^^^^^ .. java:method:: public String getSubject() :outertype: EmailRecord Gets the message subject. :return: the subject of the message getToAddress ^^^^^^^^^^^^ .. java:method:: public String getToAddress() :outertype: EmailRecord Gets the email address of the recipient. :return: the recipient of the message hashCode ^^^^^^^^ .. java:method:: @Override public int hashCode() :outertype: EmailRecord Returns a hash code value for this \ ``EmailRecord``\ object. :return: a hash code value for this \ ``EmailRecord``\ object setFromAddress ^^^^^^^^^^^^^^ .. java:method:: public void setFromAddress(String fromAddress) :outertype: EmailRecord Sets the email address of the sender. :param fromAddress: the sender of the message setId ^^^^^ .. java:method:: public void setId(Long id) :outertype: EmailRecord setMessage ^^^^^^^^^^ .. java:method:: public void setMessage(String message) :outertype: EmailRecord Sets the message body. :param message: the body of the message setSubject ^^^^^^^^^^ .. java:method:: public void setSubject(String subject) :outertype: EmailRecord Sets the message subject. :param subject: the subject of the message setToAddress ^^^^^^^^^^^^ .. java:method:: public void setToAddress(String toAddress) :outertype: EmailRecord Sets the email address of the recipient. :param toAddress: the recipient of the message toString ^^^^^^^^ .. java:method:: @Override public String toString() :outertype: EmailRecord Returns a string representation of this \ ``EmailRecord``\ object. :return: a string representation of this \ ``EmailRecord``\ object