Class Int2ObjectMapCodec<T>

java.lang.Object
com.hypixel.hytale.codec.codecs.map.Int2ObjectMapCodec<T>
All Implemented Interfaces:
Codec<it.unimi.dsi.fastutil.ints.Int2ObjectMap<T>>, RawJsonCodec<it.unimi.dsi.fastutil.ints.Int2ObjectMap<T>>, SchemaConvertable<it.unimi.dsi.fastutil.ints.Int2ObjectMap<T>>, WrappedCodec<T>

public class Int2ObjectMapCodec<T> extends Object implements Codec<it.unimi.dsi.fastutil.ints.Int2ObjectMap<T>>, WrappedCodec<T>
Since:
07/03/2018
Version:
1.0
  • Constructor Details

    • Int2ObjectMapCodec

      public Int2ObjectMapCodec(Codec<T> valueCodec, Supplier<it.unimi.dsi.fastutil.ints.Int2ObjectMap<T>> supplier, boolean unmodifiable)
    • Int2ObjectMapCodec

      public Int2ObjectMapCodec(Codec<T> valueCodec, Supplier<it.unimi.dsi.fastutil.ints.Int2ObjectMap<T>> supplier)
  • Method Details

    • getChildCodec

      public Codec<T> getChildCodec()
      Specified by:
      getChildCodec in interface WrappedCodec<T>
    • decode

      public it.unimi.dsi.fastutil.ints.Int2ObjectMap<T> decode(@Nonnull org.bson.BsonValue bsonValue, @Nonnull ExtraInfo extraInfo)
      Specified by:
      decode in interface Codec<T>
    • encode

      @Nonnull public org.bson.BsonValue encode(@Nonnull it.unimi.dsi.fastutil.ints.Int2ObjectMap<T> map, ExtraInfo extraInfo)
      Specified by:
      encode in interface Codec<T>
    • decodeJson

      public it.unimi.dsi.fastutil.ints.Int2ObjectMap<T> decodeJson(@Nonnull RawJsonReader reader, @Nonnull ExtraInfo extraInfo) throws IOException
      Specified by:
      decodeJson in interface Codec<T>
      Specified by:
      decodeJson in interface RawJsonCodec<T>
      Throws:
      IOException
    • toSchema

      @Nonnull public Schema toSchema(@Nonnull SchemaContext context)
      Description copied from interface: SchemaConvertable
      Returns a schema object that represents this codec as JSON Schema.
      Specified by:
      toSchema in interface SchemaConvertable<T>
      Parameters:
      context - A context to use to assist with creating the schema.
      Returns:
      the generated schema.