Package io.netty.handler.codec.dns
Class AbstractDnsRecord
- java.lang.Object
-
- io.netty.handler.codec.dns.AbstractDnsRecord
-
- All Implemented Interfaces:
DnsRecord
- Direct Known Subclasses:
AbstractDnsOptPseudoRrRecord
,DefaultDnsPtrRecord
,DefaultDnsQuestion
,DefaultDnsRawRecord
@UnstableApi public abstract class AbstractDnsRecord extends java.lang.Object implements DnsRecord
A skeletal implementation ofDnsRecord
.
-
-
Field Summary
Fields Modifier and Type Field Description private short
dnsClass
private int
hashCode
private java.lang.String
name
private long
timeToLive
private DnsRecordType
type
-
Fields inherited from interface io.netty.handler.codec.dns.DnsRecord
CLASS_ANY, CLASS_CHAOS, CLASS_CSNET, CLASS_HESIOD, CLASS_IN, CLASS_NONE
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
AbstractDnsRecord(java.lang.String name, DnsRecordType type, int dnsClass, long timeToLive)
Creates a new record.protected
AbstractDnsRecord(java.lang.String name, DnsRecordType type, long timeToLive)
Creates a newIN-class
record.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private static java.lang.String
appendTrailingDot(java.lang.String name)
int
dnsClass()
Returns the class of this resource record.boolean
equals(java.lang.Object obj)
int
hashCode()
private static java.lang.String
IDNtoASCII(java.lang.String name)
java.lang.String
name()
Returns the name of this resource record.long
timeToLive()
Returns the time to live after reading for this resource record.java.lang.String
toString()
DnsRecordType
type()
Returns the type of this resource record.
-
-
-
Field Detail
-
name
private final java.lang.String name
-
type
private final DnsRecordType type
-
dnsClass
private final short dnsClass
-
timeToLive
private final long timeToLive
-
hashCode
private int hashCode
-
-
Constructor Detail
-
AbstractDnsRecord
protected AbstractDnsRecord(java.lang.String name, DnsRecordType type, long timeToLive)
Creates a newIN-class
record.- Parameters:
name
- the domain nametype
- the type of the recordtimeToLive
- the TTL value of the record
-
AbstractDnsRecord
protected AbstractDnsRecord(java.lang.String name, DnsRecordType type, int dnsClass, long timeToLive)
Creates a new record.- Parameters:
name
- the domain nametype
- the type of the recorddnsClass
- the class of the record, usually one of the following:timeToLive
- the TTL value of the record
-
-
Method Detail
-
IDNtoASCII
private static java.lang.String IDNtoASCII(java.lang.String name)
-
appendTrailingDot
private static java.lang.String appendTrailingDot(java.lang.String name)
-
name
public java.lang.String name()
Description copied from interface:DnsRecord
Returns the name of this resource record.
-
type
public DnsRecordType type()
Description copied from interface:DnsRecord
Returns the type of this resource record.
-
dnsClass
public int dnsClass()
Description copied from interface:DnsRecord
Returns the class of this resource record.
-
timeToLive
public long timeToLive()
Description copied from interface:DnsRecord
Returns the time to live after reading for this resource record.- Specified by:
timeToLive
in interfaceDnsRecord
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-