Package org.microproxy.dns
Record Class DnsMessage.Txt
java.lang.Object
java.lang.Record
org.microproxy.dns.DnsMessage.Txt
- Record Components:
strings- the strings, each at most 255 bytes in UTF-8
- All Implemented Interfaces:
DnsMessage.Rdata
- Enclosing class:
DnsMessage
public static record DnsMessage.Txt(List<String> strings)
extends Record
implements DnsMessage.Rdata
The data of a TXT record: its character strings, read as UTF-8 (use
DnsMessage.ResourceRecord.rdata() for strings of other bytes).-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbyte[]encode(int type) The RDATA for a record oftype.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.strings()Returns the value of thestringsrecord component.text()Returns the data in presentation format, as a zone file shows it.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
Txt
Copies the list.- Parameters:
strings- the strings
-
-
Method Details
-
text
Description copied from interface:DnsMessage.RdataReturns the data in presentation format, as a zone file shows it.- Specified by:
textin interfaceDnsMessage.Rdata- Returns:
- the data in presentation format, as a zone file shows it
-
encode
public byte[] encode(int type) Description copied from interface:DnsMessage.RdataThe RDATA for a record oftype.- Specified by:
encodein interfaceDnsMessage.Rdata- Parameters:
type- the record's type- Returns:
- the RDATA bytes
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
strings
Returns the value of thestringsrecord component.- Returns:
- the value of the
stringsrecord component
-