|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.james.mime4j.field.address.Address org.apache.james.mime4j.field.address.Mailbox
public class Mailbox
Represents a single e-mail address.
Constructor Summary | |
---|---|
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. |
Method Summary | |
---|---|
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 |
getDisplayString(boolean includeRoute)
Formats the address as a human readable string, not including the route. |
java.lang.String |
getDomain()
Returns the right part of the e-mail address (after "@"). |
java.lang.String |
getEncodedString()
Returns a string representation of this address that can be used for transport purposes. |
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()
|
static Mailbox |
parse(java.lang.String rawMailboxString)
Parses the specified raw string into a mailbox address. |
Methods inherited from class org.apache.james.mime4j.field.address.Address |
---|
getDisplayString, toString |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
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 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 "@".Method Detail |
---|
public static Mailbox parse(java.lang.String rawMailboxString)
rawMailboxString
- string to parse.
Mailbox
object for the specified string.
java.lang.IllegalArgumentException
- if the raw string does not represent a single mailbox
address.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()
public java.lang.String getDisplayString(boolean includeRoute)
Address
getDisplayString
in class Address
includeRoute
- true
if the route should be included if it
exists, false
otherwise.
public java.lang.String getEncodedString()
Address
getEncodedString
in class Address
public int hashCode()
hashCode
in class java.lang.Object
public 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.Object
obj
- the object to test for equality.
true
if the specified object is a
Mailbox
that holds the same address as this one.protected final void doAddMailboxesTo(java.util.List<Mailbox> results)
Address
doAddMailboxesTo
in class Address
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |