.. java:import:: org.codehaus.jackson.map.annotate JsonDeserialize .. java:import:: org.motechproject.email.json MailDeserializer .. java:import:: java.util Objects Mail ==== .. java:package:: org.motechproject.email.contract :noindex: .. java:type:: @JsonDeserialize public class Mail The \ ``Mail``\ class represents an email message. Constructors ------------ Mail ^^^^ .. java:constructor:: public Mail(String fromAddress, String toAddress, String subject, String message) :outertype: Mail Creates a new instance of \ ``Mail``\ , 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 Methods ------- equals ^^^^^^ .. java:method:: @Override public boolean equals(Object obj) :outertype: Mail Indicates whether some other object is "equal to" this one. Returns true if this Mail 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. getFromAddress ^^^^^^^^^^^^^^ .. java:method:: public String getFromAddress() :outertype: Mail Gets the email address of the sender. :return: the sender of the message getMessage ^^^^^^^^^^ .. java:method:: public String getMessage() :outertype: Mail Gets the message body. :return: the body of the message getSubject ^^^^^^^^^^ .. java:method:: public String getSubject() :outertype: Mail Gets the message subject. :return: the subject of the message getText ^^^^^^^ .. java:method:: @Deprecated public String getText() :outertype: Mail getToAddress ^^^^^^^^^^^^ .. java:method:: public String getToAddress() :outertype: Mail Gets the email address of the recipient. :return: the recipient of the message hashCode ^^^^^^^^ .. java:method:: @Override public int hashCode() :outertype: Mail Returns a hash code value for this \ ``Mail``\ object. :return: a hash code value for this \ ``Mail``\ object toString ^^^^^^^^ .. java:method:: @Override public String toString() :outertype: Mail Returns a string representation of this \ ``Mail``\ object. :return: a string representation of this \ ``Mail``\ object