com.h3c.util.pkt

## Class Dns.ResRecord<T>

- java.lang.Object
- - com.h3c.util.pkt.Dns.Record
  - - com.h3c.util.pkt.Dns.ResRecord<T>

- Type Parameters:
    `T` - specific type of resource data (String, IpAddress, byte[])
  Enclosing class:
    Dns

      public static class Dns.ResRecord<T>
      extends Dns.Record

  DNS resource record data store (immutable).

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `Dns.ResRecord(String name, Dns.RecordType recType, Dns.ClassType clsType, long ttl, T data)` Constructs a resource record.
    `Dns.ResRecord(String name, Dns.RecordType recType, long ttl, T data)` Constructs a resource record with `Dns.ClassType.INTERNET`.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `T` | `data()` Returns the resource data or null if not supported.
    `String` | `toString()`
    `long` | `ttl()` Returns the number of seconds the resource can be cached (TTL).

    - ### Methods inherited from class com.h3c.util.pkt.Dns.Record

      `clsType, equals, hashCode, name, recType`

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

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

- - ### Constructor Detail

    - #### Dns.ResRecord

          public Dns.ResRecord(String name,
                       Dns.RecordType recType,
                       Dns.ClassType clsType,
                       long ttl,
                       T data)

      Constructs a resource record.
      Parameters:
        `name` - the domain name that was queried
        `recType` - the record type
        `clsType` - the class type
        `ttl` - the number of seconds the resource can be cached
        `data` - the resource data, can be null

    - #### Dns.ResRecord

          public Dns.ResRecord(String name,
                       Dns.RecordType recType,
                       long ttl,
                       T data)

      Constructs a resource record with `Dns.ClassType.INTERNET`.
      Parameters:
        `name` - the domain name that was queried
        `recType` - the record type.
        `ttl` - the number of seconds the resource can be cached.
        `data` - the resource data, can be null

  - ### Method Detail

    - #### ttl

          public long ttl()

      Returns the number of seconds the resource can be cached (TTL).
      Returns:
        the TTL of this record

    - #### data

          public T data()

      Returns the resource data or null if not supported.
      Returns:
        the resource data.

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Dns.Record`

Copyright © 2014. All Rights Reserved.