@UnstableApi public abstract class AbstractDnsMessage extends AbstractReferenceCounted implements DnsMessage
DnsMessage.| 限定符 | 构造器和说明 |
|---|---|
protected |
AbstractDnsMessage(int id)
Creates a new instance with the specified
id and DnsOpCode.QUERY opCode. |
protected |
AbstractDnsMessage(int id,
DnsOpCode opCode)
Creates a new instance with the specified
id and opCode. |
| 限定符和类型 | 方法和说明 |
|---|---|
DnsMessage |
addRecord(DnsSection section,
DnsRecord record)
Adds the specified
record at the end of the specified section of this DNS message. |
DnsMessage |
addRecord(DnsSection section,
int index,
DnsRecord record)
Adds the specified
record at the specified index of the specified section
of this DNS message. |
DnsMessage |
clear()
Removes all the records in this DNS message.
|
DnsMessage |
clear(DnsSection section)
Removes all the records in the specified
section of this DNS message. |
int |
count()
Returns the number of records in this DNS message.
|
int |
count(DnsSection section)
Returns the number of records in the specified
section of this DNS message. |
protected void |
deallocate()
Called once
AbstractReferenceCounted.refCnt() is equals 0. |
boolean |
equals(java.lang.Object obj) |
int |
hashCode() |
int |
id()
Returns the
ID of this DNS message. |
boolean |
isRecursionDesired()
Returns the
RD (recursion desired} field of this DNS message. |
DnsOpCode |
opCode()
Returns the
opCode of this DNS message. |
<T extends DnsRecord> |
recordAt(DnsSection section)
Returns the first record in the specified
section of this DNS message. |
<T extends DnsRecord> |
recordAt(DnsSection section,
int index)
Returns the record at the specified
index of the specified section of this DNS message. |
<T extends DnsRecord> |
removeRecord(DnsSection section,
int index)
Removes the record at the specified
index of the specified section from this DNS message. |
DnsMessage |
retain()
Increases the reference count by
1. |
DnsMessage |
retain(int increment)
Increases the reference count by the specified
increment. |
DnsMessage |
setId(int id)
Sets the
ID of this DNS message. |
DnsMessage |
setOpCode(DnsOpCode opCode)
Sets the
opCode of this DNS message. |
DnsMessage |
setRecord(DnsSection section,
DnsRecord record)
Sets the specified
section of this DNS message to the specified record,
making it a single-record section. |
<T extends DnsRecord> |
setRecord(DnsSection section,
int index,
DnsRecord record)
Sets the specified
record at the specified index of the specified section
of this DNS message. |
DnsMessage |
setRecursionDesired(boolean recursionDesired)
Sets the
RD (recursion desired} field of this DNS message. |
DnsMessage |
setZ(int z)
Sets the
Z (reserved for future use) field of this DNS message. |
DnsMessage |
touch()
Records the current access location of this object for debugging purposes.
|
DnsMessage |
touch(java.lang.Object hint)
Records the current access location of this object with an additional arbitrary information for debugging
purposes.
|
int |
z()
Returns the
Z (reserved for future use) field of this DNS message. |
refCnt, release, release, setRefCntrefCnt, release, releaseprotected AbstractDnsMessage(int id)
id and DnsOpCode.QUERY opCode.protected AbstractDnsMessage(int id,
DnsOpCode opCode)
id and opCode.public int id()
DnsMessageID of this DNS message.id 在接口中 DnsMessagepublic DnsMessage setId(int id)
DnsMessageID of this DNS message.setId 在接口中 DnsMessagepublic DnsOpCode opCode()
DnsMessageopCode of this DNS message.opCode 在接口中 DnsMessagepublic DnsMessage setOpCode(DnsOpCode opCode)
DnsMessageopCode of this DNS message.setOpCode 在接口中 DnsMessagepublic boolean isRecursionDesired()
DnsMessageRD (recursion desired} field of this DNS message.isRecursionDesired 在接口中 DnsMessagepublic DnsMessage setRecursionDesired(boolean recursionDesired)
DnsMessageRD (recursion desired} field of this DNS message.setRecursionDesired 在接口中 DnsMessagepublic int z()
DnsMessageZ (reserved for future use) field of this DNS message.z 在接口中 DnsMessagepublic DnsMessage setZ(int z)
DnsMessageZ (reserved for future use) field of this DNS message.setZ 在接口中 DnsMessagepublic int count(DnsSection section)
DnsMessagesection of this DNS message.count 在接口中 DnsMessagepublic int count()
DnsMessagecount 在接口中 DnsMessagepublic <T extends DnsRecord> T recordAt(DnsSection section)
DnsMessagesection of this DNS message.
When the specified section is DnsSection.QUESTION, the type of the returned record is
always DnsQuestion.recordAt 在接口中 DnsMessagenull if this message doesn't have any records in the specified sectionpublic <T extends DnsRecord> T recordAt(DnsSection section, int index)
DnsMessageindex of the specified section of this DNS message.
When the specified section is DnsSection.QUESTION, the type of the returned record is
always DnsQuestion.recordAt 在接口中 DnsMessagepublic DnsMessage setRecord(DnsSection section, DnsRecord record)
DnsMessagesection of this DNS message to the specified record,
making it a single-record section. When the specified section is DnsSection.QUESTION,
the specified record must be a DnsQuestion.setRecord 在接口中 DnsMessagepublic <T extends DnsRecord> T setRecord(DnsSection section, int index, DnsRecord record)
DnsMessagerecord at the specified index of the specified section
of this DNS message. When the specified section is DnsSection.QUESTION,
the specified record must be a DnsQuestion.setRecord 在接口中 DnsMessagepublic DnsMessage addRecord(DnsSection section, DnsRecord record)
DnsMessagerecord at the end of the specified section of this DNS message.
When the specified section is DnsSection.QUESTION, the specified record
must be a DnsQuestion.addRecord 在接口中 DnsMessagepublic DnsMessage addRecord(DnsSection section, int index, DnsRecord record)
DnsMessagerecord at the specified index of the specified section
of this DNS message. When the specified section is DnsSection.QUESTION, the specified
record must be a DnsQuestion.addRecord 在接口中 DnsMessagepublic <T extends DnsRecord> T removeRecord(DnsSection section, int index)
DnsMessageindex of the specified section from this DNS message.
When the specified section is DnsSection.QUESTION, the type of the returned record is
always DnsQuestion.removeRecord 在接口中 DnsMessagepublic DnsMessage clear(DnsSection section)
DnsMessagesection of this DNS message.clear 在接口中 DnsMessagepublic DnsMessage clear()
DnsMessageclear 在接口中 DnsMessagepublic DnsMessage touch()
ReferenceCountedResourceLeakDetector. This method is a shortcut to touch(null).touch 在接口中 DnsMessagetouch 在接口中 ReferenceCountedtouch 在类中 AbstractReferenceCountedpublic DnsMessage touch(java.lang.Object hint)
ReferenceCountedResourceLeakDetector.touch 在接口中 DnsMessagetouch 在接口中 ReferenceCountedpublic DnsMessage retain()
ReferenceCounted1.retain 在接口中 DnsMessageretain 在接口中 ReferenceCountedretain 在类中 AbstractReferenceCountedpublic DnsMessage retain(int increment)
ReferenceCountedincrement.retain 在接口中 DnsMessageretain 在接口中 ReferenceCountedretain 在类中 AbstractReferenceCountedprotected void deallocate()
AbstractReferenceCountedAbstractReferenceCounted.refCnt() is equals 0.deallocate 在类中 AbstractReferenceCountedpublic boolean equals(java.lang.Object obj)
equals 在类中 java.lang.Objectpublic int hashCode()
hashCode 在类中 java.lang.Object