Record Class DispatchedMapCodec<K,V>
java.lang.Object
java.lang.Record
com.mojang.serialization.codecs.DispatchedMapCodec<K,V>
-
Nested Class Summary
Nested classes/interfaces inherited from interface Codec
Codec.RecursiveCodec<T>, Codec.ResultFunction<A>Nested classes/interfaces inherited from interface Decoder
Decoder.Boxed<A>, Decoder.Simple<A>, Decoder.Terminal<A> -
Field Summary
FieldsModifier and TypeFieldDescriptionThe field for thekeyCodecrecord component.The field for thevalueCodecFunctionrecord component.Fields inherited from interface Codec
BOOL, BYTE, BYTE_BUFFER, DOUBLE, EMPTY, FLOAT, INT, INT_STREAM, LONG, LONG_STREAM, PASSTHROUGH, SHORT, STRING -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription<T> DataResult<Pair<Map<K, V>, T>> decode(DynamicOps<T> ops, T input) <T> DataResult<T> encode(Map<K, V> input, DynamicOps<T> ops, T prefix) private <T, V2 extends V>
DataResult<T> encodeValue(Codec<V2> codec, V input, DynamicOps<T> ops) final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.keyCodec()Returns the value of thekeyCodecrecord component.private <T> DataResult<Unit> parseEntry(DataResult<Unit> result, DynamicOps<T> ops, Pair<T, T> input, Map<K, V> entries, Stream.Builder<Pair<T, T>> failed) final StringtoString()Returns a string representation of this record class.Returns the value of thevalueCodecFunctionrecord component.Methods inherited from interface 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, withAlternative, withAlternative, withLifecycle, xmapMethods inherited from interface Decoder
boxed, decode, flatMap, map, parse, parse, simple, terminalMethods inherited from interface Encoder
comap, encodeStart, flatComap
-
Field Details
-
keyCodec
-
valueCodecFunction
-
-
Constructor Details
-
DispatchedMapCodec
-
-
Method Details
-
encode
-
encodeValue
-
decode
-
parseEntry
private <T> DataResult<Unit> parseEntry(DataResult<Unit> result, DynamicOps<T> ops, Pair<T, T> input, Map<K, V> entries, Stream.Builder<Pair<T, T>> failed) -
toString
-
hashCode
-
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). -
keyCodec
-
valueCodecFunction
-