Package sawfowl.regionguard.utils
Class ReflectionUtil
java.lang.Object
sawfowl.regionguard.utils.ReflectionUtil
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic <T> Optional<T>
static <T,
C, O> C getValueFromMethodWhithTypeNoArgs
(Class<T> type, Class<C> cast, O fromObject) Before using it, you should make sure that the class has only 1 method with the required return type and no arguments.
-
Constructor Details
-
ReflectionUtil
public ReflectionUtil()
-
-
Method Details
-
getValueFromMethodWhithTypeNoArgs
public static <T,C, C getValueFromMethodWhithTypeNoArgsO> (Class<T> type, Class<C> cast, O fromObject) Before using it, you should make sure that the class has only 1 method with the required return type and no arguments.- Parameters:
type
- - T - The data type you are looking for.cast
- - C - The type of object returned if the search is successful.fromObject
- - O - The object in whose class you want to find the method.
-
findField
-