org.unitils.objectvalidation.objectcreator.generator
Class MocksGenerator
java.lang.Object
org.unitils.objectvalidation.objectcreator.generator.MocksGenerator
- All Implemented Interfaces:
- Generator
public class MocksGenerator
- extends Object
- implements Generator
This class generates a mock object of a specific Class and should be the final option.
- Since:
- 1.1.8
- Author:
- Willemijn Wouters
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
MocksGenerator
public MocksGenerator()
generateObject
public Object generateObject(Class<?> clazz,
List<Object> input,
List<Class<?>> inputClasses,
List<TreeNode> genericSubTypes)
throws Exception
- Specified by:
generateObject in interface Generator
- Parameters:
clazz - The class of the object to generateinput - the parameters to give to the constructorinputClasses - the types of the constructor parametersgenericSubTypes - if clazz has generic parameters here they should be entered
- Returns:
- Object a randomly generated object or null if it was impossible to generate
- Throws:
Exception - if illegal calls to object constructors.- See Also:
Generator.generateObject(java.lang.Class, java.util.List, java.util.List, java.util.List)
createMockObject
public Object createMockObject(Class<?> clzz)
- This method creates a mock of type clzz.
- Parameters:
clzz - : the type that should be mocked.
- Returns:
Object
Copyright © 2013-2015. All Rights Reserved.