Package net.minecraft.util
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
Modifier and TypeFieldDescriptionstatic final com.mojang.serialization.Codec
<InclusiveRange<Integer>> private final T
The field for themaxInclusive
record component.private final T
The field for theminInclusive
record component. -
Constructor Summary
ConstructorDescriptionInclusiveRange
(T p_300479_) InclusiveRange
(T minInclusive, T maxInclusive) Creates an instance of aInclusiveRange
record class. -
Method Summary
Modifier and TypeMethodDescriptionstatic <T extends Comparable<T>>
com.mojang.serialization.Codec<InclusiveRange<T>> codec
(com.mojang.serialization.Codec<T> p_184573_) static <T extends Comparable<T>>
com.mojang.serialization.Codec<InclusiveRange<T>> codec
(com.mojang.serialization.Codec<T> p_184575_, T p_184576_, T p_184577_) boolean
contains
(InclusiveRange<T> p_184571_) static <T extends Comparable<T>>
com.mojang.serialization.DataResult<InclusiveRange<T>> create
(T p_184581_, T p_184582_) final boolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
Returns a hash code value for this object.boolean
isValueInRange
(T p_184579_) Returns the value of themaxInclusive
record component.Returns the value of theminInclusive
record component.toString()
Returns a string representation of this record class.
-
Field Details
-
minInclusive
The field for theminInclusive
record component. -
maxInclusive
The field for themaxInclusive
record component. -
INT
-
-
Constructor Details
-
InclusiveRange
Creates an instance of aInclusiveRange
record class.- Parameters:
minInclusive
- the value for theminInclusive
record componentmaxInclusive
- the value for themaxInclusive
record component
-
InclusiveRange
-
-
Method Details
-
codec
public static <T extends Comparable<T>> com.mojang.serialization.Codec<InclusiveRange<T>> codec(com.mojang.serialization.Codec<T> p_184573_) -
codec
public static <T extends Comparable<T>> com.mojang.serialization.Codec<InclusiveRange<T>> codec(com.mojang.serialization.Codec<T> p_184575_, T p_184576_, T p_184577_) -
create
public static <T extends Comparable<T>> com.mojang.serialization.DataResult<InclusiveRange<T>> create(T p_184581_, T p_184582_) -
isValueInRange
-
contains
-
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)
. -
minInclusive
Returns the value of theminInclusive
record component.- Returns:
- the value of the
minInclusive
record component
-
maxInclusive
Returns the value of themaxInclusive
record component.- Returns:
- the value of the
maxInclusive
record component
-