public class Mailbox extends Address
Constructor and Description |
---|
Mailbox(DomainList route,
String localPart,
String domain)
Creates an unnamed mailbox with a route.
|
Mailbox(String name,
DomainList route,
String localPart,
String domain)
Creates a named mailbox with a route.
|
Mailbox(String localPart,
String domain)
Creates an unnamed mailbox without a route.
|
Mailbox(String name,
String localPart,
String domain)
Creates a named mailbox without a route.
|
Modifier and Type | Method and Description |
---|---|
protected void |
doAddMailboxesTo(List<Mailbox> results)
Adds any mailboxes represented by this address into the given List.
|
boolean |
equals(Object obj)
Indicates whether some other object is "equal to" this mailbox.
|
String |
getAddress()
Returns the address in the form localPart@domain.
|
String |
getDomain()
Returns the right part of the e-mail address (after "@").
|
String |
getLocalPart()
Returns the left part of the e-mail address (before "@").
|
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() |
String |
toString() |
public Mailbox(String name, DomainList route, String localPart, 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(String localPart, 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, String localPart, 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(String name, String localPart, 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 String getName()
null
if it does not
have a name.public DomainList getRoute()
public String getLocalPart()
public String getDomain()
public String getAddress()
protected final void doAddMailboxesTo(List<Mailbox> results)
Address
doAddMailboxesTo
in class Address
public boolean equals(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).
Copyright © 2004-2012 The Apache Software Foundation. All Rights Reserved.