Class DnsResponseCode

java.lang.Object
io.netty.handler.codec.dns.DnsResponseCode
All Implemented Interfaces:
java.lang.Comparable<DnsResponseCode>

public class DnsResponseCode extends java.lang.Object implements java.lang.Comparable<DnsResponseCode>
The DNS RCODE, as defined in RFC2929.
  • Field Details

    • NOERROR

      public static final DnsResponseCode NOERROR
      The 'NoError' DNS RCODE (0), as defined in RFC1035.
    • FORMERR

      public static final DnsResponseCode FORMERR
      The 'FormErr' DNS RCODE (1), as defined in RFC1035.
    • SERVFAIL

      public static final DnsResponseCode SERVFAIL
      The 'ServFail' DNS RCODE (2), as defined in RFC1035.
    • NXDOMAIN

      public static final DnsResponseCode NXDOMAIN
      The 'NXDomain' DNS RCODE (3), as defined in RFC1035.
    • NOTIMP

      public static final DnsResponseCode NOTIMP
      The 'NotImp' DNS RCODE (4), as defined in RFC1035.
    • REFUSED

      public static final DnsResponseCode REFUSED
      The 'Refused' DNS RCODE (5), as defined in RFC1035.
    • YXDOMAIN

      public static final DnsResponseCode YXDOMAIN
      The 'YXDomain' DNS RCODE (6), as defined in RFC2136.
    • YXRRSET

      public static final DnsResponseCode YXRRSET
      The 'YXRRSet' DNS RCODE (7), as defined in RFC2136.
    • NXRRSET

      public static final DnsResponseCode NXRRSET
      The 'NXRRSet' DNS RCODE (8), as defined in RFC2136.
    • NOTAUTH

      public static final DnsResponseCode NOTAUTH
      The 'NotAuth' DNS RCODE (9), as defined in RFC2136.
    • NOTZONE

      public static final DnsResponseCode NOTZONE
      The 'NotZone' DNS RCODE (10), as defined in RFC2136.
    • BADVERS_OR_BADSIG

      public static final DnsResponseCode BADVERS_OR_BADSIG
      The 'BADVERS' or 'BADSIG' DNS RCODE (16), as defined in RFC2671 and RFC2845.
    • BADKEY

      public static final DnsResponseCode BADKEY
      The 'BADKEY' DNS RCODE (17), as defined in RFC2845.
    • BADTIME

      public static final DnsResponseCode BADTIME
      The 'BADTIME' DNS RCODE (18), as defined in RFC2845.
    • BADMODE

      public static final DnsResponseCode BADMODE
      The 'BADMODE' DNS RCODE (19), as defined in RFC2930.
    • BADNAME

      public static final DnsResponseCode BADNAME
      The 'BADNAME' DNS RCODE (20), as defined in RFC2930.
    • BADALG

      public static final DnsResponseCode BADALG
      The 'BADALG' DNS RCODE (21), as defined in RFC2930.
    • code

      private final int code
    • name

      private final java.lang.String name
    • text

      private java.lang.String text
  • Constructor Details

    • DnsResponseCode

      private DnsResponseCode(int code)
    • DnsResponseCode

      public DnsResponseCode(int code, java.lang.String name)
  • Method Details

    • valueOf

      public static DnsResponseCode valueOf(int responseCode)
      Returns the DnsResponseCode that corresponds with the given responseCode.
      Parameters:
      responseCode - the DNS RCODE
      Returns:
      the corresponding DnsResponseCode
    • intValue

      public int intValue()
      Returns the error code for this DnsResponseCode.
    • compareTo

      public int compareTo(DnsResponseCode o)
      Specified by:
      compareTo in interface java.lang.Comparable<DnsResponseCode>
    • hashCode

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

      public boolean equals(java.lang.Object o)
      Equality of DnsResponseCode only depends on intValue().
      Overrides:
      equals in class java.lang.Object
    • toString

      public java.lang.String toString()
      Returns a formatted error message for this DnsResponseCode.
      Overrides:
      toString in class java.lang.Object