| Constructor and Description |
|---|
GenericsGenerator() |
| Modifier and Type | Method and Description |
|---|---|
Set<Class<?>> |
compareSubtypesSets(Set<?> set1,
Set<?> set2)
Returns only the in common classes of set1 and set2
|
protected Object |
createRandomObjects(Set<Class<?>> classes)
This method creates a random object of a random class found with
getClassesOfSubtypes(WildcardTypeImpl, Set) or getClassesOfSuperType(WildcardTypeImpl, Set). |
Object |
generateObject(Class<?> clazz,
List<Object> input,
List<Class<?>> inputClasses,
List<TreeNode> genericSubTypes) |
Object |
generateSubTypesObject(Class<?> classForType)
Generate the exact object or a subtype from a specific class.
|
Set<Class<?>> |
getClassesFromAParameterizedType(ParameterizedType type)
Get all the sub/super classes from a the
ParameterizedType. |
Set<Class<?>> |
getClassesFromTypeArguments(Type type)
Get the classes from a specific type.
|
protected Set<?> |
getClassesOfSubtypes(Class<?> clzz,
Set<?> allClasses)
Get the subtypes of a
Class |
protected Set<?> |
getClassesOfSubtypes(sun.reflect.generics.reflectiveObjects.WildcardTypeImpl wildcard,
Set<?> allClasses)
Get the subtypes of a class (based on a wildcard).
|
protected Set<Class<?>> |
getClassesOfSuperType(Class<?> clzz,
Set<Class<?>> allClasses)
Get all the supertypes from a
Class |
protected Set<Class<?>> |
getClassesOfSuperType(sun.reflect.generics.reflectiveObjects.WildcardTypeImpl wildcard,
Set<Class<?>> allClasses)
An
WildcardTypeImpl can have multiple lowerbounds (super). |
protected Set<Class<? extends Object>> |
getSetWithClassesThatOverridesASpecificMethod(Set<Class<? extends Object>> set,
String methodName,
Class<?>... parameterTypes)
Goes through all the objects in a set and removes all the classes that
doesn't override a specific method.
|
protected Object |
pickAndCreateAnObjectFromASet(Set<Class<?>> collClasses)
This method creates a random object from a
Set of classes. |
public Object generateObject(Class<?> clazz, List<Object> input, List<Class<?>> inputClasses, List<TreeNode> genericSubTypes)
generateObject in interface Generatorclazz - 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 enteredGenerator.generateObject(java.lang.Class, java.util.List, java.util.List, java.util.List)public Set<Class<?>> getClassesFromAParameterizedType(ParameterizedType type)
ParameterizedType.type: - This is the ParameterizedType from a generic.Setpublic Set<Class<?>> getClassesFromTypeArguments(Type type)
WildcardTypeImpl.protected Object pickAndCreateAnObjectFromASet(Set<Class<?>> collClasses)
Set of classes.collClasses: - This is a collection of classes.Objectpublic Object generateSubTypesObject(Class<?> classForType)
classForType: - the generator should look for a subtype of this class.Objectprotected Set<Class<? extends Object>> getSetWithClassesThatOverridesASpecificMethod(Set<Class<? extends Object>> set, String methodName, Class<?>... parameterTypes)
set: - A set of classes.methodName: - the method that this method should findparameterTypes: - the parameters of the method that the classes must overrideSetprotected Set<?> getClassesOfSubtypes(sun.reflect.generics.reflectiveObjects.WildcardTypeImpl wildcard, Set<?> allClasses)
protected Set<?> getClassesOfSubtypes(Class<?> clzz, Set<?> allClasses)
Classprotected Set<Class<?>> getClassesOfSuperType(sun.reflect.generics.reflectiveObjects.WildcardTypeImpl wildcard, Set<Class<?>> allClasses)
WildcardTypeImpl can have multiple lowerbounds (super).protected Set<Class<?>> getClassesOfSuperType(Class<?> clzz, Set<Class<?>> allClasses)
Classprotected Object createRandomObjects(Set<Class<?>> classes)
getClassesOfSubtypes(WildcardTypeImpl, Set) or getClassesOfSuperType(WildcardTypeImpl, Set).classes: - A set with a collection of classes.ObjectCopyright © 2013-2014. All Rights Reserved.