DNSRecord
Date: 2017-02-10

javax.jmdns.impl

## Class DNSRecord

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

- Direct Known Subclasses:
    DNSRecord.Address, DNSRecord.HostInformation, DNSRecord.Pointer, DNSRecord.Service, DNSRecord.Text

      public abstract class DNSRecord
      extends DNSEntry

  DNS record

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static class` | `DNSRecord.Address` Address record.
    `static class` | `DNSRecord.HostInformation`
    `static class` | `DNSRecord.IPv4Address`
    `static class` | `DNSRecord.IPv6Address`
    `static class` | `DNSRecord.Pointer` Pointer record.
    `static class` | `DNSRecord.Service` Service record.
    `static class` | `DNSRecord.Text`

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static byte[]` | `EMPTY_TXT`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `equals(java.lang.Object other)`
    `java.net.InetAddress` | `getRecordSource()`
    `abstract ServiceEvent` | `getServiceEvent(JmDNSImpl dns)` Creates and return a service event for this record.
    `ServiceInfo` | `getServiceInfo()` Return a service information associated with that record if appropriate.
    `abstract ServiceInfo` | `getServiceInfo(boolean persistent)` Return a service information associated with that record if appropriate.
    `int` | `getTTL()`
    `boolean` | `isExpired(long now)` Check if the record is expired.
    `abstract boolean` | `isSingleValued()` Determine if a record can have multiple values in the cache.
    `boolean` | `isStale(long now)` Check if the record is stale, i.e.
    `void` | `setRecordSource(java.net.InetAddress source)`
    `void` | `setTTL(int ttl)`
    `protected void` | `toString(java.lang.StringBuilder aLog)`

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

      `compareTo, 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`

- - ### Field Detail

    - #### EMPTY_TXT

          public static final byte[] EMPTY_TXT

  - ### Method Detail

    - #### equals

          public boolean equals(java.lang.Object other)

      Overrides:
        `equals` in class `DNSEntry`

    - #### 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.

    - #### 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.

    - #### isSingleValued

          public abstract boolean isSingleValued()

      Determine if a record can have multiple values in the cache.
      Returns:
        `false` if this record can have multiple values in the cache, `true` otherwise.

    - #### getServiceInfo

          public ServiceInfo getServiceInfo()

      Return a service information associated with that record if appropriate.
      Returns:
        service information

    - #### getServiceInfo

          public abstract ServiceInfo getServiceInfo(boolean persistent)

      Return a service information associated with that record if appropriate.
      Parameters:
        `persistent` - if `true` ServiceListener.resolveService will be called whenever new new information is received.
      Returns:
        service information

    - #### getServiceEvent

          public abstract ServiceEvent getServiceEvent(JmDNSImpl dns)

      Creates and return a service event for this record.
      Parameters:
        `dns` - DNS serviced by this event
      Returns:
        service event

    - #### setRecordSource

          public void setRecordSource(java.net.InetAddress source)

    - #### getRecordSource

          public java.net.InetAddress getRecordSource()

    - #### toString

          protected void toString(java.lang.StringBuilder aLog)

      Overrides:
        `toString` in class `DNSEntry`

    - #### setTTL

          public void setTTL(int ttl)

    - #### getTTL

          public int getTTL()