Class FallbackFactory<T>

java.lang.Object
nl.jqno.equalsverifier.internal.prefabvalues.factories.FallbackFactory<T>
All Implemented Interfaces:
PrefabValueFactory<T>

public class FallbackFactory<T> extends Object implements PrefabValueFactory<T>
Implementation of PrefabValueFactory that instantiates types "by force".

It instantiates the type using bytecode magic, bypassing the constructor. Then it uses PrefabValues to fill up all the fields, recursively.

  • Constructor Details

    • FallbackFactory

      public FallbackFactory()
  • Method Details

    • createValues

      public Tuple<T> createValues(TypeTag tag, PrefabValues prefabValues, LinkedHashSet<TypeTag> typeStack)
      Description copied from interface: PrefabValueFactory
      Creates a tuple of two prefab values.
      Specified by:
      createValues in interface PrefabValueFactory<T>
      Parameters:
      tag - The typetag of the type for which to create values.
      prefabValues - Repository for querying instances of generic types of the type tag.
      typeStack - A stack of TypeTags that require tag in order to be created. Used for recursion detection.
      Returns:
      A "red" instance of T.