Package org.microproxy.dns
Record Class DnsMessage.Srv
java.lang.Object
java.lang.Record
org.microproxy.dns.DnsMessage.Srv
- Record Components:
priority- the priority, lower firstweight- the weight among records of the same priorityport- the porttarget- the target host's name
- All Implemented Interfaces:
DnsMessage.Rdata
- Enclosing class:
DnsMessage
public static record DnsMessage.Srv(int priority, int weight, int port, String target)
extends Record
implements DnsMessage.Rdata
The data of an SRV record (RFC 2782).
-
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.intport()Returns the value of theportrecord component.intpriority()Returns the value of thepriorityrecord component.target()Returns the value of thetargetrecord component.text()Returns the data in presentation format, as a zone file shows it.final StringtoString()Returns a string representation of this record class.intweight()Returns the value of theweightrecord component.
-
Constructor Details
-
Srv
Checks the name.- Parameters:
priority- the priorityweight- the weightport- the porttarget- the target host's 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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='. -
priority
public int priority()Returns the value of thepriorityrecord component.- Returns:
- the value of the
priorityrecord component
-
weight
public int weight()Returns the value of theweightrecord component.- Returns:
- the value of the
weightrecord component
-
port
public int port()Returns the value of theportrecord component.- Returns:
- the value of the
portrecord component
-
target
Returns the value of thetargetrecord component.- Returns:
- the value of the
targetrecord component
-