Class LenientUnboundedMapCodec<K,​V>

java.lang.Object
net.minecraftforge.common.LenientUnboundedMapCodec<K,​V>
All Implemented Interfaces:
com.mojang.serialization.Codec<Map<K,​V>>, com.mojang.serialization.codecs.BaseMapCodec<K,​V>, com.mojang.serialization.Decoder<Map<K,​V>>, com.mojang.serialization.Encoder<Map<K,​V>>

public class LenientUnboundedMapCodec<K,​V> extends Object implements com.mojang.serialization.codecs.BaseMapCodec<K,​V>, com.mojang.serialization.Codec<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 Object>

    Nested classes/interfaces inherited from interface com.mojang.serialization.Decoder

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

    Fields
    Modifier and Type
    Field
    Description
    private com.mojang.serialization.Codec<V>
     
    private com.mojang.serialization.Codec<K>
     

    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

    Modifier and Type
    Method
    Description
    <T> com.mojang.serialization.DataResult<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<Map<K,​V>,​T>>
    decode​(com.mojang.serialization.DynamicOps<T> ops, T input)
     
    com.mojang.serialization.Codec<V>
     
    <T> com.mojang.serialization.DataResult<T>
    encode​(Map<K,​V> input, com.mojang.serialization.DynamicOps<T> ops, T prefix)
     
    boolean
    equals​(Object o)
     
    int
     
    com.mojang.serialization.Codec<K>
     
     

    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 Details

    • keyCodec

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

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

    • LenientUnboundedMapCodec

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

    • 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<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<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(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(Object o)
      Overrides:
      equals in class Object
    • hashCode

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

      public String toString()
      Overrides:
      toString in class Object