Package net.minecraft.client
Record Class OptionInstance.AltEnum<T>
java.lang.Object
java.lang.Record
net.minecraft.client.OptionInstance.AltEnum<T>
- All Implemented Interfaces:
OptionInstance.CycleableValueSet<T>
,OptionInstance.ValueSet<T>
- Enclosing class:
OptionInstance<T>
public static record OptionInstance.AltEnum<T>(List<T> values, List<T> altValues, BooleanSupplier altCondition, OptionInstance.CycleableValueSet.ValueSetter<T> valueSetter, com.mojang.serialization.Codec<T> codec)
extends Record
implements OptionInstance.CycleableValueSet<T>
-
Nested Class Summary
Nested classes/interfaces inherited from interface net.minecraft.client.OptionInstance.CycleableValueSet
OptionInstance.CycleableValueSet.ValueSetter<T>
-
Field Summary
Modifier and TypeFieldDescriptionprivate final BooleanSupplier
The field for thealtCondition
record component.The field for thealtValues
record component.private final com.mojang.serialization.Codec<T>
The field for thecodec
record component.The field for thevalues
record component.private final OptionInstance.CycleableValueSet.ValueSetter<T>
The field for thevalueSetter
record component. -
Constructor Summary
ConstructorDescriptionAltEnum
(List<T> values, List<T> altValues, BooleanSupplier altCondition, OptionInstance.CycleableValueSet.ValueSetter<T> valueSetter, com.mojang.serialization.Codec<T> codec) Creates an instance of aAltEnum
record class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of thealtCondition
record component.Returns the value of thealtValues
record component.com.mojang.serialization.Codec<T>
codec()
Returns the value of thecodec
record component.final boolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
Returns a hash code value for this object.final String
toString()
Returns a string representation of this record class.validateValue
(T p_231570_) values()
Returns the value of thevalues
record component.Returns the value of thevalueSetter
record component.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface net.minecraft.client.OptionInstance.CycleableValueSet
createButton
-
Field Details
-
values
The field for thevalues
record component. -
altValues
The field for thealtValues
record component. -
altCondition
The field for thealtCondition
record component. -
valueSetter
The field for thevalueSetter
record component. -
codec
The field for thecodec
record component.
-
-
Constructor Details
-
AltEnum
public AltEnum(List<T> values, List<T> altValues, BooleanSupplier altCondition, OptionInstance.CycleableValueSet.ValueSetter<T> valueSetter, com.mojang.serialization.Codec<T> codec) Creates an instance of aAltEnum
record class.- Parameters:
values
- the value for thevalues
record componentaltValues
- the value for thealtValues
record componentaltCondition
- the value for thealtCondition
record componentvalueSetter
- the value for thevalueSetter
record componentcodec
- the value for thecodec
record component
-
-
Method Details
-
valueListSupplier
- Specified by:
valueListSupplier
in interfaceOptionInstance.CycleableValueSet<T>
-
validateValue
- Specified by:
validateValue
in interfaceOptionInstance.ValueSet<T>
-
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)
. -
values
Returns the value of thevalues
record component.- Returns:
- the value of the
values
record component
-
altValues
Returns the value of thealtValues
record component.- Returns:
- the value of the
altValues
record component
-
altCondition
Returns the value of thealtCondition
record component.- Returns:
- the value of the
altCondition
record component
-
valueSetter
Returns the value of thevalueSetter
record component.- Specified by:
valueSetter
in interfaceOptionInstance.CycleableValueSet<T>
- Returns:
- the value of the
valueSetter
record component
-
codec
Returns the value of thecodec
record component.- Specified by:
codec
in interfaceOptionInstance.ValueSet<T>
- Returns:
- the value of the
codec
record component
-