Class Accessible
- java.lang.Object
-
- com.epam.reportportal.utils.reflect.Accessible
-
public class Accessible extends java.lang.ObjectUtility class to decorate routine code of accessing fields and methods in complex objects. Supports access to private elements and inheritance.
-
-
Constructor Summary
Constructors Constructor Description Accessible(java.lang.Object object)Create the decorator for given object.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description AccessibleFieldfield(java.lang.reflect.Field f)Create a decorator for an instance of accessible field.AccessibleFieldfield(java.lang.String name)Create a decorator for an instance of accessible field.AccessibleMethodmethod(java.lang.reflect.Method m)Create a decorator for an instance of accessible method.AccessibleMethodmethod(java.lang.String m, java.lang.Class<?>... parameterTypes)Create a decorator for an instance of accessible method.static Accessibleon(java.lang.Object object)Create the decorator for given object.
-
-
-
Method Detail
-
method
@Nonnull public AccessibleMethod method(@Nonnull java.lang.reflect.Method m)
Create a decorator for an instance of accessible method.- Parameters:
m- method to access- Returns:
- decorator instance
-
method
@Nonnull public AccessibleMethod method(@Nonnull java.lang.String m, @Nullable java.lang.Class<?>... parameterTypes) throws java.lang.NoSuchMethodException
Create a decorator for an instance of accessible method.- Parameters:
m- method to accessparameterTypes- an array of specific parameters to distinguish the method- Returns:
- decorator instance
- Throws:
java.lang.NoSuchMethodException- no method with such name found
-
field
@Nonnull public AccessibleField field(@Nonnull java.lang.reflect.Field f)
Create a decorator for an instance of accessible field.- Parameters:
f- field to access- Returns:
- decorator instance
-
field
@Nonnull public AccessibleField field(@Nonnull java.lang.String name) throws java.lang.NoSuchFieldException
Create a decorator for an instance of accessible field.- Parameters:
name- field to access- Returns:
- decorator instance
- Throws:
java.lang.NoSuchFieldException- no field with such name found
-
on
@Nonnull public static Accessible on(@Nonnull java.lang.Object object)
Create the decorator for given object.- Parameters:
object- an instance of object on which you need reflective access- Returns:
- decorator instance
-
-