Class DynamicProxyGenerator<T>

java.lang.Object
de.cuioss.test.valueobjects.generator.dynamic.impl.DynamicProxyGenerator<T>
Type Parameters:
T - the type of objects to be generated
All Implemented Interfaces:
de.cuioss.test.generator.TypedGenerator<T>

public class DynamicProxyGenerator<T> extends Object implements de.cuioss.test.generator.TypedGenerator<T>
Creates proxies using javassist for any type given that is not an interface nor annotation nor enum.
Author:
Oliver Wolff
  • Constructor Details

  • Method Details

    • next

      public T next()
      Specified by:
      next in interface de.cuioss.test.generator.TypedGenerator<T>
    • getType

      public Class<T> getType()
      Specified by:
      getType in interface de.cuioss.test.generator.TypedGenerator<T>
    • getGeneratorForType

      public static final <T> Optional<de.cuioss.test.generator.TypedGenerator<T>> getGeneratorForType(Class<T> type)
      Factory method for creating an instance of DynamicProxyGenerator. It only works for any type given that is not an interface nor annotation nor enum.
      Parameters:
      type - to be checked,
      Returns:
      an Optional on the corresponding TypedGenerator if the given type is applicable, otherwise Optional.empty()