A
- The type that this decoder deserializes.public static interface Decoder.Terminal<A>
This interface allows one to implement a Decoder
based on Decoder.parse(DynamicOps, Object)
.
Modifier and Type | Method and Description |
---|---|
<T> DataResult<A> |
decode(DynamicOps<T> ops,
T input)
Completely decodes the given serialized input and returns the decoded object in a
DataResult . |
default Decoder<A> |
decoder()
Returns a
Decoder that performs the same actions as this terminal decoder. |
<T> DataResult<A> decode(DynamicOps<T> ops, T input)
DataResult
.T
- The type of the serialized form.ops
- The DynamicOps
instance defining the serialized form.input
- The serialized data.DataResult
containing the decoded object.Decoder.parse(DynamicOps, Object)
default Decoder<A> decoder()
Decoder
that performs the same actions as this terminal decoder.Decoder
that returns the result of
decode(DynamicOps, Object)
with an empty remainder.Decoder
is implemented via Decoder.decode(DynamicOps, Object)
,
not via Decoder.parse(DynamicOps, Object)
.