Package org.microproxy.dns
Record Class DnsMessage.Name
java.lang.Object
java.lang.Record
org.microproxy.dns.DnsMessage.Name
- Record Components:
name- the name, in presentation format
- All Implemented Interfaces:
DnsMessage.Rdata
- Enclosing class:
DnsMessage
A domain name, the data of NS, CNAME, PTR and DNAME records.
-
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.name()Returns the value of thenamerecord 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
-
Name
Checks the name.- Parameters:
name- the name, in presentation format- Throws:
IllegalArgumentException- if it is not a valid domain name
-
-
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). -
name
Returns the value of thenamerecord component.- Returns:
- the value of the
namerecord component
-