Package au.com.origin.snapshots.utils
Class ReflectionUtils
java.lang.Object
au.com.origin.snapshots.utils.ReflectionUtils
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfindFieldByPredicate(Class<?> clazz, Predicate<Field> predicate) FindFieldby given predicate.static voidmakeAccessible(Field field)
-
Constructor Details
-
ReflectionUtils
public ReflectionUtils()
-
-
Method Details
-
findFieldByPredicate
FindFieldby given predicate.Invoke the given predicate on all fields in the target class, going up the class hierarchy to get all declared fields.
- Parameters:
clazz- the target class to analyzepredicate- the predicate- Returns:
- the field or empty optional
-
makeAccessible
-