Home / Class/ DefaultDnsPtrRecord Class — netty Architecture

DefaultDnsPtrRecord Class — netty Architecture

Architecture documentation for the DefaultDnsPtrRecord class in DefaultDnsPtrRecord.java from the netty codebase.

Entity Profile

Dependency Diagram

graph TD
  f54f636c_5cd7_867e_b5a9_5c8d8a0773f2["DefaultDnsPtrRecord"]
  2d04bba0_5f0a_e31a_0404_45bce69cb51d["DefaultDnsPtrRecord.java"]
  f54f636c_5cd7_867e_b5a9_5c8d8a0773f2 -->|defined in| 2d04bba0_5f0a_e31a_0404_45bce69cb51d
  f3758864_f5f7_a043_d3df_6094a0ea886f["DefaultDnsPtrRecord()"]
  f54f636c_5cd7_867e_b5a9_5c8d8a0773f2 -->|method| f3758864_f5f7_a043_d3df_6094a0ea886f
  099a3bc2_2f9b_a04b_6276_4001cd032ca8["String()"]
  f54f636c_5cd7_867e_b5a9_5c8d8a0773f2 -->|method| 099a3bc2_2f9b_a04b_6276_4001cd032ca8

Relationship Graph

Source Code

codec-dns/src/main/java/io/netty/handler/codec/dns/DefaultDnsPtrRecord.java lines 22–71

public class DefaultDnsPtrRecord extends AbstractDnsRecord implements DnsPtrRecord {

    private final String hostname;

    /**
     * Creates a new PTR record.
     *
     * @param name the domain name
     * @param dnsClass the class of the record, usually one of the following:
     *                 <ul>
     *                     <li>{@link #CLASS_IN}</li>
     *                     <li>{@link #CLASS_CSNET}</li>
     *                     <li>{@link #CLASS_CHAOS}</li>
     *                     <li>{@link #CLASS_HESIOD}</li>
     *                     <li>{@link #CLASS_NONE}</li>
     *                     <li>{@link #CLASS_ANY}</li>
     *                 </ul>
     * @param timeToLive the TTL value of the record
     * @param hostname the hostname this PTR record resolves to.
     */
    public DefaultDnsPtrRecord(
            String name, int dnsClass, long timeToLive, String hostname) {
        super(name, DnsRecordType.PTR, dnsClass, timeToLive);
        this.hostname = checkNotNull(hostname, "hostname");
    }

    @Override
    public String hostname() {
        return hostname;
    }

    @Override
    public String toString() {
        final StringBuilder buf = new StringBuilder(64).append(StringUtil.simpleClassName(this)).append('(');
        final DnsRecordType type = type();
        buf.append(name().isEmpty()? "<root>" : name())
           .append(' ')
           .append(timeToLive())
           .append(' ');

        DnsMessageUtil.appendRecordClass(buf, dnsClass())
                      .append(' ')
                      .append(type.name());

        buf.append(' ')
           .append(hostname);

        return buf.toString();
    }
}

Frequently Asked Questions

What is the DefaultDnsPtrRecord class?
DefaultDnsPtrRecord is a class in the netty codebase, defined in codec-dns/src/main/java/io/netty/handler/codec/dns/DefaultDnsPtrRecord.java.
Where is DefaultDnsPtrRecord defined?
DefaultDnsPtrRecord is defined in codec-dns/src/main/java/io/netty/handler/codec/dns/DefaultDnsPtrRecord.java at line 22.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free