Package eu.sculkpowered.server.attribute
Record Class AttributeModifier
java.lang.Object
java.lang.Record
eu.sculkpowered.server.attribute.AttributeModifier
public record AttributeModifier(@NotNull UUID uniqueId, @NotNull String name, double amount, @NotNull AttributeOperation operation)
extends Record
-
Constructor Summary
ConstructorDescriptionAttributeModifier
(@NotNull UUID uniqueId, @NotNull String name, double amount, @NotNull AttributeOperation operation) Creates an instance of aAttributeModifier
record class. -
Method Summary
Modifier and TypeMethodDescriptiondouble
amount()
Returns the value of theamount
record component.final boolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
Returns a hash code value for this object.@NotNull String
name()
Returns the value of thename
record component.@NotNull AttributeOperation
Returns the value of theoperation
record component.final String
toString()
Returns a string representation of this record class.@NotNull UUID
uniqueId()
Returns the value of theuniqueId
record component.
-
Constructor Details
-
AttributeModifier
public AttributeModifier(@NotNull @NotNull UUID uniqueId, @NotNull @NotNull String name, double amount, @NotNull @NotNull AttributeOperation operation) Creates an instance of aAttributeModifier
record class.- Parameters:
uniqueId
- the value for theuniqueId
record componentname
- the value for thename
record componentamount
- the value for theamount
record componentoperation
- the value for theoperation
record component
-
-
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 '=='. -
uniqueId
Returns the value of theuniqueId
record component.- Returns:
- the value of the
uniqueId
record component
-
name
Returns the value of thename
record component.- Returns:
- the value of the
name
record component
-
amount
public double amount()Returns the value of theamount
record component.- Returns:
- the value of the
amount
record component
-
operation
Returns the value of theoperation
record component.- Returns:
- the value of the
operation
record component
-