Package org.jeasy.random.api
Interface ObjectFactory
-
- All Known Implementing Classes:
ObjenesisObjectFactory
public interface ObjectFactoryStrategy interface for object creation.- Since:
- 4.0
- Author:
- Mahmoud Ben Hassine (mahmoud.benhassine@icloud.com)
-
-
Method Summary
All Methods Instance Methods Abstract 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
<T> T createInstance(java.lang.Class<T> type, RandomizerContext context) throws ObjectCreationExceptionCreate a new instance oftypein the given randomization context.- Type Parameters:
T- generic type- Parameters:
type- to createcontext- current randomization context- Returns:
- new instance of the given type
- Throws:
ObjectCreationException- when unable to create an instance of the given type
-
-