A - The type this operator transforms.public static interface MapCodec.ResultFunction<A>
MapCodec. This can be
used to directly transform the DataResult returned from the decoding and encoding methods.| Modifier and Type | Method and Description |
|---|---|
<T> DataResult<A> |
apply(DynamicOps<T> ops,
MapLike<T> input,
DataResult<A> a)
Applies a transformation to the result of decoding an object.
|
<T> RecordBuilder<T> |
coApply(DynamicOps<T> ops,
A input,
RecordBuilder<T> t)
Applies a transformation to the result of encoding an object.
|
<T> DataResult<A> apply(DynamicOps<T> ops, MapLike<T> input, DataResult<A> a)
T - The type of the serialized form.ops - The DynamicOps instance defining the serialized form.input - The input map passed to MapDecoder.decode(DynamicOps, MapLike).a - The result returned from MapDecoder.decode(DynamicOps, MapLike).<T> RecordBuilder<T> coApply(DynamicOps<T> ops, A input, RecordBuilder<T> t)
T - The type of the serialized form.ops - The DynamicOps instance defining the serialized form.input - The input object passed to MapEncoder.encode(Object, DynamicOps, RecordBuilder).t - The result returned from MapEncoder.encode(Object, DynamicOps, RecordBuilder).