Class ReflectionUtils
- java.lang.Object
-
- dev.aherscu.qa.testing.extra.supermachine.traverser.ReflectionUtils
-
public final class ReflectionUtils extends Object
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static void
getDeclaredFields(Class c, Collection<Field> fields)
Get all non static, non transient, fields of the passed in class, including private fields.static Collection<Field>
getDeepDeclaredFields(Class c)
Get all non static, non transient, fields of the passed in class, including private fields.static Method
getMethod(Class c, String method, Class... types)
-
-
-
Method Detail
-
getDeclaredFields
public static void getDeclaredFields(Class c, Collection<Field> fields)
Get all non static, non transient, fields of the passed in class, including private fields. Note, the special this$ field is also not returned. The resulting fields are stored in a Collection.- Parameters:
c
- Class instance that would need further processing (reference fields). This makes field traverser on a class faster as it does not need to continually process known fields like primitives.fields
- fields
-
getDeepDeclaredFields
public static Collection<Field> getDeepDeclaredFields(Class c)
Get all non static, non transient, fields of the passed in class, including private fields. Note, the special this$ field is also not returned. The result is cached in a static ConcurrentHashMap to benefit execution performance.- Parameters:
c
- Class instance- Returns:
- Collection of only the fields in the passed in class that would need further processing (reference fields). This makes field traverser on a class faster as it does not need to continually process known fields like primitives.
-
-