Package io.netty.handler.codec.dns
Class DefaultDnsRawRecord
- java.lang.Object
-
- io.netty.handler.codec.dns.AbstractDnsRecord
-
- io.netty.handler.codec.dns.DefaultDnsRawRecord
-
- All Implemented Interfaces:
ByteBufHolder,DnsRawRecord,DnsRecord,ReferenceCounted
public class DefaultDnsRawRecord extends AbstractDnsRecord implements DnsRawRecord
The defaultDnsRawRecordimplementation.
-
-
Field Summary
-
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 Constructor Description DefaultDnsRawRecord(java.lang.String name, DnsRecordType type, int dnsClass, long timeToLive, ByteBuf content)Creates a new record.DefaultDnsRawRecord(java.lang.String name, DnsRecordType type, long timeToLive, ByteBuf content)Creates a newIN-classrecord.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ByteBufcontent()Return the data which is held by thisByteBufHolder.DnsRawRecordcopy()Creates a deep copy of thisByteBufHolder.DnsRawRecordduplicate()Duplicates thisByteBufHolder.intrefCnt()Returns the reference count of this object.booleanrelease()Decreases the reference count by1and deallocates this object if the reference count reaches at0.booleanrelease(int decrement)Decreases the reference count by the specifieddecrementand deallocates this object if the reference count reaches at0.DnsRawRecordreplace(ByteBuf content)Returns a newByteBufHolderwhich contains the specifiedcontent.DnsRawRecordretain()Increases the reference count by1.DnsRawRecordretain(int increment)Increases the reference count by the specifiedincrement.DnsRawRecordretainedDuplicate()Duplicates thisByteBufHolder.java.lang.StringtoString()DnsRawRecordtouch()Records the current access location of this object for debugging purposes.DnsRawRecordtouch(java.lang.Object hint)Records the current access location of this object with an additional arbitrary information for debugging purposes.-
Methods inherited from class io.netty.handler.codec.dns.AbstractDnsRecord
dnsClass, equals, hashCode, name, timeToLive, type
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface io.netty.handler.codec.dns.DnsRecord
dnsClass, name, timeToLive, type
-
-
-
-
Constructor Detail
-
DefaultDnsRawRecord
public DefaultDnsRawRecord(java.lang.String name, DnsRecordType type, long timeToLive, ByteBuf content)Creates a newIN-classrecord.- Parameters:
name- the domain nametype- the type of the recordtimeToLive- the TTL value of the record
-
DefaultDnsRawRecord
public DefaultDnsRawRecord(java.lang.String name, DnsRecordType type, int dnsClass, long timeToLive, ByteBuf content)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
-
content
public ByteBuf content()
Description copied from interface:ByteBufHolderReturn the data which is held by thisByteBufHolder.- Specified by:
contentin interfaceByteBufHolder
-
copy
public DnsRawRecord copy()
Description copied from interface:ByteBufHolderCreates a deep copy of thisByteBufHolder.- Specified by:
copyin interfaceByteBufHolder- Specified by:
copyin interfaceDnsRawRecord
-
duplicate
public DnsRawRecord duplicate()
Description copied from interface:ByteBufHolderDuplicates thisByteBufHolder. Be aware that this will not automatically callByteBufHolder.retain().- Specified by:
duplicatein interfaceByteBufHolder- Specified by:
duplicatein interfaceDnsRawRecord
-
retainedDuplicate
public DnsRawRecord retainedDuplicate()
Description copied from interface:ByteBufHolderDuplicates thisByteBufHolder. This method returns a retained duplicate unlikeByteBufHolder.duplicate().- Specified by:
retainedDuplicatein interfaceByteBufHolder- Specified by:
retainedDuplicatein interfaceDnsRawRecord- See Also:
ByteBuf.retainedDuplicate()
-
replace
public DnsRawRecord replace(ByteBuf content)
Description copied from interface:ByteBufHolderReturns a newByteBufHolderwhich contains the specifiedcontent.- Specified by:
replacein interfaceByteBufHolder- Specified by:
replacein interfaceDnsRawRecord
-
refCnt
public int refCnt()
Description copied from interface:ReferenceCountedReturns the reference count of this object. If0, it means this object has been deallocated.- Specified by:
refCntin interfaceReferenceCounted
-
retain
public DnsRawRecord retain()
Description copied from interface:ReferenceCountedIncreases the reference count by1.- Specified by:
retainin interfaceByteBufHolder- Specified by:
retainin interfaceDnsRawRecord- Specified by:
retainin interfaceReferenceCounted
-
retain
public DnsRawRecord retain(int increment)
Description copied from interface:ReferenceCountedIncreases the reference count by the specifiedincrement.- Specified by:
retainin interfaceByteBufHolder- Specified by:
retainin interfaceDnsRawRecord- Specified by:
retainin interfaceReferenceCounted
-
release
public boolean release()
Description copied from interface:ReferenceCountedDecreases the reference count by1and deallocates this object if the reference count reaches at0.- Specified by:
releasein interfaceReferenceCounted- Returns:
trueif and only if the reference count became0and this object has been deallocated
-
release
public boolean release(int decrement)
Description copied from interface:ReferenceCountedDecreases the reference count by the specifieddecrementand deallocates this object if the reference count reaches at0.- Specified by:
releasein interfaceReferenceCounted- Returns:
trueif and only if the reference count became0and this object has been deallocated
-
touch
public DnsRawRecord touch()
Description copied from interface:ReferenceCountedRecords the current access location of this object for debugging purposes. If this object is determined to be leaked, the information recorded by this operation will be provided to you viaResourceLeakDetector. This method is a shortcut totouch(null).- Specified by:
touchin interfaceByteBufHolder- Specified by:
touchin interfaceDnsRawRecord- Specified by:
touchin interfaceReferenceCounted
-
touch
public DnsRawRecord touch(java.lang.Object hint)
Description copied from interface:ReferenceCountedRecords the current access location of this object with an additional arbitrary information for debugging purposes. If this object is determined to be leaked, the information recorded by this operation will be provided to you viaResourceLeakDetector.- Specified by:
touchin interfaceByteBufHolder- Specified by:
touchin interfaceDnsRawRecord- Specified by:
touchin interfaceReferenceCounted
-
toString
public java.lang.String toString()
- Overrides:
toStringin classAbstractDnsRecord
-
-