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
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 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> 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_) booleancontains(InclusiveRange<T> p_184571_) static <T extends Comparable<T>>
com.mojang.serialization.DataResult<InclusiveRange<T>>create(T p_184581_, T p_184582_) final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.booleanisValueInRange(T p_184579_) 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
Creates an instance of aInclusiveRangerecord class.- Parameters:
minInclusive- the value for theminInclusiverecord componentmaxInclusive- the value for themaxInclusiverecord component
-
-
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 theminInclusiverecord component.- Returns:
- the value of the
minInclusiverecord component
-
maxInclusive
Returns the value of themaxInclusiverecord component.- Returns:
- the value of the
maxInclusiverecord component
-