java.lang.Object
java.lang.Record
at.syntaxerror.syntaxnbt.internal.SNBTParser.Range
- Enclosing class:
- SNBTParser
protected static record SNBTParser.Range(BigInteger min, BigInteger max, Function<BigInteger,Tag<?>> converter)
extends Record
Range for an integer type
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedRange(BigInteger min, BigInteger max, Function<BigInteger, Tag<?>> converter) Creates an instance of aRangerecord class. -
Method Summary
Modifier and TypeMethodDescriptionprotected Tag<?>convert(BigInteger number) Converts a number into an NBT TagFunction<BigInteger,Tag<?>> Returns the value of theconverterrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.protected booleaninRange(BigInteger number) Checks if a number lies within this rangemax()Returns the value of themaxrecord component.min()Returns the value of theminrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
Range
Creates an instance of aRangerecord class.- Parameters:
min- the value for theminrecord componentmax- the value for themaxrecord componentconverter- the value for theconverterrecord component
-
-
Method Details
-
inRange
Checks if a number lies within this range- Parameters:
number- a number- Returns:
- whether a number lies within this range
-
convert
Converts a number into an NBT Tag- Parameters:
number- a number- Returns:
- the new NBT tag
-
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. All components in this record class are compared withObjects::equals(Object,Object). -
min
Returns the value of theminrecord component.- Returns:
- the value of the
minrecord component
-
max
Returns the value of themaxrecord component.- Returns:
- the value of the
maxrecord component
-
converter
Returns the value of theconverterrecord component.- Returns:
- the value of the
converterrecord component
-