public class BambooReflectionHelper extends Object
Modifier and Type | Method and Description |
---|---|
static <T> T |
getFieldValue(Class clazz,
String fieldName)
Get value of static field
|
static <T> T |
getFieldValue(Object obj,
String fieldName)
Get value of field
|
static <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 exceptions
|
static <T> T |
getFieldValueUnchecked(Object obj,
String fieldName)
Get value of field throwing unchecked exceptions
|
static 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'
|
public static <T> T getFieldValue(Object obj, String fieldName) throws NoSuchFieldException, IllegalAccessException
public static <T> T getFieldValueIncludingSuperClasses(Object obj, String fieldName) throws NoSuchFieldException, IllegalAccessException
public static <T> T getFieldValueUnchecked(Object obj, String fieldName)
public static <T> T getFieldValueUnchecked(Object obj, Field field)
public static <T> T getFieldValue(Class clazz, String fieldName) throws NoSuchFieldException, IllegalAccessException
public static void setFieldValue(Object obj, String fieldName, Object value) throws NoSuchFieldException, IllegalAccessException
public static void setFieldValue(Object obj, Field field, Object value)
Copyright © 2022 Atlassian Software Systems Pty Ltd. All rights reserved.