org.minidns.dnsmessage

## Class Question

- java.lang.Object
- - org.minidns.dnsmessage.Question

-     public class Question
      extends Object

  A DNS question (request).

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `Record.CLASS` | `clazz` The question class (usually IN for Internet).
    `DnsName` | `name` The question string (e.g.
    `Record.TYPE` | `type` The question type (e.g.

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `Question(CharSequence name, Record.TYPE type)` Create a dns question for the given name/type/IN (internet class).
    `Question(CharSequence name, Record.TYPE type, Record.CLASS clazz)` Create a dns question for the given name/type/class.
    `Question(CharSequence name, Record.TYPE type, Record.CLASS clazz, boolean unicastQuery)` Create a dns question for the given name/type/class.
    `Question(DataInputStream dis, byte[] data)` Parse a byte array and rebuild the dns question from it.
    `Question(DnsName name, Record.TYPE type)` Create a dns question for the given name/type/IN (internet class).
    `Question(DnsName name, Record.TYPE type, Record.CLASS clazz)` Create a dns question for the given name/type/class.
    `Question(DnsName name, Record.TYPE type, Record.CLASS clazz, boolean unicastQuery)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `DnsMessage.Builder` | `asMessageBuilder()`
    `DnsMessage` | `asQueryMessage()`
    `boolean` | `equals(Object other)`
    `int` | `hashCode()`
    `byte[]` | `toByteArray()` Generate a binary paket for this dns question.
    `String` | `toString()`

    - ### Methods inherited from class java.lang.Object

      `clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

- - ### Field Detail

    - #### clazz

          public final Record.CLASS clazz

      The question class (usually IN for Internet).

    - #### name

          public final DnsName name

      The question string (e.g. "measite.de").

    - #### type

          public final Record.TYPE type

      The question type (e.g. A).

  - ### Constructor Detail

    - #### Question

          public Question(CharSequence name,
                          Record.TYPE type)

      Create a dns question for the given name/type/IN (internet class).
      Parameters:
        `name` - The name e.g. "measite.de".
        `type` - The type, e.g. A.

    - #### Question

          public Question(CharSequence name,
                          Record.TYPE type,
                          Record.CLASS clazz)

      Create a dns question for the given name/type/class.
      Parameters:
        `name` - The name e.g. "measite.de".
        `type` - The type, e.g. A.
        `clazz` - The class, usually IN (internet).

    - #### Question

          public Question(CharSequence name,
                          Record.TYPE type,
                          Record.CLASS clazz,
                          boolean unicastQuery)

      Create a dns question for the given name/type/class.
      Parameters:
        `name` - The name e.g. "measite.de".
        `type` - The type, e.g. A.
        `clazz` - The class, usually IN (internet).
        `unicastQuery` - True if this is a unicast query.

    - #### Question

          public Question(DataInputStream dis,
                          byte[] data)
                   throws IOException

      Parse a byte array and rebuild the dns question from it.
      Parameters:
        `dis` - The input stream.
        `data` - The plain data (for dns name references).
      Throws:
        `IOException` - On errors (read outside of packet).

    - #### Question

          public Question(DnsName name,
                          Record.TYPE type)

      Create a dns question for the given name/type/IN (internet class).
      Parameters:
        `name` - The name e.g. "measite.de".
        `type` - The type, e.g. A.

    - #### Question

          public Question(DnsName name,
                          Record.TYPE type,
                          Record.CLASS clazz)

      Create a dns question for the given name/type/class.
      Parameters:
        `name` - The name e.g. "measite.de".
        `type` - The type, e.g. A.
        `clazz` - The class, usually IN (internet).

    - #### Question

          public Question(DnsName name,
                          Record.TYPE type,
                          Record.CLASS clazz,
                          boolean unicastQuery)

  - ### Method Detail

    - #### asMessageBuilder

          public DnsMessage.Builder asMessageBuilder()

    - #### asQueryMessage

          public DnsMessage asQueryMessage()

    - #### equals

          public boolean equals(Object other)

      Overrides:
        `equals` in class `Object`

    - #### hashCode

          public int hashCode()

      Overrides:
        `hashCode` in class `Object`

    - #### toByteArray

          public byte[] toByteArray()

      Generate a binary paket for this dns question.
      Returns:
        The dns question.

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`