Record Class OptionInstance.LazyEnum<T>
java.lang.Object
java.lang.Record
net.minecraft.client.OptionInstance.LazyEnum<T>
- All Implemented Interfaces:
OptionInstance.CycleableValueSet<T>, OptionInstance.ValueSet<T>
- Enclosing class:
OptionInstance<T>
-
Nested Class Summary
Nested classes/interfaces inherited from interface OptionInstance.CycleableValueSet
OptionInstance.CycleableValueSet.ValueSetter<T> -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final com.mojang.serialization.Codec<T> The field for thecodecrecord component.The field for thevalidateValuerecord component.The field for thevaluesrecord component. -
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.Returns the value of thevalidateValuerecord component.validateValue(T value) values()Returns the value of thevaluesrecord component.Methods inherited from interface OptionInstance.CycleableValueSet
createButton, valueSetter
-
Field Details
-
values
-
validateValue
-
codec
The field for thecodecrecord component.
-
-
Constructor Details
-
LazyEnum
public LazyEnum(Supplier<List<T>> values, Function<T, Optional<T>> validateValue, com.mojang.serialization.Codec<T> codec) Creates an instance of aLazyEnumrecord class.- Parameters:
values- the value for thevaluesrecord componentvalidateValue- the value for thevalidateValuerecord componentcodec- the value for thecodecrecord component
-
-
Method Details
-
validateValue
- Specified by:
validateValuein interfaceOptionInstance.ValueSet<T>
-
valueListSupplier
- Specified by:
valueListSupplierin interfaceOptionInstance.CycleableValueSet<T>
-
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). -
values
-
validateValue
-
codec
Returns the value of thecodecrecord component.- Specified by:
codecin interfaceOptionInstance.ValueSet<T>- Returns:
- the value of the
codecrecord component
-