Class ExtraCodecs.StrictOptionalFieldCodec<A>

java.lang.Object
com.mojang.serialization.CompressorHolder
com.mojang.serialization.MapCodec<Optional<A>>
net.minecraft.util.ExtraCodecs.StrictOptionalFieldCodec<A>
All Implemented Interfaces:
com.mojang.serialization.Compressable, com.mojang.serialization.Keyable, com.mojang.serialization.MapDecoder<Optional<A>>, com.mojang.serialization.MapEncoder<Optional<A>>
Enclosing class:
ExtraCodecs

static final class ExtraCodecs.StrictOptionalFieldCodec<A> extends com.mojang.serialization.MapCodec<Optional<A>>
  • Nested Class Summary

    Nested classes/interfaces inherited from class com.mojang.serialization.MapCodec

    com.mojang.serialization.MapCodec.MapCodecCodec<A extends Object>, com.mojang.serialization.MapCodec.ResultFunction<A extends Object>

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

    com.mojang.serialization.MapDecoder.Implementation<A extends Object>

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

    com.mojang.serialization.MapEncoder.Implementation<A extends Object>
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private final com.mojang.serialization.Codec<A>
     
    private final String
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    StrictOptionalFieldCodec(String p_298144_, com.mojang.serialization.Codec<A> p_301114_)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    <T> com.mojang.serialization.DataResult<Optional<A>>
    decode(com.mojang.serialization.DynamicOps<T> p_299736_, com.mojang.serialization.MapLike<T> p_298150_)
     
    <T> com.mojang.serialization.RecordBuilder<T>
    encode(Optional<A> p_299100_, com.mojang.serialization.DynamicOps<T> p_299809_, com.mojang.serialization.RecordBuilder<T> p_300932_)
     
    boolean
    equals(Object p_300958_)
     
    int
     
    <T> Stream<T>
    keys(com.mojang.serialization.DynamicOps<T> p_300796_)
     
     

    Methods inherited from class com.mojang.serialization.MapCodec

    codec, dependent, deprecated, fieldOf, flatXmap, forGetter, mapResult, of, of, orElse, orElse, orElse, orElseGet, orElseGet, orElseGet, setPartial, stable, unit, unit, withLifecycle, xmap

    Methods inherited from class com.mojang.serialization.CompressorHolder

    compressor

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait

    Methods inherited from interface com.mojang.serialization.MapDecoder

    ap, compressedDecode, compressor, decoder, flatMap, map

    Methods inherited from interface com.mojang.serialization.MapEncoder

    comap, compressedBuilder, compressor, encoder, flatComap
  • Field Details

    • name

      private final String name
    • elementCodec

      private final com.mojang.serialization.Codec<A> elementCodec
  • Constructor Details

    • StrictOptionalFieldCodec

      public StrictOptionalFieldCodec(String p_298144_, com.mojang.serialization.Codec<A> p_301114_)
  • Method Details

    • decode

      public <T> com.mojang.serialization.DataResult<Optional<A>> decode(com.mojang.serialization.DynamicOps<T> p_299736_, com.mojang.serialization.MapLike<T> p_298150_)
    • encode

      public <T> com.mojang.serialization.RecordBuilder<T> encode(Optional<A> p_299100_, com.mojang.serialization.DynamicOps<T> p_299809_, com.mojang.serialization.RecordBuilder<T> p_300932_)
    • keys

      public <T> Stream<T> keys(com.mojang.serialization.DynamicOps<T> p_300796_)
      Specified by:
      keys in interface com.mojang.serialization.Keyable
      Specified by:
      keys in class com.mojang.serialization.MapCodec<Optional<A>>
    • equals

      public boolean equals(Object p_300958_)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object