Package net.minecraft.client
Record Class OptionInstance.Enum<T>
java.lang.Object
java.lang.Record
net.minecraft.client.OptionInstance.Enum<T>
- All Implemented Interfaces:
OptionInstance.CycleableValueSet<T>,OptionInstance.ValueSet<T>
- Enclosing class:
OptionInstance<T>
public static record OptionInstance.Enum<T>(List<T> values, 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
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncom.mojang.serialization.Codec<T> codec()Returns the value of thecodecrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.final StringtoString()Returns a string representation of this record class.validateValue(T p_231632_) values()Returns the value of thevaluesrecord component.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface net.minecraft.client.OptionInstance.CycleableValueSet
createButton, valueSetter
-
Field Details
-
values
The field for thevaluesrecord component. -
codec
The field for thecodecrecord component.
-
-
Constructor Details
-
Enum
Creates an instance of aEnumrecord class.- Parameters:
values- the value for thevaluesrecord componentcodec- the value for thecodecrecord component
-
-
Method Details
-
validateValue
- Specified by:
validateValuein interfaceOptionInstance.ValueSet<T>
-
valueListSupplier
- Specified by:
valueListSupplierin interfaceOptionInstance.CycleableValueSet<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 thevaluesrecord component.- Returns:
- the value of the
valuesrecord component
-
codec
Returns the value of thecodecrecord component.- Specified by:
codecin interfaceOptionInstance.ValueSet<T>- Returns:
- the value of the
codecrecord component
-