DNSQuestion
Date: 2017-02-10

javax.jmdns.impl

## Class DNSQuestion

- java.lang.Object
- - javax.jmdns.impl.DNSEntry
  - - javax.jmdns.impl.DNSQuestion

-     public class DNSQuestion
      extends DNSEntry

  A DNS question.

- - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addAnswers(JmDNSImpl jmDNSImpl, java.util.Set<DNSRecord> answers)` Adds answers to the list for our question.
    `protected void` | `addAnswersForServiceInfo(JmDNSImpl jmDNSImpl, java.util.Set<DNSRecord> answers, ServiceInfoImpl info)`
    `boolean` | `iAmTheOnlyOne(JmDNSImpl jmDNSImpl)` Checks if we are the only to be able to answer that question.
    `boolean` | `isExpired(long now)` Check if the record is expired.
    `boolean` | `isStale(long now)` Check if the record is stale, i.e.
    `static DNSQuestion` | `newQuestion(java.lang.String name, DNSRecordType type, DNSRecordClass recordClass, boolean unique)` Create a question.
    `void` | `toString(java.lang.StringBuilder aLog)`

    - ### Methods inherited from class javax.jmdns.impl.DNSEntry

      `compareTo, equals, getKey, getName, getQualifiedNameMap, getRecordClass, getRecordType, getSubtype, getType, hashCode, isDomainDiscoveryQuery, isReverseLookup, isSameEntry, isSameRecordClass, isSameType, isServicesDiscoveryMetaQuery, isUnique, isV4ReverseLookup, isV6ReverseLookup, sameSubtype, toByteArray, toByteArray, toString`

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

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

- - ### Method Detail

    - #### newQuestion

          public static DNSQuestion newQuestion(java.lang.String name,
                                DNSRecordType type,
                                DNSRecordClass recordClass,
                                boolean unique)

      Create a question.
      Parameters:
        `name` - DNS name to be resolved
        `type` - Record type to resolve
        `recordClass` - Record class to resolve
        `unique` - Request unicast response (Currently not supported in this implementation)
      Returns:
        new question

    - #### addAnswers

          public void addAnswers(JmDNSImpl jmDNSImpl,
                        java.util.Set<DNSRecord> answers)

      Adds answers to the list for our question.
      Parameters:
        `jmDNSImpl` - DNS holding the records
        `answers` - List of previous answer to append.

    - #### addAnswersForServiceInfo

          protected void addAnswersForServiceInfo(JmDNSImpl jmDNSImpl,
                                      java.util.Set<DNSRecord> answers,
                                      ServiceInfoImpl info)

    - #### isStale

          public boolean isStale(long now)

      Description copied from class: `DNSEntry`
      Check if the record is stale, i.e. it has outlived more than half of its TTL.
      Specified by:
        `isStale` in class `DNSEntry`
      Parameters:
        `now` - update date
      Returns:
        `true` is the record is stale, `false` otherwise.

    - #### isExpired

          public boolean isExpired(long now)

      Description copied from class: `DNSEntry`
      Check if the record is expired.
      Specified by:
        `isExpired` in class `DNSEntry`
      Parameters:
        `now` - update date
      Returns:
        `true` is the record is expired, `false` otherwise.

    - #### iAmTheOnlyOne

          public boolean iAmTheOnlyOne(JmDNSImpl jmDNSImpl)

      Checks if we are the only to be able to answer that question.
      Parameters:
        `jmDNSImpl` - DNS holding the records
      Returns:
        `true` if we are the only one with the answer to the question, `false` otherwise.

    - #### toString

          public void toString(java.lang.StringBuilder aLog)

      Overrides:
        `toString` in class `DNSEntry`