Home / Class/ DnsOpCode Class — netty Architecture

DnsOpCode Class — netty Architecture

Architecture documentation for the DnsOpCode class in DnsOpCode.java from the netty codebase.

Entity Profile

Dependency Diagram

graph TD
  131a6a0a_f136_c557_236e_cb70f76c1fd8["DnsOpCode"]
  665b82e3_c6fb_992d_e480_c827a68eb375["DnsOpCode.java"]
  131a6a0a_f136_c557_236e_cb70f76c1fd8 -->|defined in| 665b82e3_c6fb_992d_e480_c827a68eb375
  54d130fa_7e4f_f4eb_f2f2_805a28a43ac7["DnsOpCode()"]
  131a6a0a_f136_c557_236e_cb70f76c1fd8 -->|method| 54d130fa_7e4f_f4eb_f2f2_805a28a43ac7
  ae26f117_4245_cca1_cfcc_3f500b24f7c3["byteValue()"]
  131a6a0a_f136_c557_236e_cb70f76c1fd8 -->|method| ae26f117_4245_cca1_cfcc_3f500b24f7c3
  b821434d_6692_0286_b26f_4355ba4784e3["hashCode()"]
  131a6a0a_f136_c557_236e_cb70f76c1fd8 -->|method| b821434d_6692_0286_b26f_4355ba4784e3
  5a972ba1_2bbd_e6aa_b86e_0ad2b1f1f6f5["equals()"]
  131a6a0a_f136_c557_236e_cb70f76c1fd8 -->|method| 5a972ba1_2bbd_e6aa_b86e_0ad2b1f1f6f5
  d3bc799d_8735_effb_b28d_791f09ac28fe["compareTo()"]
  131a6a0a_f136_c557_236e_cb70f76c1fd8 -->|method| d3bc799d_8735_effb_b28d_791f09ac28fe
  861d1e4b_89c6_ea2e_c14d_d843954c58f6["String()"]
  131a6a0a_f136_c557_236e_cb70f76c1fd8 -->|method| 861d1e4b_89c6_ea2e_c14d_d843954c58f6

Relationship Graph

Source Code

codec-dns/src/main/java/io/netty/handler/codec/dns/DnsOpCode.java lines 23–120

public class DnsOpCode implements Comparable<DnsOpCode> {

    /**
     * The 'Query' DNS OpCode, as defined in <a href="https://tools.ietf.org/html/rfc1035">RFC1035</a>.
     */
    public static final DnsOpCode QUERY = new DnsOpCode(0x00, "QUERY");

    /**
     * The 'IQuery' DNS OpCode, as defined in <a href="https://tools.ietf.org/html/rfc1035">RFC1035</a>.
     */
    public static final DnsOpCode IQUERY = new DnsOpCode(0x01, "IQUERY");

    /**
     * The 'Status' DNS OpCode, as defined in <a href="https://tools.ietf.org/html/rfc1035">RFC1035</a>.
     */
    public static final DnsOpCode STATUS = new DnsOpCode(0x02, "STATUS");

    /**
     * The 'Notify' DNS OpCode, as defined in <a href="https://tools.ietf.org/html/rfc1996">RFC1996</a>.
     */
    public static final DnsOpCode NOTIFY = new DnsOpCode(0x04, "NOTIFY");

    /**
     * The 'Update' DNS OpCode, as defined in <a href="https://tools.ietf.org/html/rfc2136">RFC2136</a>.
     */
    public static final DnsOpCode UPDATE = new DnsOpCode(0x05, "UPDATE");

    /**
     * Returns the {@link DnsOpCode} instance of the specified byte value.
     */
    public static DnsOpCode valueOf(int b) {
        switch (b) {
        case 0x00:
            return QUERY;
        case 0x01:
            return IQUERY;
        case 0x02:
            return STATUS;
        case 0x04:
            return NOTIFY;
        case 0x05:
            return UPDATE;
        default:
            break;
        }

        return new DnsOpCode(b);
    }

    private final byte byteValue;
    private final String name;
    private String text;

    private DnsOpCode(int byteValue) {
        this(byteValue, "UNKNOWN");
    }

    public DnsOpCode(int byteValue, String name) {
        this.byteValue = (byte) byteValue;
        this.name = checkNotNull(name, "name");
    }

    public byte byteValue() {
        return byteValue;
    }

    @Override
    public int hashCode() {
        return byteValue;
    }

    @Override
    public boolean equals(Object obj) {
        if (this == obj) {
            return true;
        }

        if (!(obj instanceof DnsOpCode)) {
            return false;
        }

Frequently Asked Questions

What is the DnsOpCode class?
DnsOpCode is a class in the netty codebase, defined in codec-dns/src/main/java/io/netty/handler/codec/dns/DnsOpCode.java.
Where is DnsOpCode defined?
DnsOpCode is defined in codec-dns/src/main/java/io/netty/handler/codec/dns/DnsOpCode.java at line 23.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free