Package me.folf.podns4j.model
Record Class PronounRecord
java.lang.Object
java.lang.Record
me.folf.podns4j.model.PronounRecord
- Record Components:
type- the type of recordpronounSet- 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 Summary
ConstructorsConstructorDescriptionPronounRecord(PronounSet pronounSet, String raw) Creates pronoun set record.PronounRecord(RecordType type, String raw) Creates wildcard, none, or comment record.PronounRecord(RecordType type, String comment, String raw) Creates wildcard, none, or comment record with comment.PronounRecord(RecordType type, PronounSet pronounSet, String comment, String raw) Validates record parameters. -
Method Summary
Modifier and TypeMethodDescriptioncomment()Returns the value of thecommentrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.booleanReturns true if comment only.booleanisNone()Returns true if none record.booleanReturns true if pronoun set.booleanReturns true if wildcard.Returns the value of thepronounSetrecord component.raw()Returns the value of therawrecord component.toString()Returns a string representation of this record class.type()Returns the value of thetyperecord component.
-
Constructor Details
-
PronounRecord
Validates record parameters.- Parameters:
type- the record typepronounSet- the pronoun setcomment- the commentraw- the raw record string
-
PronounRecord
Creates pronoun set record.- Parameters:
pronounSet- the pronoun setraw- the raw record string
-
PronounRecord
Creates wildcard, none, or comment record.- Parameters:
type- the record typeraw- the raw record string
-
PronounRecord
Creates wildcard, none, or comment record with comment.- Parameters:
type- the record typecomment- the commentraw- 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
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). -
type
Returns the value of thetyperecord component.- Returns:
- the value of the
typerecord component
-
pronounSet
Returns the value of thepronounSetrecord component.- Returns:
- the value of the
pronounSetrecord component
-
comment
Returns the value of thecommentrecord component.- Returns:
- the value of the
commentrecord component
-
raw
Returns the value of therawrecord component.- Returns:
- the value of the
rawrecord component
-