Record Class UpgradeEnumModifier<T extends Enum<T>>
java.lang.Object
java.lang.Record
de.Keyle.MyPet.api.skill.modifier.UpgradeEnumModifier<T>
- Type Parameters:
T- the enum type of the skill parameter- Record Components:
value- the enum constant to set when this modifier is applied
- All Implemented Interfaces:
UpgradeModifier<T>
public record UpgradeEnumModifier<T extends Enum<T>>(T extends Enum<T> value)
extends Record
implements UpgradeModifier<T>
An
UpgradeModifier for enum-typed skill parameters.
Like UpgradeBooleanModifier, this is a replacement modifier: it unconditionally
sets the parameter to the enum constant carried by this record, ignoring the previous value.
Useful for skills that switch behavior modes at specific upgrade levels (e.g., selecting an
attack type or targeting strategy).
-
Constructor Summary
ConstructorsConstructorDescriptionUpgradeEnumModifier(T value) Creates an instance of aUpgradeEnumModifierrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.Applies this modifier to the given current value, producing an updated result.final StringtoString()Returns a string representation of this record class.value()Returns the value of thevaluerecord component.
-
Constructor Details
-
UpgradeEnumModifier
Creates an instance of aUpgradeEnumModifierrecord class.- Parameters:
value- the value for thevaluerecord component
-
-
Method Details
-
modify
Applies this modifier to the given current value, producing an updated result. Unconditionally returns this modifier's enum constant, ignoring the input.- Specified by:
modifyin interfaceUpgradeModifier<T extends Enum<T>>- Parameters:
value- the current parameter value before modification- Returns:
- the modified parameter value
-
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. All components in this record class are compared withObjects::equals(Object,Object). -
value
Returns the value of thevaluerecord component.
-