java.lang.Object
java.lang.Record
com.yahoo.vespa.hosted.controller.api.integration.dns.Record
All Implemented Interfaces:
Comparable<Record>

public record Record(Record.Type type, Duration ttl, RecordName name, RecordData data) extends Record implements Comparable<Record>
A basic representation of a DNS resource record, containing the record type, name and data.
Author:
mpolden
  • Constructor Details

    • Record

      public Record(Record.Type type, Duration ttl, RecordName name, RecordData data)
      Creates an instance of a Record record class.
      Parameters:
      type - the value for the type record component
      ttl - the value for the ttl record component
      name - the value for the name record component
      data - the value for the data record component
    • Record

      public Record(Record.Type type, RecordName name, RecordData data)
  • Method Details

    • type

      public Record.Type type()
      DNS type of this
    • ttl

      public Duration ttl()
      The TTL value of this
    • data

      public RecordData data()
      Data in this, e.g. IP address for records of type A
    • name

      public RecordName name()
      Name of this, e.g. a FQDN for records of type A
    • toString

      public String 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.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • compareTo

      public int compareTo(Record that)
      Specified by:
      compareTo in interface Comparable<Record>
    • 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.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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 with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.