Package com.helger.commons.factory
Class FactoryNewInstance<DATATYPE>
- java.lang.Object
-
- com.helger.commons.factory.FactoryNewInstance<DATATYPE>
-
- Type Parameters:
DATATYPE- The return type of the factory
- All Implemented Interfaces:
Supplier<DATATYPE>
@Immutable public class FactoryNewInstance<DATATYPE> extends Object implements Supplier<DATATYPE>
Implementation ofSupplierthat always creates a new instance via reflection- Author:
- Philip Helger
-
-
Constructor Summary
Constructors Constructor Description FactoryNewInstance(Class<? extends DATATYPE> aClass, boolean bCheckInstancable)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static <DATATYPE> FactoryNewInstance<DATATYPE>create(Class<DATATYPE> aClass)static <DATATYPE> FactoryNewInstance<DATATYPE>create(Class<DATATYPE> aClass, boolean bCheckInstancable)booleanequals(Object o)DATATYPEget()Class<? extends DATATYPE>getFactoryClass()inthashCode()StringtoString()
-
-
-
Method Detail
-
create
@Nonnull public static <DATATYPE> FactoryNewInstance<DATATYPE> create(@Nullable Class<DATATYPE> aClass)
-
create
@Nonnull public static <DATATYPE> FactoryNewInstance<DATATYPE> create(@Nullable Class<DATATYPE> aClass, boolean bCheckInstancable)
-
-