Class LenientUnboundedMapCodec<K,V>

java.lang.Object
net.neoforged.neoforge.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.RecursiveCodec<T>, com.mojang.serialization.Codec.ResultFunction<A>

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

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

    Fields
    Modifier and Type
    Field
    Description
    private final com.mojang.serialization.Codec<V>
     
    private final com.mojang.serialization.Codec<K>
     
    private static final org.slf4j.Logger
     

    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
     
    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, lenientOptionalFieldOf, lenientOptionalFieldOf, lenientOptionalFieldOf, lenientOptionalFieldOf, listOf, listOf, mapResult, optionalFieldOf, optionalFieldOf, optionalFieldOf, optionalFieldOf, orElse, orElse, orElse, orElseGet, orElseGet, orElseGet, partialDispatch, promotePartial, sizeLimitedListOf, stable, validate, 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

    • LOGGER

      private static final org.slf4j.Logger LOGGER
    • 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