Package de.measite.minidns
Enum DNSMessage.RESPONSE_CODE
- java.lang.Object
-
- java.lang.Enum<DNSMessage.RESPONSE_CODE>
-
- de.measite.minidns.DNSMessage.RESPONSE_CODE
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Comparable<DNSMessage.RESPONSE_CODE>
- Enclosing class:
- DNSMessage
public static enum DNSMessage.RESPONSE_CODE extends java.lang.Enum<DNSMessage.RESPONSE_CODE>
Possible DNS reply codes.
-
-
Field Summary
Fields Modifier and Type Field Description private static DNSMessage.RESPONSE_CODE[]
INVERSE_LUT
Reverse lookup table for response codes.private byte
value
The response code value.
-
Constructor Summary
Constructors Modifier Constructor Description private
RESPONSE_CODE(int value)
Create a new response code.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static DNSMessage.RESPONSE_CODE
getResponseCode(int value)
Retrieve the response code for a byte value.byte
getValue()
Retrieve the byte value of the response code.static DNSMessage.RESPONSE_CODE
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.static DNSMessage.RESPONSE_CODE[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
NO_ERROR
public static final DNSMessage.RESPONSE_CODE NO_ERROR
-
FORMAT_ERR
public static final DNSMessage.RESPONSE_CODE FORMAT_ERR
-
SERVER_FAIL
public static final DNSMessage.RESPONSE_CODE SERVER_FAIL
-
NX_DOMAIN
public static final DNSMessage.RESPONSE_CODE NX_DOMAIN
-
NO_IMP
public static final DNSMessage.RESPONSE_CODE NO_IMP
-
REFUSED
public static final DNSMessage.RESPONSE_CODE REFUSED
-
YXDOMAIN
public static final DNSMessage.RESPONSE_CODE YXDOMAIN
-
YXRRSET
public static final DNSMessage.RESPONSE_CODE YXRRSET
-
NXRRSET
public static final DNSMessage.RESPONSE_CODE NXRRSET
-
NOT_AUTH
public static final DNSMessage.RESPONSE_CODE NOT_AUTH
-
NOT_ZONE
public static final DNSMessage.RESPONSE_CODE NOT_ZONE
-
-
Field Detail
-
INVERSE_LUT
private static final DNSMessage.RESPONSE_CODE[] INVERSE_LUT
Reverse lookup table for response codes.
-
value
private final byte value
The response code value.
-
-
Method Detail
-
values
public static DNSMessage.RESPONSE_CODE[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (DNSMessage.RESPONSE_CODE c : DNSMessage.RESPONSE_CODE.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static DNSMessage.RESPONSE_CODE valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
java.lang.IllegalArgumentException
- if this enum type has no constant with the specified namejava.lang.NullPointerException
- if the argument is null
-
getValue
public byte getValue()
Retrieve the byte value of the response code.- Returns:
- the response code.
-
getResponseCode
public static DNSMessage.RESPONSE_CODE getResponseCode(int value)
Retrieve the response code for a byte value.- Parameters:
value
- The byte value.- Returns:
- The symbolic response code or null.
- Throws:
java.lang.IllegalArgumentException
- if the value is not in the range of 0..15.
-
-