Class Question


  • public class Question
    extends java.lang.Object
    A DNS question (request).
    • Field Detail

      • name

        public final DnsName name
        The question string (e.g. "measite.de").
      • clazz

        public final Record.CLASS clazz
        The question class (usually IN for Internet).
    • Constructor Detail

      • Question

        public Question​(java.lang.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​(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)
        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​(java.lang.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​(java.lang.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​(java.io.DataInputStream dis,
                        byte[] data)
                 throws java.io.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:
        java.io.IOException - On errors (read outside of packet).
    • Method Detail

      • toByteArray

        public byte[] toByteArray()
        Generate a binary paket for this dns question.
        Returns:
        The dns question.
      • hashCode

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

        public boolean equals​(java.lang.Object other)
        Overrides:
        equals in class java.lang.Object
      • toString

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