Record Class Codecs.StrictUnboundedMapCodec<K,V>

java.lang.Object
java.lang.Record
net.minecraft.util.dynamic.Codecs.StrictUnboundedMapCodec<K,V>
Record Components:
keyCodec -
elementCodec -
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:
Codecs

public static record Codecs.StrictUnboundedMapCodec<K,V>(com.mojang.serialization.Codec<K> keyCodec, com.mojang.serialization.Codec<V> elementCodec) extends Record implements com.mojang.serialization.Codec<Map<K,V>>, com.mojang.serialization.codecs.BaseMapCodec<K,V>
Mappings:
Namespace Name
official arf$e
intermediary net/minecraft/class_5699$class_8783
named net/minecraft/util/dynamic/Codecs$StrictUnboundedMapCodec
official a
intermediary a
named keyCodec
official b
intermediary b
named elementCodec
  • Nested Class Summary

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

    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>
    The field for the elementCodec record component.
    private final com.mojang.serialization.Codec<K>
    The field for the keyCodec 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

    Constructors
    Constructor
    Description
    StrictUnboundedMapCodec(com.mojang.serialization.Codec<K> keyCodec, com.mojang.serialization.Codec<V> elementCodec)
    Creates an instance of a StrictUnboundedMapCodec record class.
  • 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>
    Returns the value of the elementCodec record component.
    <T> com.mojang.serialization.DataResult<T>
    encode(Map<K,V> map, com.mojang.serialization.DynamicOps<T> dynamicOps, T t)
     
    final boolean
    Indicates whether some other object is "equal to" this one.
    final int
    Returns a hash code value for this object.
    com.mojang.serialization.Codec<K>
    Returns the value of the keyCodec record component.
    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, listOf, mapResult, optionalFieldOf, optionalFieldOf, optionalFieldOf, optionalFieldOf, orElse, orElse, orElse, orElseGet, orElseGet, orElseGet, partialDispatch, promotePartial, stable, 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

      private final com.mojang.serialization.Codec<K> keyCodec
      The field for the keyCodec record component.
    • elementCodec

      private final com.mojang.serialization.Codec<V> elementCodec
      The field for the elementCodec record component.
  • Constructor Details

    • StrictUnboundedMapCodec

      public StrictUnboundedMapCodec(com.mojang.serialization.Codec<K> keyCodec, com.mojang.serialization.Codec<V> elementCodec)
      Creates an instance of a StrictUnboundedMapCodec record class.
      Parameters:
      keyCodec - the value for the keyCodec record component
      elementCodec - the value for the elementCodec record component
  • Method Details

    • 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>
      Mappings:
      Namespace Name Mixin selector
      official decode Larf$e;decode(Lcom/mojang/serialization/DynamicOps;Lcom/mojang/serialization/MapLike;)Lcom/mojang/serialization/DataResult;
      intermediary decode Lnet/minecraft/class_5699$class_8783;decode(Lcom/mojang/serialization/DynamicOps;Lcom/mojang/serialization/MapLike;)Lcom/mojang/serialization/DataResult;
      named decode Lnet/minecraft/util/dynamic/Codecs$StrictUnboundedMapCodec;decode(Lcom/mojang/serialization/DynamicOps;Lcom/mojang/serialization/MapLike;)Lcom/mojang/serialization/DataResult;
    • 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>
      Mappings:
      Namespace Name Mixin selector
      official decode Larf$e;decode(Lcom/mojang/serialization/DynamicOps;Ljava/lang/Object;)Lcom/mojang/serialization/DataResult;
      intermediary decode Lnet/minecraft/class_5699$class_8783;decode(Lcom/mojang/serialization/DynamicOps;Ljava/lang/Object;)Lcom/mojang/serialization/DataResult;
      named decode Lnet/minecraft/util/dynamic/Codecs$StrictUnboundedMapCodec;decode(Lcom/mojang/serialization/DynamicOps;Ljava/lang/Object;)Lcom/mojang/serialization/DataResult;
    • encode

      public <T> com.mojang.serialization.DataResult<T> encode(Map<K,V> map, com.mojang.serialization.DynamicOps<T> dynamicOps, T t)
      Specified by:
      encode in interface com.mojang.serialization.Encoder<K>
      Mappings:
      Namespace Name Mixin selector
      official a Larf$e;a(Ljava/util/Map;Lcom/mojang/serialization/DynamicOps;Ljava/lang/Object;)Lcom/mojang/serialization/DataResult;
      intermediary method_53708 Lnet/minecraft/class_5699$class_8783;method_53708(Ljava/util/Map;Lcom/mojang/serialization/DynamicOps;Ljava/lang/Object;)Lcom/mojang/serialization/DataResult;
      named encode Lnet/minecraft/util/dynamic/Codecs$StrictUnboundedMapCodec;encode(Ljava/util/Map;Lcom/mojang/serialization/DynamicOps;Ljava/lang/Object;)Lcom/mojang/serialization/DataResult;
    • toString

      public String 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.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • 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.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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 with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • keyCodec

      public com.mojang.serialization.Codec<K> keyCodec()
      Returns the value of the keyCodec record component.
      Specified by:
      keyCodec in interface com.mojang.serialization.codecs.BaseMapCodec<K,V>
      Returns:
      the value of the keyCodec record component
    • elementCodec

      public com.mojang.serialization.Codec<V> elementCodec()
      Returns the value of the elementCodec record component.
      Specified by:
      elementCodec in interface com.mojang.serialization.codecs.BaseMapCodec<K,V>
      Returns:
      the value of the elementCodec record component