Mailboxpublic 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.
this(null, localPart, domain);
| public Mailbox(DomainList route, String localPart, String domain)Creates a mailbox with a route. Routes are obsolete.
this.route = route;
this.localPart = localPart;
this.domain = domain;
|
Methods Summary |
---|
protected final void | doAddMailboxesTo(java.util.ArrayList results)
results.add(this);
| public java.lang.String | getAddressString()Formats the address as a string, not including
the route.
return getAddressString(false);
| public java.lang.String | getAddressString(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.
return "<" + (!includeRoute || route == null ? "" : route.toRouteString() + ":")
+ localPart
+ (domain == null ? "" : "@")
+ domain + ">";
| public java.lang.String | getDomain()Returns the right part of the e-mail address
(after "@").
return domain;
| public java.lang.String | getLocalPart()Returns the left part of the e-mail address
(before "@").
return localPart;
| public DomainList | getRoute()Returns the route list.
return route;
| public java.lang.String | toString()
return getAddressString();
|
|