Record Class LevelBasedValue.Clamped
java.lang.Object
java.lang.Record
net.minestom.server.item.enchant.LevelBasedValue.Clamped
- All Implemented Interfaces:
LevelBasedValue
- Enclosing interface:
LevelBasedValue
public static record LevelBasedValue.Clamped(LevelBasedValue value, float min, float max)
extends Record
implements LevelBasedValue
-
Nested Class Summary
Nested classes/interfaces inherited from interface LevelBasedValue
LevelBasedValue.Clamped, LevelBasedValue.Constant, LevelBasedValue.Fraction, LevelBasedValue.LevelsSquared, LevelBasedValue.Linear, LevelBasedValue.Lookup -
Field Summary
FieldsFields inherited from interface LevelBasedValue
TAGGED_CODEC -
Constructor Summary
ConstructorsConstructorDescriptionClamped(LevelBasedValue value, float min, float max) Creates an instance of aClampedrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfloatcalc(int level) codec()final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.floatmax()Returns the value of themaxrecord component.floatmin()Returns the value of theminrecord component.final StringtoString()Returns a string representation of this record class.value()Returns the value of thevaluerecord component.
-
Field Details
-
CODEC
-
-
Constructor Details
-
Clamped
Creates an instance of aClampedrecord class.- Parameters:
value- the value for thevaluerecord componentmin- the value for theminrecord componentmax- the value for themaxrecord component
-
-
Method Details
-
calc
public float calc(int level) - Specified by:
calcin interfaceLevelBasedValue
-
codec
- Specified by:
codecin interfaceLevelBasedValue
-
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. -
value
Returns the value of thevaluerecord component.- Returns:
- the value of the
valuerecord component
-
min
public float min()Returns the value of theminrecord component.- Returns:
- the value of the
minrecord component
-
max
public float max()Returns the value of themaxrecord component.- Returns:
- the value of the
maxrecord component
-