Package io.appium.java_client.internal
Class ReflectionHelpers
- java.lang.Object
-
- io.appium.java_client.internal.ReflectionHelpers
-
public class ReflectionHelpers extends java.lang.Object
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <T> TgetPrivateFieldValue(java.lang.Class<?> cls, java.lang.Object target, java.lang.String fieldName, java.lang.Class<T> fieldType)Fetches the value of a private instance field.static <T> TsetPrivateFieldValue(java.lang.Class<?> cls, T target, java.lang.String fieldName, java.lang.Object newValue)Sets the given value to a private instance field.
-
-
-
Method Detail
-
setPrivateFieldValue
public static <T> T setPrivateFieldValue(java.lang.Class<?> cls, T target, java.lang.String fieldName, java.lang.Object newValue)Sets the given value to a private instance field.- Parameters:
cls- The target class or a superclass.target- Target instance.fieldName- Target field name.newValue- The value to be set.- Returns:
- The same instance for chaining.
-
getPrivateFieldValue
public static <T> T getPrivateFieldValue(java.lang.Class<?> cls, java.lang.Object target, java.lang.String fieldName, java.lang.Class<T> fieldType)Fetches the value of a private instance field.- Parameters:
cls- The target class or a superclass.target- Target instance.fieldName- Target field name.fieldType- Field type.- Returns:
- The retrieved field value.
-
-