Class InterfaceProxyGenerator<T>

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

public class InterfaceProxyGenerator<T> extends Object implements de.cuioss.test.generator.TypedGenerator<T>
Creates proxies for given interfaces, should only be used as last line of defense.
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 InterfaceProxyGenerator. It only works with interfaces.
      Parameters:
      type - to be checked, should be an interface
      Returns:
      an Optional on the corresponding TypedGenerator if the given type is an interfaces, otherwise Optional.empty()