Class DnsRDataMx

  • All Implemented Interfaces:
    java.io.Serializable, DnsResourceRecord.DnsRData

    public final class DnsRDataMx
    extends java.lang.Object
    implements DnsResourceRecord.DnsRData
    DNS MX RDATA
     +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
     |                  PREFERENCE                   |
     +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
     /                   EXCHANGE                    /
     /                                               /
     +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
    
     where:
    
     PREFERENCE      A 16 bit integer which specifies the preference given to
                     this RR among others at the same owner.  Lower values
                     are preferred.
    
     EXCHANGE        A <domain-name> which specifies a host willing to act as
                     a mail exchange for the owner name.
     
    Since:
    pcap4j 1.7.1
    Author:
    Kaito Yamada
    See Also:
    RFC 1035, Serialized Form
    • Method Detail

      • getPreference

        public short getPreference()
        Returns:
        preference
      • getPreferenceAsInt

        public int getPreferenceAsInt()
        Returns:
        preference
      • getExchange

        public DnsDomainName getExchange()
        Returns:
        exchange
      • getBuilder

        public DnsRDataMx.Builder getBuilder()
        Returns:
        a new Builder object populated with this object's fields.
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • toString

        public java.lang.String toString​(java.lang.String indent)
        Specified by:
        toString in interface DnsResourceRecord.DnsRData
        Parameters:
        indent - indent
        Returns:
        String representation of this object.
      • toString

        public java.lang.String toString​(java.lang.String indent,
                                         byte[] headerRawData)
        Specified by:
        toString in interface DnsResourceRecord.DnsRData
        Parameters:
        indent - indent
        headerRawData - the raw data of the DNS header including this RDATA.
        Returns:
        String representation of this object.
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • equals

        public boolean equals​(java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object