Package net.minecraft.util
Record Class ExtraCodecs.StrictUnboundedMapCodec<K,V>
java.lang.Object
java.lang.Record
net.minecraft.util.ExtraCodecs.StrictUnboundedMapCodec<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>>
- Enclosing class:
ExtraCodecs
-
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
Modifier and TypeFieldDescriptionprivate final com.mojang.serialization.Codec
<V> The field for theelementCodec
record component.private final com.mojang.serialization.Codec
<K> The field for thekeyCodec
record component.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
ConstructorDescriptionStrictUnboundedMapCodec
(com.mojang.serialization.Codec<K> keyCodec, com.mojang.serialization.Codec<V> elementCodec) Creates an instance of aStrictUnboundedMapCodec
record class. -
Method Summary
Modifier and TypeMethodDescriptiondecode
(com.mojang.serialization.DynamicOps<T> p_298061_, com.mojang.serialization.MapLike<T> p_299914_) decode
(com.mojang.serialization.DynamicOps<T> p_299262_, T p_297460_) com.mojang.serialization.Codec
<V> Returns the value of theelementCodec
record component.<T> com.mojang.serialization.DataResult
<T> final boolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
Returns a hash code value for this object.com.mojang.serialization.Codec
<K> keyCodec()
Returns the value of thekeyCodec
record component.toString()
Returns a string representation of this record class.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
-
keyCodec
The field for thekeyCodec
record component. -
elementCodec
The field for theelementCodec
record component.
-
-
Constructor Details
-
StrictUnboundedMapCodec
public StrictUnboundedMapCodec(com.mojang.serialization.Codec<K> keyCodec, com.mojang.serialization.Codec<V> elementCodec) Creates an instance of aStrictUnboundedMapCodec
record class.- Parameters:
keyCodec
- the value for thekeyCodec
record componentelementCodec
- the value for theelementCodec
record component
-
-
Method Details
-
decode
-
decode
public <T> com.mojang.serialization.DataResult<com.mojang.datafixers.util.Pair<Map<K,V>, decodeT>> (com.mojang.serialization.DynamicOps<T> p_299262_, T p_297460_) - Specified by:
decode
in interfacecom.mojang.serialization.Decoder<K>
-
encode
public <T> com.mojang.serialization.DataResult<T> encode(Map<K, V> p_301091_, com.mojang.serialization.DynamicOps<T> p_298442_, T p_300447_) - Specified by:
encode
in interfacecom.mojang.serialization.Encoder<K>
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
keyCodec
Returns the value of thekeyCodec
record component. -
elementCodec
Returns the value of theelementCodec
record component. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object)
.
-