com.internationalnetwork.net.rr
Class MX

Object
  extended by com.internationalnetwork.net.RR
      extended by com.internationalnetwork.net.rr.MX

public class MX
extends RR

Resource Record type 15: Mail Exchanger.


Field Summary
 
Fields inherited from class com.internationalnetwork.net.RR
A, A6, AAAA, AFSDB, ATMA, CERT, CLASS_CH, CLASS_CS, CLASS_HS, CLASS_IN, CNAME, DNAME, EID, GPOS, HINFO, ISDN, KEY, KX, LOC, MB, MD, MF, MG, MINFO, MR, MX, NAPTR, NIMLOC, NS, NSAP, NSAP_PTR, NULL, NXT, OPT, PTR, PX, RP, RR_TYPES, rrData, rrType, RT, SIG, SINK, SOA, SRV, TXT, VERSION, WKS, X25
 
Constructor Summary
MX(int preference, String exchanger)
          Construct a new MX record with the specific preference and hostname.
MX(String mx)
          Construct a new MX record with a String-representation of an MX record.
 
Method Summary
 String getExchanger()
          Return the exchanger for this MX record.
 int getPreference()
          Return the preference for this MX record.
 String toString()
          Convert record to String.
 
Methods inherited from class com.internationalnetwork.net.RR
parseRR, parseRR, parseRR
 
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MX

public MX(int preference,
          String exchanger)
Construct a new MX record with the specific preference and hostname.

Parameters:
preference - Preference value (ranging from 0 to 65,535)
exchanger - Hostname as a String
Throws:
IllegalArgumentException - - you only need to catch this when the record text isn't hard-coded

MX

public MX(String mx)
Construct a new MX record with a String-representation of an MX record.

Parameters:
mx - String containing a space-delimited preference and exchanger pair
Throws:
IllegalArgumentException - - you only need to catch this when the record text isn't hard-coded
Method Detail

getExchanger

public String getExchanger()
Return the exchanger for this MX record.

Returns:
the exchanger

getPreference

public int getPreference()
Return the preference for this MX record.

Returns:
the preference (ranging from 0 to 65,535)

toString

public String toString()
Description copied from class: RR
Convert record to String.

Specified by:
toString in class RR
Returns:
This record, represented as a human-readable string (note that some record types include raw binary data and can't be converted to a string; in such cases, the class should provide a toBytes() convenience method)