public final class ReflectionUtils extends Object
| Modifier and Type | Method and Description |
|---|---|
static Set<Field> |
getAllFields(Class aClass,
com.google.common.base.Predicate<? super Field> predicate) |
static com.google.common.base.Optional<Field> |
getField(Class<?> type,
String fieldName)
Finds the first Field with given field name in the Class and in its super classes.
|
static <T> T |
getFieldValue(Object testCase,
String name,
Class<T> type) |
static <T> T |
getStaticFieldValue(Class testCaseClass,
String name,
Class<T> type) |
static boolean |
isOfType(Field setupScriptField,
Class type) |
static void |
setField(Object instance,
String fieldName,
Object value) |
static void |
setStaticField(Class clazz,
String fieldName,
Object value) |
public static com.google.common.base.Optional<Field> getField(Class<?> type, String fieldName)
type - The Class typefieldName - The field name to getOptional. Use isPresent() to find out if the field name was found.public static Set<Field> getAllFields(Class aClass, com.google.common.base.Predicate<? super Field> predicate)
public static <T> T getStaticFieldValue(Class testCaseClass, String name, Class<T> type)
Copyright © 2013–2020. All rights reserved.