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 sets
acceptsAny - 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 Details

    • PronounResult

      public PronounResult(PronounSet preferred, List<PronounSet> allSets, boolean acceptsAny, boolean prefersName)
      Validates and copies parameters.
      Parameters:
      preferred - the preferred set
      allSets - all sets
      acceptsAny - accepts any
      prefersName - prefers name
  • Method Details

    • fromRecords

      public static PronounResult fromRecords(List<PronounRecord> records)
      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

      public static PronounResult wildcard(PronounSet preferred, List<PronounSet> allSets)
      Creates wildcard result.
      Parameters:
      preferred - the preferred set
      allSets - all sets
      Returns:
      wildcard result
    • none

      public static PronounResult none()
      Creates none result.
      Returns:
      none result
    • standard

      public static PronounResult standard(PronounSet preferred, List<PronounSet> allSets)
      Creates standard result.
      Parameters:
      preferred - the preferred set
      allSets - all sets
      Returns:
      standard result
    • 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. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with '=='.
      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.
    • preferred

      public PronounSet preferred()
      Returns the value of the preferred record component.
      Returns:
      the value of the preferred record component
    • allSets

      public List<PronounSet> allSets()
      Returns the value of the allSets record component.
      Returns:
      the value of the allSets record component
    • acceptsAny

      public boolean acceptsAny()
      Returns the value of the acceptsAny record component.
      Returns:
      the value of the acceptsAny record component
    • prefersName

      public boolean prefersName()
      Returns the value of the prefersName record component.
      Returns:
      the value of the prefersName record component