Class CodecTests<T>

java.lang.Object
net.darkhax.bookshelf.impl.gametest.tests.CodecTests<T>
All Implemented Interfaces:
ITestable
Direct Known Subclasses:
RegistryCodecTests

public class CodecTests<T> extends Object implements ITestable
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected final CodecHelper<T>
     
    protected final T[]
     
    protected final BiPredicate<T,T>
     
    protected final T
     
    protected final String
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    CodecTests(String type, CodecHelper<T> codecHelper, BiPredicate<T,T> equality, T... collection)
     
    CodecTests(String type, CodecHelper<T> codecHelper, BiPredicate<T,T> equality, T singleton, T... collection)
     
    CodecTests(String type, CodecHelper<T> serializer, T... collection)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static <DT> DT
    fromJson(net.minecraft.gametest.framework.GameTestHelper helper, com.mojang.serialization.Codec<DT> codec, com.google.gson.JsonElement json)
     
    static <DT> DT
    fromJson(net.minecraft.gametest.framework.GameTestHelper helper, com.mojang.serialization.MapCodec<DT> codec, com.google.gson.JsonElement data)
     
    Gets a default batch name that will supersede the annotation default when not null.
    void
    test_array(net.minecraft.gametest.framework.GameTestHelper helper)
     
    void
    test_list(net.minecraft.gametest.framework.GameTestHelper helper)
     
    void
    test_list_empty(net.minecraft.gametest.framework.GameTestHelper helper)
     
    void
    test_list_singleton(net.minecraft.gametest.framework.GameTestHelper helper)
     
    void
    test_nullable(net.minecraft.gametest.framework.GameTestHelper helper)
     
    void
    test_nullable_null(net.minecraft.gametest.framework.GameTestHelper helper)
     
    void
    test_optional(net.minecraft.gametest.framework.GameTestHelper helper)
     
    void
    test_optional_empty(net.minecraft.gametest.framework.GameTestHelper helper)
     
    void
    test_set(net.minecraft.gametest.framework.GameTestHelper helper)
     
    void
    test_singleton(net.minecraft.gametest.framework.GameTestHelper helper)
     
    void
    test_weighted(net.minecraft.gametest.framework.GameTestHelper helper)
     
    void
    test_weighted_list(net.minecraft.gametest.framework.GameTestHelper helper)
     
    static <DT> com.google.gson.JsonElement
    toJson(net.minecraft.gametest.framework.GameTestHelper helper, com.mojang.serialization.Codec<DT> codec, DT data)
     
    static <DT> com.google.gson.JsonElement
    toJson(net.minecraft.gametest.framework.GameTestHelper helper, com.mojang.serialization.MapCodec<DT> codec, DT data)
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • type

      protected final String type
    • codecHelper

      protected final CodecHelper<T> codecHelper
    • singleton

      protected final T singleton
    • collection

      protected final T[] collection
    • equality

      protected final BiPredicate<T,T> equality
  • Constructor Details

  • Method Details

    • test_singleton

      public void test_singleton(net.minecraft.gametest.framework.GameTestHelper helper)
    • test_array

      public void test_array(net.minecraft.gametest.framework.GameTestHelper helper)
    • test_list

      public void test_list(net.minecraft.gametest.framework.GameTestHelper helper)
    • test_list_singleton

      public void test_list_singleton(net.minecraft.gametest.framework.GameTestHelper helper)
    • test_list_empty

      public void test_list_empty(net.minecraft.gametest.framework.GameTestHelper helper)
    • test_set

      public void test_set(net.minecraft.gametest.framework.GameTestHelper helper)
    • test_optional

      public void test_optional(net.minecraft.gametest.framework.GameTestHelper helper)
    • test_optional_empty

      public void test_optional_empty(net.minecraft.gametest.framework.GameTestHelper helper)
    • test_nullable

      public void test_nullable(net.minecraft.gametest.framework.GameTestHelper helper)
    • test_nullable_null

      public void test_nullable_null(net.minecraft.gametest.framework.GameTestHelper helper)
    • test_weighted

      public void test_weighted(net.minecraft.gametest.framework.GameTestHelper helper)
    • test_weighted_list

      public void test_weighted_list(net.minecraft.gametest.framework.GameTestHelper helper)
    • getDefaultBatch

      public String getDefaultBatch()
      Description copied from interface: ITestable
      Gets a default batch name that will supersede the annotation default when not null.
      Specified by:
      getDefaultBatch in interface ITestable
      Returns:
      The default batch name for all tests in the implementation.
    • toJson

      public static <DT> com.google.gson.JsonElement toJson(net.minecraft.gametest.framework.GameTestHelper helper, com.mojang.serialization.MapCodec<DT> codec, DT data)
    • fromJson

      public static <DT> DT fromJson(net.minecraft.gametest.framework.GameTestHelper helper, com.mojang.serialization.MapCodec<DT> codec, com.google.gson.JsonElement data)
    • toJson

      public static <DT> com.google.gson.JsonElement toJson(net.minecraft.gametest.framework.GameTestHelper helper, com.mojang.serialization.Codec<DT> codec, DT data)
    • fromJson

      public static <DT> DT fromJson(net.minecraft.gametest.framework.GameTestHelper helper, com.mojang.serialization.Codec<DT> codec, com.google.gson.JsonElement json)