Record Class MinMaxBounds.Bounds<T extends Number & Comparable<T>>
java.lang.Object
java.lang.Record
net.minecraft.advancements.criterion.MinMaxBounds.Bounds<T>
- Enclosing interface:
MinMaxBounds<T extends Number & Comparable<T>>
public static record MinMaxBounds.Bounds<T extends Number & Comparable<T>>(Optional<T extends Number & Comparable<T>> min, Optional<T extends Number & Comparable<T>> max)
extends Record
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic <T extends Number & Comparable<T>>
MinMaxBounds.Bounds<T> any()booleanasPoint()static <T extends Number & Comparable<T>>
MinMaxBounds.Bounds<T> atLeast(T pMin) static <T extends Number & Comparable<T>>
MinMaxBounds.Bounds<T> atMost(T pMax) static <T extends Number & Comparable<T>>
MinMaxBounds.Bounds<T> between(T pMin, T pMax) (package private) static <T extends Number & Comparable<T>>
com.mojang.serialization.Codec<MinMaxBounds.Bounds<T>> createCodec(com.mojang.serialization.Codec<T> pValueCodec) (package private) static <B extends io.netty.buffer.ByteBuf,T extends Number & Comparable<T>>
StreamCodec<B, MinMaxBounds.Bounds<T>> createStreamCodec(StreamCodec<B, T> pValueCodec) final booleanIndicates whether some other object is "equal to" this one.static <T extends Number & Comparable<T>>
MinMaxBounds.Bounds<T> exactly(T pValue) static <T extends Number & Comparable<T>>
MinMaxBounds.Bounds<T> fromReader(com.mojang.brigadier.StringReader pReader, Function<String, T> pParser, Supplier<com.mojang.brigadier.exceptions.DynamicCommandExceptionType> pExceptionSupplier) final inthashCode()Returns a hash code value for this object.private static booleanisAllowedInputChar(com.mojang.brigadier.StringReader pReader) booleanisAny()<U extends Number & Comparable<U>>
MinMaxBounds.Bounds<U> max()Returns the value of themaxrecord component.min()Returns the value of theminrecord component.readNumber(com.mojang.brigadier.StringReader pReader, Function<String, T> pParser, Supplier<com.mojang.brigadier.exceptions.DynamicCommandExceptionType> pExceptionSupplier) final StringtoString()Returns a string representation of this record class.com.mojang.serialization.DataResult<MinMaxBounds.Bounds<T>>
-
Field Details
-
min
The field for theminrecord component. -
max
The field for themaxrecord component.
-
-
Constructor Details
-
Bounds
Creates an instance of aBoundsrecord class.- Parameters:
min- the value for theminrecord componentmax- the value for themaxrecord component
-
-
Method Details
-
isAny
public boolean isAny() -
validateSwappedBoundsInCodec
-
areSwapped
public boolean areSwapped() -
asPoint
-
any
-
exactly
-
between
-
atLeast
-
atMost
-
map
-
createCodec
static <T extends Number & Comparable<T>> com.mojang.serialization.Codec<MinMaxBounds.Bounds<T>> createCodec(com.mojang.serialization.Codec<T> pValueCodec) -
createStreamCodec
static <B extends io.netty.buffer.ByteBuf,T extends Number & Comparable<T>> StreamCodec<B,MinMaxBounds.Bounds<T>> createStreamCodec(StreamCodec<B, T> pValueCodec) -
fromReader
public static <T extends Number & Comparable<T>> MinMaxBounds.Bounds<T> fromReader(com.mojang.brigadier.StringReader pReader, Function<String, T> pParser, Supplier<com.mojang.brigadier.exceptions.DynamicCommandExceptionType> pExceptionSupplier) throws com.mojang.brigadier.exceptions.CommandSyntaxException- Throws:
com.mojang.brigadier.exceptions.CommandSyntaxException
-
readNumber
private static <T extends Number> Optional<T> readNumber(com.mojang.brigadier.StringReader pReader, Function<String, T> pParser, Supplier<com.mojang.brigadier.exceptions.DynamicCommandExceptionType> pExceptionSupplier) throws com.mojang.brigadier.exceptions.CommandSyntaxException- Throws:
com.mojang.brigadier.exceptions.CommandSyntaxException
-
isAllowedInputChar
private static boolean isAllowedInputChar(com.mojang.brigadier.StringReader pReader) -
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
-