Package forgottentowns.mod.api
Record Class ColonyContext.Mood
java.lang.Object
java.lang.Record
forgottentowns.mod.api.ColonyContext.Mood
- Record Components:
labelKey- owning-mod translation keyamount- 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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondoubleamount()Returns the value of theamountrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.labelKey()Returns the value of thelabelKeyrecord component.Returns the value of thestackingKeyrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
Mood
Validates a happiness source.- Parameters:
labelKey- translation keyamount- signed happiness ratestackingKey- stacking identity- Throws:
IllegalArgumentException- if the amount is invalid or the label is blankNullPointerException- if labelKey or stackingKey is null
-
-
Method Details
-
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 '=='. -
labelKey
Returns the value of thelabelKeyrecord component.- Returns:
- the value of the
labelKeyrecord component
-
amount
public double amount()Returns the value of theamountrecord component.- Returns:
- the value of the
amountrecord component
-
stackingKey
Returns the value of thestackingKeyrecord component.- Returns:
- the value of the
stackingKeyrecord component
-