Package org.polkadot.common
Class ReflectionUtils
- java.lang.Object
-
- org.polkadot.common.ReflectionUtils
-
public class ReflectionUtils extends java.lang.Object
-
-
Constructor Summary
Constructors Constructor Description ReflectionUtils()
-
Method Summary
Modifier and Type Method Description static java.lang.reflect.FieldgetDeclaredField(java.lang.Object object, java.lang.String fieldName)Find DeclaredField recursively.static <T> TgetField(java.lang.Object object, java.lang.String fieldName)Read field value directly, ignore private/protected and getter
-
-
-
Method Detail
-
getDeclaredField
public static java.lang.reflect.Field getDeclaredField(java.lang.Object object, java.lang.String fieldName)Find DeclaredField recursively.- Parameters:
object- : the child objectfieldName- : the field name in the parent object- Returns:
- the field object in the parent object
-
getField
public static <T> T getField(java.lang.Object object, java.lang.String fieldName)Read field value directly, ignore private/protected and getter- Parameters:
object- : the child objectfieldName- : the field name in the parent object- Returns:
- : the field value in the parent object
-
-