adams.core.net
Class Email

java.lang.Object
  extended by adams.core.ConsoleObject
      extended by adams.core.net.Email
All Implemented Interfaces:
SizeOfHandler, Serializable

public class Email
extends ConsoleObject

Container object for an email.

Version:
$Revision: 7123 $
Author:
fracpete (fracpete at waikato dot ac dot nz)
See Also:
Serialized Form

Field Summary
protected  File[] m_Attachments
          the attachments.
protected  EmailAddress[] m_BCC
          the BCC recipients.
protected  String m_Body
          the body.
protected  EmailAddress[] m_CC
          the CC recipients.
protected  EmailAddress m_From
          the sender.
protected  String m_Subject
          the subject.
protected  EmailAddress[] m_To
          the recipients.
static String NO_SUBJECT
          the default subject if none provided.
 
Constructor Summary
Email(EmailAddress from, EmailAddress[] to, EmailAddress[] cc, EmailAddress[] bcc, String subject, String body, File[] attachments)
          Initializes the email.
Email(EmailAddress from, EmailAddress[] to, String subject, String body, File[] attachments)
          Initializes the email.
Email(EmailAddress from, EmailAddress to, String subject, String body)
          Initializes the email.
Email(EmailAddress from, EmailAddress to, String subject, String body, File[] attachments)
          Initializes the email.
 
Method Summary
 File[] getAttachments()
          Returns the attachments.
 EmailAddress[] getBCC()
          Returns the BCC recipients.
 String getBody()
          Returns the body.
 EmailAddress[] getCC()
          Returns the CC recipients.
 EmailAddress getFrom()
          Returns the sender.
 String getSubject()
          Returns the subject.
 EmailAddress[] getTo()
          Returns the TO recipients.
 String toPlainText()
           
 String toString()
          Simple info string for debugging purposes.
 
Methods inherited from class adams.core.ConsoleObject
getDebugging, getSystemErr, getSystemOut, sizeOf
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

NO_SUBJECT

public static final String NO_SUBJECT
the default subject if none provided.

See Also:
Constant Field Values

m_From

protected EmailAddress m_From
the sender.


m_To

protected EmailAddress[] m_To
the recipients.


m_CC

protected EmailAddress[] m_CC
the CC recipients.


m_BCC

protected EmailAddress[] m_BCC
the BCC recipients.


m_Subject

protected String m_Subject
the subject.


m_Body

protected String m_Body
the body.


m_Attachments

protected File[] m_Attachments
the attachments.

Constructor Detail

Email

public Email(EmailAddress from,
             EmailAddress to,
             String subject,
             String body)
Initializes the email.

Parameters:
from - the sender
to - the recipient
subject - the subject
body - the the content

Email

public Email(EmailAddress from,
             EmailAddress to,
             String subject,
             String body,
             File[] attachments)
Initializes the email.

Parameters:
from - the sender
to - the recipient
subject - the subject
body - the the content
attachments - the attachments

Email

public Email(EmailAddress from,
             EmailAddress[] to,
             String subject,
             String body,
             File[] attachments)
Initializes the email.

Parameters:
from - the sender
to - the recipients
subject - the subject
body - the the content
attachments - the attachments

Email

public Email(EmailAddress from,
             EmailAddress[] to,
             EmailAddress[] cc,
             EmailAddress[] bcc,
             String subject,
             String body,
             File[] attachments)
Initializes the email.

Parameters:
from - the sender
to - the recipients
cc - the CC recipients
bcc - the BCC recipients
subject - the subject
body - the the content
attachments - the attachments
Method Detail

getFrom

public EmailAddress getFrom()
Returns the sender.

Returns:
the sender

getTo

public EmailAddress[] getTo()
Returns the TO recipients.

Returns:
the recipients

getCC

public EmailAddress[] getCC()
Returns the CC recipients.

Returns:
the recipients

getBCC

public EmailAddress[] getBCC()
Returns the BCC recipients.

Returns:
the recipients

getAttachments

public File[] getAttachments()
Returns the attachments.

Returns:
the attachments

getSubject

public String getSubject()
Returns the subject.

Returns:
the subject

getBody

public String getBody()
Returns the body.

Returns:
the body

toString

public String toString()
Simple info string for debugging purposes.

Overrides:
toString in class Object
Returns:
the generated string

toPlainText

public String toPlainText()


Copyright © 2013 University of Waikato, Hamilton, NZ. All Rights Reserved.