Mail

public class Mail

The Mail class represents an email message.

Constructors

Mail

public Mail(String fromAddress, String toAddress, String subject, String message)

Creates a new instance of Mail, with all fields set to the values specified in the parameters.

Parameters:
  • fromAddress – the email address of the sender
  • toAddress – the email address of the recipient
  • subject – the subject of the email
  • message – the body of the email

Methods

equals

public boolean equals(Object obj)

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.

Parameters:
  • obj – The reference object with which to compare
Returns:

true if this object is the same as the obj argument; false otherwise.

getFromAddress

public String getFromAddress()

Gets the email address of the sender.

Returns:the sender of the message

getMessage

public String getMessage()

Gets the message body.

Returns:the body of the message

getSubject

public String getSubject()

Gets the message subject.

Returns:the subject of the message

getText

public String getText()

getToAddress

public String getToAddress()

Gets the email address of the recipient.

Returns:the recipient of the message

hashCode

public int hashCode()

Returns a hash code value for this Mail object.

Returns:a hash code value for this Mail object

toString

public String toString()

Returns a string representation of this Mail object.

Returns:a string representation of this Mail object