FileDocCategorySizeDatePackage
Mailbox.javaAPI DocAndroid 1.5 API3652Wed May 06 22:42:46 BST 2009org.apache.james.mime4j.field.address

Mailbox

public class Mailbox extends Address
Represents a single e-mail address.

Fields Summary
private DomainList
route
private String
localPart
private String
domain
Constructors Summary
public Mailbox(String localPart, String domain)
Creates a mailbox without a route. Routes are obsolete.

param
localPart The part of the e-mail address to the left of the "@".
param
domain The part of the e-mail address to the right of the "@".

		this(null, localPart, domain);
	
public Mailbox(DomainList route, String localPart, String domain)
Creates a mailbox with a route. Routes are obsolete.

param
route The zero or more domains that make up the route. Can be null.
param
localPart The part of the e-mail address to the left of the "@".
param
domain The part of the e-mail address to the right of the "@".

		this.route = route;
		this.localPart = localPart;
		this.domain = domain;
	
Methods Summary
protected final voiddoAddMailboxesTo(java.util.ArrayList results)

		results.add(this);
	
public java.lang.StringgetAddressString()
Formats the address as a string, not including the route.

see
#getAddressString(boolean)

		return getAddressString(false);
	
public java.lang.StringgetAddressString(boolean includeRoute)
Note that this value may not be usable for transport purposes, only display purposes. For example, if the unparsed address was <"Joe Cheng"@joecheng.com> this method would return which is not valid for transport; the local part would need to be re-quoted.

param
includeRoute true if the route should be included if it exists.

		return "<" + (!includeRoute || route == null ? "" : route.toRouteString() + ":") 
			+ localPart
			+ (domain == null ? "" : "@") 
			+ domain + ">";  
	
public java.lang.StringgetDomain()
Returns the right part of the e-mail address (after "@").

		return domain;
	
public java.lang.StringgetLocalPart()
Returns the left part of the e-mail address (before "@").

		return localPart;
	
public DomainListgetRoute()
Returns the route list.

		return route;
	
public java.lang.StringtoString()

		return getAddressString();