Class BambooReflectionHelper
java.lang.Object
com.atlassian.bamboo.testutils.reflect.BambooReflectionHelper
-
Method Summary
Modifier and TypeMethodDescriptionstatic <T> T
getFieldValue
(Class clazz, String fieldName) Get value of static fieldstatic <T> T
getFieldValue
(Object obj, String fieldName) Get value of fieldstatic <T> T
getFieldValueIncludingSuperClasses
(Object obj, String fieldName) Get value of field.static <T> T
getFieldValueUnchecked
(Object obj, Field field) Get value of field throwing unchecked exceptionsstatic <T> T
getFieldValueUnchecked
(Object obj, String fieldName) Get value of field throwing unchecked exceptionsstatic Object
invokeMethod
(Object object, Method method, Object... args) static Object
invokeMethod
(Object object, String methodName, Object... args) static void
setFieldValue
(Object obj, Field field, Object value) Sets the value of field 'fieldName' on object 'obj' to 'value'static void
setFieldValue
(Object obj, String fieldName, Object value) Sets the value of field 'fieldName' on object 'obj' to 'value'
-
Method Details
-
getFieldValue
public static <T> T getFieldValue(Object obj, String fieldName) throws NoSuchFieldException, IllegalAccessException Get value of field -
getFieldValueIncludingSuperClasses
public static <T> T getFieldValueIncludingSuperClasses(Object obj, String fieldName) throws NoSuchFieldException, IllegalAccessException Get value of field. Scans superclasses too. -
getFieldValueUnchecked
Get value of field throwing unchecked exceptions -
getFieldValueUnchecked
Get value of field throwing unchecked exceptions -
getFieldValue
public static <T> T getFieldValue(Class clazz, String fieldName) throws NoSuchFieldException, IllegalAccessException Get value of static field -
setFieldValue
public static void setFieldValue(Object obj, String fieldName, Object value) throws NoSuchFieldException, IllegalAccessException Sets the value of field 'fieldName' on object 'obj' to 'value' -
setFieldValue
Sets the value of field 'fieldName' on object 'obj' to 'value' -
invokeMethod
-
invokeMethod
-