public class MailServer extends Object implements Comparable<MailServer>
| Constructor and Description |
|---|
MailServer(int preference,
String domainName)
Constructs this MailServer from the supplied preference and domainName.
|
| Modifier and Type | Method and Description |
|---|---|
int |
compareTo(MailServer otherMailServer)
Compares
MailServers by preference and then by domain name. |
boolean |
equals(Object object)
Determines whether this object is equal to the supplied Object.
|
String |
getDomainName()
Gets the domain name of this MailServer.
|
int |
getPreference()
Gets the preference of this MailServer.
|
int |
hashCode()
Computes the hash code of this MailServer.
|
String |
toString()
Creates a String representation of this MailServer.
|
public MailServer(int preference,
String domainName)
preference - The preference of this mail server.domainName - The domain name of this mail server.NullPointerException - When the supplied domainName is null.IllegalArgumentException - When the supplied domainName is empty.public int getPreference()
public String getDomainName()
public int compareTo(MailServer otherMailServer)
MailServers by preference and then by domain name.compareTo in interface Comparable<MailServer>otherMailServer - The MailServer to compare to this MailServer.public boolean equals(Object object)
public int hashCode()
Copyright © 2008–2018. All rights reserved.