Record Class ConditionCodec.UnwrapDecoder<A>
java.lang.Object
java.lang.Record
net.minecraftforge.common.crafting.conditions.ConditionCodec.UnwrapDecoder<A>
- All Implemented Interfaces:
com.mojang.serialization.Decoder<A>
- Enclosing class:
ConditionCodec
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.mojang.serialization.Decoder
com.mojang.serialization.Decoder.Boxed<A>, com.mojang.serialization.Decoder.Simple<A>, com.mojang.serialization.Decoder.Terminal<A>
-
Field Summary
-
Constructor Summary
ModifierConstructorDescriptionprivate
UnwrapDecoder
(com.mojang.serialization.Decoder<Optional<A>> normal, Supplier<A> _default) Creates an instance of aUnwrapDecoder
record class. -
Method Summary
Modifier and TypeMethodDescription_default()
Returns the value of the_default
record component.<T> com.mojang.serialization.DataResult
<com.mojang.datafixers.util.Pair<A, T>> decode
(com.mojang.serialization.DynamicOps<T> ops, T input) final boolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
Returns a hash code value for this object.normal()
Returns the value of thenormal
record component.final String
toString()
Returns a string representation of this record class.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface com.mojang.serialization.Decoder
boxed, decode, fieldOf, flatMap, map, parse, parse, promotePartial, simple, terminal, withLifecycle
-
Field Details
-
normal
The field for thenormal
record component. -
_default
The field for the_default
record component.
-
-
Constructor Details
-
UnwrapDecoder
Creates an instance of aUnwrapDecoder
record class.- Parameters:
normal
- the value for thenormal
record component_default
- the value for the_default
record component
-
-
Method Details
-
decode
public <T> com.mojang.serialization.DataResult<com.mojang.datafixers.util.Pair<A,T>> decode(com.mojang.serialization.DynamicOps<T> ops, T input) - Specified by:
decode
in 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 thenormal
record component.- Returns:
- the value of the
normal
record component
-
_default
Returns the value of the_default
record component.- Returns:
- the value of the
_default
record component
-