Package com.mojang.serialization.codecs
Class PairMapCodec<F,S>
- All Implemented Interfaces:
Compressable
,Keyable
,MapDecoder<Pair<F,
,S>> MapEncoder<Pair<F,
S>>
-
Nested Class Summary
Nested classes/interfaces inherited from class com.mojang.serialization.MapCodec
MapCodec.MapCodecCodec<A>, MapCodec.ResultFunction<A>
Nested classes/interfaces inherited from interface com.mojang.serialization.MapDecoder
MapDecoder.Implementation<A>
Nested classes/interfaces inherited from interface com.mojang.serialization.MapEncoder
MapEncoder.Implementation<A>
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescription<T> DataResult<Pair<F,
S>> decode
(DynamicOps<T> ops, MapLike<T> input) <T> RecordBuilder<T>
encode
(Pair<F, S> input, DynamicOps<T> ops, RecordBuilder<T> prefix) boolean
int
hashCode()
<T> Stream<T>
keys
(DynamicOps<T> ops) Returns a stream of keys this map codec may write or read.toString()
Methods inherited from class com.mojang.serialization.MapCodec
codec, dependent, deprecated, fieldOf, flatXmap, forGetter, mapResult, of, of, orElse, orElse, orElse, orElseGet, orElseGet, orElseGet, setPartial, stable, unit, unit, withLifecycle, xmap
Methods inherited from class com.mojang.serialization.CompressorHolder
compressor
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface com.mojang.serialization.MapDecoder
ap, compressedDecode, compressor, decoder, flatMap, map
Methods inherited from interface com.mojang.serialization.MapEncoder
comap, compressedBuilder, compressor, encoder, flatComap
-
Constructor Details
-
PairMapCodec
-
-
Method Details
-
decode
-
encode
-
equals
-
hashCode
public int hashCode() -
toString
-
keys
Description copied from class:MapCodec
Returns a stream of keys this map codec may write or read. This stream should contain any key that may be written or read, even ones that are optional. The codec need not read or write all of these keys on any given occasion, but all keys that might be read or written should be included, as this stream is used to form the number-based indexing used withDynamicOps.compressMaps()
.Note: if a map codec writes a key that is not returned by this method, it will not work correctly with a
DynamicOps
that hasDynamicOps.compressMaps()
.
-