public final class PairMapCodec<F,S> extends MapCodec<(F,S)>
MapCodec.MapCodecCodec<A>, MapCodec.ResultFunction<A>
MapDecoder.Implementation<A>
MapEncoder.Implementation<A>
Constructor and Description |
---|
PairMapCodec(MapCodec<F> first,
MapCodec<S> second) |
Modifier and Type | Method and Description |
---|---|
<T> DataResult<(F,S)> |
decode(DynamicOps<T> ops,
MapLike<T> input)
Decodes an object from the given map of serialized entries.
|
<T> RecordBuilder<T> |
encode((F,S) input,
DynamicOps<T> ops,
RecordBuilder<T> prefix)
Encodes the input into a set of record fields that are added to the given builder.
|
boolean |
equals(Object o) |
int |
hashCode() |
<T> Stream<T> |
keys(DynamicOps<T> ops)
Returns the set of keys this object defines or accepts, serialized to the provided form.
|
String |
toString() |
codec, dependent, deprecated, fieldOf, flatXmap, forGetter, mapResult, of, of, orElse, orElse, orElse, orElseGet, orElseGet, orElseGet, setPartial, stable, unit, unit, withLifecycle, xmap
compressor
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
ap, compressedDecode, compressor, decoder, flatMap, map
comap, compressedBuilder, compressor, encoder, flatComap, makeCompressedBuilder
forStrings
public <T> DataResult<(F,S)> decode(DynamicOps<T> ops, MapLike<T> input)
MapDecoder
DataResult
.T
- The type of the serialized form.ops
- The DynamicOps
instance defining the serialized form.input
- A map or maplike object containing the serialized entries.DataResult
containing the decoded object, or an error if no object could be decoded.MapDecoder.compressedDecode(DynamicOps, Object)
public <T> RecordBuilder<T> encode((F,S) input, DynamicOps<T> ops, RecordBuilder<T> prefix)
MapEncoder
T
- The type of the serialized form.input
- The value to serialize.ops
- The DynamicOps
instance defining the serialized form.prefix
- A RecordBuilder
to add the serialized fields to.public <T> Stream<T> keys(DynamicOps<T> ops)
Keyable