Class LenientUnboundedMapCodec<K,​V>

  • All Implemented Interfaces:
    com.mojang.serialization.Codec<java.util.Map<K,​V>>, com.mojang.serialization.codecs.BaseMapCodec<K,​V>, com.mojang.serialization.Decoder<java.util.Map<K,​V>>, com.mojang.serialization.Encoder<java.util.Map<K,​V>>

    public class LenientUnboundedMapCodec<K,​V>
    extends java.lang.Object
    implements com.mojang.serialization.codecs.BaseMapCodec<K,​V>, com.mojang.serialization.Codec<java.util.Map<K,​V>>
    Key and value decoded independently, unknown set of keys
    • Nested Class Summary

      • Nested classes/interfaces inherited from interface com.mojang.serialization.Codec

        com.mojang.serialization.Codec.ResultFunction<A extends java.lang.Object>
      • Nested classes/interfaces inherited from interface com.mojang.serialization.Decoder

        com.mojang.serialization.Decoder.Boxed<A extends java.lang.Object>, com.mojang.serialization.Decoder.Simple<A extends java.lang.Object>, com.mojang.serialization.Decoder.Terminal<A extends java.lang.Object>
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private com.mojang.serialization.Codec<V> elementCodec  
      private com.mojang.serialization.Codec<K> keyCodec  
      • Fields inherited from interface com.mojang.serialization.Codec

        BOOL, BYTE, BYTE_BUFFER, DOUBLE, EMPTY, FLOAT, INT, INT_STREAM, LONG, LONG_STREAM, PASSTHROUGH, SHORT, STRING
    • Constructor Summary

      Constructors 
      Constructor Description
      LenientUnboundedMapCodec​(com.mojang.serialization.Codec<K> keyCodec, com.mojang.serialization.Codec<V> elementCodec)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      <T> com.mojang.serialization.DataResult<java.util.Map<K,​V>> decode​(com.mojang.serialization.DynamicOps<T> ops, com.mojang.serialization.MapLike<T> input)  
      <T> com.mojang.serialization.DataResult<com.mojang.datafixers.util.Pair<java.util.Map<K,​V>,​T>> decode​(com.mojang.serialization.DynamicOps<T> ops, T input)  
      com.mojang.serialization.Codec<V> elementCodec()  
      <T> com.mojang.serialization.DataResult<T> encode​(java.util.Map<K,​V> input, com.mojang.serialization.DynamicOps<T> ops, T prefix)  
      boolean equals​(java.lang.Object o)  
      int hashCode()  
      com.mojang.serialization.Codec<K> keyCodec()  
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
      • Methods inherited from interface com.mojang.serialization.codecs.BaseMapCodec

        encode
      • Methods inherited from interface com.mojang.serialization.Codec

        comapFlatMap, deprecated, dispatch, dispatch, dispatchMap, dispatchMap, dispatchStable, fieldOf, flatComapMap, flatXmap, listOf, mapResult, optionalFieldOf, optionalFieldOf, optionalFieldOf, optionalFieldOf, orElse, orElse, orElse, orElseGet, orElseGet, orElseGet, partialDispatch, promotePartial, stable, withLifecycle, xmap
      • Methods inherited from interface com.mojang.serialization.Decoder

        boxed, decode, flatMap, map, parse, parse, simple, terminal
      • Methods inherited from interface com.mojang.serialization.Encoder

        comap, encodeStart, flatComap
    • Field Detail

      • keyCodec

        private final com.mojang.serialization.Codec<K> keyCodec
      • elementCodec

        private final com.mojang.serialization.Codec<V> elementCodec
    • Constructor Detail

      • LenientUnboundedMapCodec

        public LenientUnboundedMapCodec​(com.mojang.serialization.Codec<K> keyCodec,
                                        com.mojang.serialization.Codec<V> elementCodec)
    • Method Detail

      • keyCodec

        public com.mojang.serialization.Codec<K> keyCodec()
        Specified by:
        keyCodec in interface com.mojang.serialization.codecs.BaseMapCodec<K,​V>
      • elementCodec

        public com.mojang.serialization.Codec<V> elementCodec()
        Specified by:
        elementCodec in interface com.mojang.serialization.codecs.BaseMapCodec<K,​V>
      • decode

        public <T> com.mojang.serialization.DataResult<java.util.Map<K,​V>> decode​(com.mojang.serialization.DynamicOps<T> ops,
                                                                                        com.mojang.serialization.MapLike<T> input)
        Specified by:
        decode in interface com.mojang.serialization.codecs.BaseMapCodec<K,​V>
      • decode

        public <T> com.mojang.serialization.DataResult<com.mojang.datafixers.util.Pair<java.util.Map<K,​V>,​T>> decode​(com.mojang.serialization.DynamicOps<T> ops,
                                                                                                                                 T input)
        Specified by:
        decode in interface com.mojang.serialization.Decoder<K>
      • encode

        public <T> com.mojang.serialization.DataResult<T> encode​(java.util.Map<K,​V> input,
                                                                 com.mojang.serialization.DynamicOps<T> ops,
                                                                 T prefix)
        Specified by:
        encode in interface com.mojang.serialization.Encoder<K>
      • equals

        public boolean equals​(java.lang.Object o)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object