Record Class ColonyContext.Mood

java.lang.Object
java.lang.Record
forgottentowns.mod.api.ColonyContext.Mood
Record Components:
labelKey - owning-mod translation key
amount - signed rate per in-game minute, bounded to [-100,100]
stackingKey - shared non-stacking identity, or empty for an independently additive source
Enclosing interface:
ColonyContext

public static record ColonyContext.Mood(String labelKey, double amount, String stackingKey) extends Record
One named recurring happiness modifier.
  • Constructor Details

    • Mood

      public Mood(String labelKey, double amount, String stackingKey)
      Validates a happiness source.
      Parameters:
      labelKey - translation key
      amount - signed happiness rate
      stackingKey - stacking identity
      Throws:
      IllegalArgumentException - if the amount is invalid or the label is blank
      NullPointerException - if labelKey or stackingKey is null
  • Method Details

    • toString

      public final 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.
    • labelKey

      public String labelKey()
      Returns the value of the labelKey record component.
      Returns:
      the value of the labelKey record component
    • amount

      public double amount()
      Returns the value of the amount record component.
      Returns:
      the value of the amount record component
    • stackingKey

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