Package me.folf.podns4j.model
Record Class PronounResult
java.lang.Object
java.lang.Record
me.folf.podns4j.model.PronounResult
- Record Components:
preferred- the preferred pronoun set (may be null if person prefers name)allSets- all available pronoun setsacceptsAny- true if the person accepts any pronouns (wildcard was present)prefersName- true if the person prefers to be referred to by name (none record)
public record PronounResult(PronounSet preferred, List<PronounSet> allSets, boolean acceptsAny, boolean prefersName)
extends Record
Result of pronoun lookup, containing the preferred pronoun set and context.
-
Constructor Summary
ConstructorsConstructorDescriptionPronounResult(PronounSet preferred, List<PronounSet> allSets, boolean acceptsAny, boolean prefersName) Validates and copies parameters. -
Method Summary
Modifier and TypeMethodDescriptionbooleanReturns the value of theacceptsAnyrecord component.allSets()Returns the value of theallSetsrecord component.final booleanIndicates whether some other object is "equal to" this one.static PronounResultfromRecords(List<PronounRecord> records) Creates a pronoun result from a list of pronoun records.final inthashCode()Returns a hash code value for this object.static PronounResultnone()Creates none result.Returns the value of thepreferredrecord component.booleanReturns the value of theprefersNamerecord component.static PronounResultstandard(PronounSet preferred, List<PronounSet> allSets) Creates standard result.toString()Returns a string representation of this record class.static PronounResultwildcard(PronounSet preferred, List<PronounSet> allSets) Creates wildcard result.
-
Constructor Details
-
PronounResult
public PronounResult(PronounSet preferred, List<PronounSet> allSets, boolean acceptsAny, boolean prefersName) Validates and copies parameters.- Parameters:
preferred- the preferred setallSets- all setsacceptsAny- accepts anyprefersName- prefers name
-
-
Method Details
-
fromRecords
Creates a pronoun result from a list of pronoun records.- Parameters:
records- the records to process- Returns:
- the pronoun result, or null if records is empty or contains only comments
-
wildcard
Creates wildcard result.- Parameters:
preferred- the preferred setallSets- all sets- Returns:
- wildcard result
-
none
Creates none result.- Returns:
- none result
-
standard
Creates standard result.- Parameters:
preferred- the preferred setallSets- all sets- Returns:
- standard result
-
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 '=='. -
preferred
Returns the value of thepreferredrecord component.- Returns:
- the value of the
preferredrecord component
-
allSets
Returns the value of theallSetsrecord component.- Returns:
- the value of the
allSetsrecord component
-
acceptsAny
public boolean acceptsAny()Returns the value of theacceptsAnyrecord component.- Returns:
- the value of the
acceptsAnyrecord component
-
prefersName
public boolean prefersName()Returns the value of theprefersNamerecord component.- Returns:
- the value of the
prefersNamerecord component
-