Package org.jeasy.random
Class ObjenesisObjectFactory
- java.lang.Object
-
- org.jeasy.random.ObjenesisObjectFactory
-
- All Implemented Interfaces:
ObjectFactory
public class ObjenesisObjectFactory extends java.lang.Object implements ObjectFactory
Objenesis based factory to create "fancy" objects: immutable java beans, generic types, abstract and interface types.- Author:
- Mahmoud Ben Hassine (mahmoud.benhassine@icloud.com)
-
-
Constructor Summary
Constructors Constructor Description ObjenesisObjectFactory()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <T> TcreateInstance(java.lang.Class<T> type, RandomizerContext context)Create a new instance oftypein the given randomization context.
-
-
-
Method Detail
-
createInstance
public <T> T createInstance(java.lang.Class<T> type, RandomizerContext context)Description copied from interface:ObjectFactoryCreate a new instance oftypein the given randomization context.- Specified by:
createInstancein interfaceObjectFactory- Type Parameters:
T- generic type- Parameters:
type- to createcontext- current randomization context- Returns:
- new instance of the given type
-
-