Record Class PronounSet

java.lang.Object
java.lang.Record
me.folf.podns4j.model.PronounSet
Record Components:
subject - the subject pronoun (e.g., "she", "he", "they")
object - the object pronoun (e.g., "her", "him", "them")
possessiveDeterminer - the possessive determiner (e.g., "her", "his", "their"), may be null
possessivePronoun - the possessive pronoun (e.g., "hers", "his", "theirs"), may be null
reflexive - the reflexive pronoun (e.g., "herself", "himself", "themself"), may be null
tags - the tags applied to this pronoun set (immutable)

public record PronounSet(String subject, String object, String possessiveDeterminer, String possessivePronoun, String reflexive, Set<Tag> tags) extends Record
Represents a set of personal pronouns with optional tags.
  • Constructor Details

    • PronounSet

      public PronounSet(String subject, String object, String possessiveDeterminer, String possessivePronoun, String reflexive, Set<Tag> tags)
      Validates and copies parameters.
      Parameters:
      subject - the subject
      object - the object
      possessiveDeterminer - the possessive determiner
      possessivePronoun - the possessive pronoun
      reflexive - the reflexive
      tags - the tags
    • PronounSet

      public PronounSet(String subject, String object, Set<Tag> tags)
      Creates pronoun set with subject and object.
      Parameters:
      subject - the subject
      object - the object
      tags - the tags
    • PronounSet

      public PronounSet(String subject, String object, String possessiveDeterminer, Set<Tag> tags)
      Creates pronoun set with possessive determiner.
      Parameters:
      subject - the subject
      object - the object
      possessiveDeterminer - the possessive determiner
      tags - the tags
    • PronounSet

      public PronounSet(String subject, String object, String possessiveDeterminer, String possessivePronoun, Set<Tag> tags)
      Creates pronoun set with possessive pronoun.
      Parameters:
      subject - the subject
      object - the object
      possessiveDeterminer - the possessive determiner
      possessivePronoun - the possessive pronoun
      tags - the tags
  • Method Details

    • hasTag

      public boolean hasTag(Tag tag)
      Returns true if has tag.
      Parameters:
      tag - the tag to check
      Returns:
      true if has tag
    • isPlural

      public boolean isPlural()
      Returns true if plural verb agreement.
      Returns:
      true if plural
    • isPreferred

      public boolean isPreferred()
      Returns true if preferred.
      Returns:
      true if preferred
    • toCanonicalString

      public String toCanonicalString()
      Returns canonical string representation.
      Returns:
      canonical string
    • 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.
    • subject

      public String subject()
      Returns the value of the subject record component.
      Returns:
      the value of the subject record component
    • object

      public String object()
      Returns the value of the object record component.
      Returns:
      the value of the object record component
    • possessiveDeterminer

      public String possessiveDeterminer()
      Returns the value of the possessiveDeterminer record component.
      Returns:
      the value of the possessiveDeterminer record component
    • possessivePronoun

      public String possessivePronoun()
      Returns the value of the possessivePronoun record component.
      Returns:
      the value of the possessivePronoun record component
    • reflexive

      public String reflexive()
      Returns the value of the reflexive record component.
      Returns:
      the value of the reflexive record component
    • tags

      public Set<Tag> tags()
      Returns the value of the tags record component.
      Returns:
      the value of the tags record component