Record Class AttributeModifier
java.lang.Object
java.lang.Record
fr.fidorial.attribute.AttributeModifier
public record AttributeModifier(Key attribute, Key id, double amount, AttributeModifier.Operation operation, EquipmentSlotGroup slot)
extends Record
-
Nested Class Summary
Nested Classes -
Constructor Summary
ConstructorsConstructorDescriptionAttributeModifier(Key attribute, Key id, double amount, AttributeModifier.Operation operation, EquipmentSlotGroup slot) Creates an instance of aAttributeModifierrecord class. -
Method Summary
Modifier and TypeMethodDescriptiondoubleamount()Returns the value of theamountrecord component.Returns the value of theattributerecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.id()Returns the value of theidrecord component.static AttributeModifierof(Key attribute, Key id, double amount, AttributeModifier.Operation operation) static AttributeModifierof(Key attribute, Key id, double amount, AttributeModifier.Operation operation, EquipmentSlotGroup slot) Returns the value of theoperationrecord component.slot()Returns the value of theslotrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
AttributeModifier
public AttributeModifier(Key attribute, Key id, double amount, AttributeModifier.Operation operation, EquipmentSlotGroup slot) Creates an instance of aAttributeModifierrecord class.- Parameters:
attribute- the value for theattributerecord componentid- the value for theidrecord componentamount- the value for theamountrecord componentoperation- the value for theoperationrecord componentslot- the value for theslotrecord component
-
-
Method Details
-
of
public static AttributeModifier of(Key attribute, Key id, double amount, AttributeModifier.Operation operation, EquipmentSlotGroup slot) -
of
public static AttributeModifier of(Key attribute, Key id, double amount, AttributeModifier.Operation operation) -
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. -
attribute
Returns the value of theattributerecord component.- Returns:
- the value of the
attributerecord component
-
id
Returns the value of theidrecord component.- Returns:
- the value of the
idrecord component
-
amount
public double amount()Returns the value of theamountrecord component.- Returns:
- the value of the
amountrecord component
-
operation
Returns the value of theoperationrecord component.- Returns:
- the value of the
operationrecord component
-
slot
Returns the value of theslotrecord component.- Returns:
- the value of the
slotrecord component
-