Package net.minecraftforge.common
Class LenientUnboundedMapCodec<K,V>
- java.lang.Object
-
- net.minecraftforge.common.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
-
-
Field Summary
Fields Modifier and Type Field Description private com.mojang.serialization.Codec<V>
elementCodec
private com.mojang.serialization.Codec<K>
keyCodec
-
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.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
-
-
-
-
Method Detail
-
keyCodec
public com.mojang.serialization.Codec<K> keyCodec()
-
elementCodec
public com.mojang.serialization.Codec<V> elementCodec()
-
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)
-
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 interfacecom.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 interfacecom.mojang.serialization.Encoder<K>
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-