Record Class ConditionCodec.OptionalConditionalDecoder<A>
java.lang.Object
java.lang.Record
net.minecraftforge.common.crafting.conditions.ConditionCodec.OptionalConditionalDecoder<A>
- All Implemented Interfaces:
com.mojang.serialization.Decoder<Optional<A>>
- Enclosing class:
- ConditionCodec
-
Nested Class Summary
-
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateOptionalConditionalDecoder(com.mojang.serialization.Decoder<A> normal, String key) Creates an instance of aOptionalConditionalDecoderrecord class. -
Method Summary
Modifier and TypeMethodDescriptiondecode(com.mojang.serialization.DynamicOps<T> ops, T input) final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.key()Returns the value of thekeyrecord component.com.mojang.serialization.Decoder<A>normal()Returns the value of thenormalrecord component.final StringtoString()Returns a string representation of this record class.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface com.mojang.serialization.Decoder
boxed, decode, fieldOf, flatMap, map, parse, parse, promotePartial, simple, terminal, withLifecycle
-
Field Details
-
normal
The field for thenormalrecord component. -
key
The field for thekeyrecord component.
-
-
Constructor Details
-
OptionalConditionalDecoder
Creates an instance of aOptionalConditionalDecoderrecord class.- Parameters:
normal- the value for thenormalrecord componentkey- the value for thekeyrecord component
-
-
Method Details
-
decode
public <T> com.mojang.serialization.DataResult<com.mojang.datafixers.util.Pair<Optional<A>,T>> decode(com.mojang.serialization.DynamicOps<T> ops, T input) - Specified by:
decodein interfacecom.mojang.serialization.Decoder<A>
-
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). -
normal
Returns the value of thenormalrecord component.- Returns:
- the value of the
normalrecord component
-
key
Returns the value of thekeyrecord component.- Returns:
- the value of the
keyrecord component
-