org.unitils.objectvalidation.objectcreator.generator
Class EnumGenerator
java.lang.Object
org.unitils.objectvalidation.objectcreator.generator.EnumGenerator
- All Implemented Interfaces:
- Generator
public class EnumGenerator
- extends Object
- implements Generator
Generates an random enum from the right class.
- Since:
- Feb 20, 2012
- Author:
- Jeroen Horemans
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
EnumGenerator
public EnumGenerator()
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.
createEnum
public Object createEnum(Class<?> clazz)
throws IllegalArgumentException,
IllegalAccessException,
InvocationTargetException
- Throws:
IllegalArgumentException
IllegalAccessException
InvocationTargetException
Copyright © 2013-2015. All Rights Reserved.