Package org.microproxy.dns
Record Class DnsMessage.Mx
java.lang.Object
java.lang.Record
org.microproxy.dns.DnsMessage.Mx
- Record Components:
preference- the preference, lower firstexchange- the mail exchange's name
- All Implemented Interfaces:
DnsMessage.Rdata
- Enclosing class:
DnsMessage
public static record DnsMessage.Mx(int preference, String exchange)
extends Record
implements DnsMessage.Rdata
The data of an MX record.
-
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.exchange()Returns the value of theexchangerecord component.final inthashCode()Returns a hash code value for this object.intReturns the value of thepreferencerecord 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
-
Mx
Checks the name.- Parameters:
preference- the preferenceexchange- the mail exchange'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 '=='. -
preference
public int preference()Returns the value of thepreferencerecord component.- Returns:
- the value of the
preferencerecord component
-
exchange
Returns the value of theexchangerecord component.- Returns:
- the value of the
exchangerecord component
-