Package io.debezium.config
Class Instantiator
- java.lang.Object
-
- io.debezium.config.Instantiator
-
public class Instantiator extends Object
Instantiates given classes reflectively.- Author:
- Jiri Pechanec
-
-
Constructor Summary
Constructors Constructor Description Instantiator()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <T> TgetInstance(String className, Supplier<ClassLoader> classloaderSupplier, Configuration configuration)Instantiates the specified class either using the no-args constructor or the constructor with a single parameter of typeConfiguration, if a configuration object is passed.static <T> TgetInstanceWithProperties(String className, Supplier<ClassLoader> classloaderSupplier, Properties prop)Instantiates the specified class either using the no-args constructor or the constructor with a single parameter of typeProperties, if a properties object is passed.private static <T,C>
TgetInstanceWithProvidedConstructorType(String className, Supplier<ClassLoader> classloaderSupplier, Class<C> constructorType, C constructorValue)
-
-
-
Method Detail
-
getInstance
public static <T> T getInstance(String className, Supplier<ClassLoader> classloaderSupplier, Configuration configuration)
Instantiates the specified class either using the no-args constructor or the constructor with a single parameter of typeConfiguration, if a configuration object is passed.- Returns:
- The newly created instance or
nullif no class name was given
-
getInstanceWithProperties
public static <T> T getInstanceWithProperties(String className, Supplier<ClassLoader> classloaderSupplier, Properties prop)
Instantiates the specified class either using the no-args constructor or the constructor with a single parameter of typeProperties, if a properties object is passed.- Returns:
- The newly created instance or
nullif no class name was given
-
getInstanceWithProvidedConstructorType
private static <T,C> T getInstanceWithProvidedConstructorType(String className, Supplier<ClassLoader> classloaderSupplier, Class<C> constructorType, C constructorValue)
-
-