Record Class Modifier
java.lang.Object
java.lang.Record
fr.robie.machineengine.api.upgrade.Modifier
- Record Components:
value- forModifier.Operation.ADDan amount in the value's own unit; for the multiplying operations a fraction in permille:250is +25 %,-500is −50 %
public record Modifier(@NotNull ModifierType type, @NotNull Modifier.Operation operation, long value)
extends Record
One change to a
ModifierType's value.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumApplied in this order, like Minecraft attribute modifiers (D16). -
Constructor Summary
ConstructorsConstructorDescriptionModifier(@NotNull ModifierType type, @NotNull Modifier.Operation operation, long value) Creates an instance of aModifierrecord class. -
Method Summary
Modifier and TypeMethodDescriptionstatic @NotNull Modifieradd(@NotNull ModifierType type, long amount) static @NotNull ModifieraddMultipliedBase(@NotNull ModifierType type, long permille) final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.static @NotNull ModifiermultiplyTotal(@NotNull ModifierType type, long permille) @NotNull Modifier.OperationReturns the value of theoperationrecord component.final StringtoString()Returns a string representation of this record class.@NotNull ModifierTypetype()Returns the value of thetyperecord component.longvalue()Returns the value of thevaluerecord component.
-
Constructor Details
-
Modifier
public Modifier(@NotNull @NotNull ModifierType type, @NotNull @NotNull Modifier.Operation operation, long value) Creates an instance of aModifierrecord class.- Parameters:
type- the value for thetyperecord componentoperation- the value for theoperationrecord componentvalue- the value for thevaluerecord component
-
-
Method Details
-
add
-
addMultipliedBase
@NotNull public static @NotNull Modifier addMultipliedBase(@NotNull @NotNull ModifierType type, long permille) -
multiplyTotal
@NotNull public static @NotNull Modifier multiplyTotal(@NotNull @NotNull ModifierType type, long permille) -
toString
-
hashCode
-
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 thecomparemethod from their corresponding wrapper classes. -
type
Returns the value of thetyperecord component.- Returns:
- the value of the
typerecord component
-
operation
Returns the value of theoperationrecord component.- Returns:
- the value of the
operationrecord component
-
value
-