Record Class InclusiveRange<T extends Comparable<T>>
java.lang.Object
java.lang.Record
net.minecraft.util.InclusiveRange<T>
public record InclusiveRange<T extends Comparable<T>>(T extends Comparable<T> minInclusive, T extends Comparable<T> maxInclusive)
extends Record
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.Codec<InclusiveRange<Integer>> private final TThe field for themaxInclusiverecord component.private final TThe field for theminInclusiverecord component. -
Constructor Summary
ConstructorsConstructorDescriptionInclusiveRange(T value) InclusiveRange(T minInclusive, T maxInclusive) Creates an instance of aInclusiveRangerecord class. -
Method Summary
Modifier and TypeMethodDescriptionstatic <T extends Comparable<T>>
com.mojang.serialization.Codec<InclusiveRange<T>> codec(com.mojang.serialization.Codec<T> elementCodec) static <T extends Comparable<T>>
com.mojang.serialization.Codec<InclusiveRange<T>> codec(com.mojang.serialization.Codec<T> elementCodec, T minAllowedInclusive, T maxAllowedInclusive) booleancontains(InclusiveRange<T> subRange) static <T extends Comparable<T>>
com.mojang.serialization.DataResult<InclusiveRange<T>> create(T minInclusive, T maxInclusive) final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.booleanisValueInRange(T value) <S extends Comparable<S>>
InclusiveRange<S> Returns the value of themaxInclusiverecord component.Returns the value of theminInclusiverecord component.toString()Returns a string representation of this record class.
-
Field Details
-
minInclusive
The field for theminInclusiverecord component. -
maxInclusive
The field for themaxInclusiverecord component. -
INT
-
-
Constructor Details
-
InclusiveRange
-
InclusiveRange
-
-
Method Details
-
codec
public static <T extends Comparable<T>> com.mojang.serialization.Codec<InclusiveRange<T>> codec(com.mojang.serialization.Codec<T> elementCodec) -
codec
public static <T extends Comparable<T>> com.mojang.serialization.Codec<InclusiveRange<T>> codec(com.mojang.serialization.Codec<T> elementCodec, T minAllowedInclusive, T maxAllowedInclusive) -
create
public static <T extends Comparable<T>> com.mojang.serialization.DataResult<InclusiveRange<T>> create(T minInclusive, T maxInclusive) -
map
-
isValueInRange
-
contains
-
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. All components in this record class are compared withObjects::equals(Object,Object). -
minInclusive
Returns the value of theminInclusiverecord component.- Returns:
- the value of the
minInclusiverecord component
-
maxInclusive
Returns the value of themaxInclusiverecord component.- Returns:
- the value of the
maxInclusiverecord component
-