public class Mailbox extends Address
| Constructor and Description |
|---|
Mailbox(DomainList route,
java.lang.String localPart,
java.lang.String domain)
Creates an unnamed mailbox with a route.
|
Mailbox(java.lang.String name,
DomainList route,
java.lang.String localPart,
java.lang.String domain)
Creates a named mailbox with a route.
|
Mailbox(java.lang.String localPart,
java.lang.String domain)
Creates an unnamed mailbox without a route.
|
Mailbox(java.lang.String name,
java.lang.String localPart,
java.lang.String domain)
Creates a named mailbox without a route.
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
doAddMailboxesTo(java.util.List<Mailbox> results)
Adds any mailboxes represented by this address into the given List.
|
boolean |
equals(java.lang.Object obj)
Indicates whether some other object is "equal to" this mailbox.
|
java.lang.String |
getAddress()
Returns the address in the form localPart@domain.
|
java.lang.String |
getDomain()
Returns the right part of the e-mail address (after "@").
|
java.lang.String |
getLocalPart()
Returns the left part of the e-mail address (before "@").
|
java.lang.String |
getName()
Returns the name of the mailbox or
null if it does not
have a name. |
DomainList |
getRoute()
Returns the route list.
|
int |
hashCode() |
java.lang.String |
toString() |
public Mailbox(java.lang.String name,
DomainList route,
java.lang.String localPart,
java.lang.String domain)
name - the name of the e-mail address. May be null.route - The zero or more domains that make up the route. May be
null.localPart - The part of the e-mail address to the left of the "@".domain - The part of the e-mail address to the right of the "@".public Mailbox(java.lang.String localPart,
java.lang.String domain)
localPart - The part of the e-mail address to the left of the "@".domain - The part of the e-mail address to the right of the "@".public Mailbox(DomainList route, java.lang.String localPart, java.lang.String domain)
route - The zero or more domains that make up the route. May be
null.localPart - The part of the e-mail address to the left of the "@".domain - The part of the e-mail address to the right of the "@".public Mailbox(java.lang.String name,
java.lang.String localPart,
java.lang.String domain)
name - the name of the e-mail address. May be null.localPart - The part of the e-mail address to the left of the "@".domain - The part of the e-mail address to the right of the "@".public java.lang.String getName()
null if it does not
have a name.public DomainList getRoute()
public java.lang.String getLocalPart()
public java.lang.String getDomain()
public java.lang.String getAddress()
protected final void doAddMailboxesTo(java.util.List<Mailbox> results)
AddressdoAddMailboxesTo in class Addresspublic int hashCode()
hashCode in class java.lang.Objectpublic boolean equals(java.lang.Object obj)
An object is considered to be equal to this mailbox if it is an instance
of class Mailbox that holds the same address as this one.
The domain is considered to be case-insensitive but the local-part is not
(because of RFC 5321: the local-part of a mailbox MUST BE treated
as case sensitive).
equals in class java.lang.Objectobj - the object to test for equality.true if the specified object is a
Mailbox that holds the same address as this one.public java.lang.String toString()
toString in class java.lang.Object