Record Class PronounRecord

java.lang.Object
java.lang.Record
me.folf.podns4j.model.PronounRecord
Record Components:
type - the type of record
pronounSet - the pronoun set (null for non-pronoun-set types)
comment - optional comment

public record PronounRecord(RecordType type, PronounSet pronounSet, String comment, String raw) extends Record
Represents a parsed pronoun record from DNS.
  • Constructor Details

    • PronounRecord

      public PronounRecord(RecordType type, PronounSet pronounSet, String comment, String raw)
      Validates record parameters.
      Parameters:
      type - the record type
      pronounSet - the pronoun set
      comment - the comment
      raw - the raw record string
    • PronounRecord

      public PronounRecord(PronounSet pronounSet, String raw)
      Creates pronoun set record.
      Parameters:
      pronounSet - the pronoun set
      raw - the raw record string
    • PronounRecord

      public PronounRecord(RecordType type, String raw)
      Creates wildcard, none, or comment record.
      Parameters:
      type - the record type
      raw - the raw record string
    • PronounRecord

      public PronounRecord(RecordType type, String comment, String raw)
      Creates wildcard, none, or comment record with comment.
      Parameters:
      type - the record type
      comment - the comment
      raw - the raw record string
  • Method Details

    • isWildcard

      public boolean isWildcard()
      Returns true if wildcard.
      Returns:
      true if wildcard
    • isNone

      public boolean isNone()
      Returns true if none record.
      Returns:
      true if none
    • isPronounSet

      public boolean isPronounSet()
      Returns true if pronoun set.
      Returns:
      true if pronoun set
    • isCommentOnly

      public boolean isCommentOnly()
      Returns true if comment only.
      Returns:
      true if comment only
    • 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
    • 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.
    • type

      public RecordType type()
      Returns the value of the type record component.
      Returns:
      the value of the type record component
    • pronounSet

      public PronounSet pronounSet()
      Returns the value of the pronounSet record component.
      Returns:
      the value of the pronounSet record component
    • comment

      public String comment()
      Returns the value of the comment record component.
      Returns:
      the value of the comment record component
    • raw

      public String raw()
      Returns the value of the raw record component.
      Returns:
      the value of the raw record component