Record Class AttributeModifierWrapper
java.lang.Object
java.lang.Record
de.eldoria.jacksonbukkit.entities.AttributeModifierWrapper
public record AttributeModifierWrapper(UUID uuid, String name, double amount, AttributeModifier.Operation operation, EquipmentSlot equipmentSlot)
extends Record
Class for wrapping an
AttributeModifier.-
Constructor Summary
ConstructorsConstructorDescriptionAttributeModifierWrapper(UUID uuid, String name, double amount, AttributeModifier.Operation operation, EquipmentSlot equipmentSlot) Creates an instance of aAttributeModifierWrapperrecord class. -
Method Summary
Modifier and TypeMethodDescriptiondoubleamount()Returns the value of theamountrecord component.final booleanIndicates whether some other object is "equal to" this one.Returns the value of theequipmentSlotrecord component.final inthashCode()Returns a hash code value for this object.name()Returns the value of thenamerecord component.static AttributeModifierWrapperof(AttributeModifier attributeModifier) Create a newAttributeModifierWrapperbased on anAttributeModifier.Returns the value of theoperationrecord component.Constructs a newAttributeModifierbased on wrapper values.final StringtoString()Returns a string representation of this record class.uuid()Returns the value of theuuidrecord component.
-
Constructor Details
-
AttributeModifierWrapper
public AttributeModifierWrapper(UUID uuid, String name, double amount, AttributeModifier.Operation operation, EquipmentSlot equipmentSlot) Creates an instance of aAttributeModifierWrapperrecord class.- Parameters:
uuid- the value for theuuidrecord componentname- the value for thenamerecord componentamount- the value for theamountrecord componentoperation- the value for theoperationrecord componentequipmentSlot- the value for theequipmentSlotrecord component
-
-
Method Details
-
of
Create a newAttributeModifierWrapperbased on anAttributeModifier.- Parameters:
attributeModifier- attribute modifier instance- Returns:
- new
AttributeModifierWrapperinstance
-
toBukkitAttributeModifier
Constructs a newAttributeModifierbased on wrapper values.- Returns:
- new
AttributeModifierinstance
-
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 '=='. -
uuid
Returns the value of theuuidrecord component.- Returns:
- the value of the
uuidrecord component
-
name
Returns the value of thenamerecord component.- Returns:
- the value of the
namerecord 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
-
equipmentSlot
Returns the value of theequipmentSlotrecord component.- Returns:
- the value of the
equipmentSlotrecord component
-