Record Class UnboundedMapCodec<K,V>
java.lang.Object
java.lang.Record
com.mojang.serialization.codecs.UnboundedMapCodec<K,V>
- All Implemented Interfaces:
Codec<Map<K,V>>, BaseMapCodec<K, V>, Decoder<Map<K, V>>, Encoder<Map<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 theelementCodecrecord component.The field for thekeyCodecrecord component.Fields inherited from interface Codec
BOOL, BYTE, BYTE_BUFFER, DOUBLE, EMPTY, FLOAT, INT, INT_STREAM, LONG, LONG_STREAM, PASSTHROUGH, SHORT, STRING -
Constructor Summary
ConstructorsConstructorDescriptionUnboundedMapCodec(Codec<K> keyCodec, Codec<V> elementCodec) Creates an instance of aUnboundedMapCodecrecord class. -
Method Summary
Modifier and TypeMethodDescription<T> DataResult<Pair<Map<K, V>, T>> decode(DynamicOps<T> ops, T input) Returns the value of theelementCodecrecord component.<T> DataResult<T> encode(Map<K, V> input, DynamicOps<T> ops, T prefix) 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.toString()Returns a string representation of this record class.Methods inherited from interface BaseMapCodec
decode, encodeMethods 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
-
elementCodec
-
-
Constructor Details
-
UnboundedMapCodec
-
-
Method Details
-
decode
-
encode
-
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
-
elementCodec
Returns the value of theelementCodecrecord component.- Specified by:
elementCodecin interfaceBaseMapCodec<K,V> - Returns:
- the value of the
elementCodecrecord component
-