Class DummyObjectProvider

java.lang.Object
com.griefdefender.api.util.generator.DummyObjectProvider

public final class DummyObjectProvider extends Object
This class dynamically generates a dummy class for a given interface (usually a CatalogType).

The generated class implements all of the interface's methods, but throws an UnsupportedOperationException with an informative error message.

  • Constructor Details

    • DummyObjectProvider

      public DummyObjectProvider()
  • Method Details

    • createFor

      public static <T> T createFor(Class<T> type, String fieldName)
      Creates a new dummy class implementing the specified interface.
      Type Parameters:
      T - The type of class to be created
      Parameters:
      type - The interface to generate a dummy class for
      fieldName - field name to pass to constructor
      Returns:
      The generated dummy class
    • createExtendedFor

      public static <T, I extends T> I createExtendedFor(Class<T> type, String fieldName)
      Creates a new dummy class implementing the specified interface.
      Type Parameters:
      T - Base type for the dummy class
      I - Interface for the dummy class to implement
      Parameters:
      type - The interface to generate a dummy class for
      fieldName - field name to pass to constructor
      Returns:
      The generated dummy class