Package org.redisson.liveobject.misc
Class ClassUtils
java.lang.Object
org.redisson.liveobject.misc.ClassUtils
- Author:
- Rui Gu (https://github.com/jackygurui) Modified
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic <T extends Annotation>
TgetAnnotation
(Class<?> clazz, Class<T> annotationClass) static <T extends Annotation>
TgetAnnotation
(Class<?> clazz, String fieldName, Class<T> annotationClass) static Field
getDeclaredField
(Class<?> clazz, String fieldName) static <T> T
static boolean
isAnnotationPresent
(Class<?> clazz, Class<? extends Annotation> annotation) static Method
searchForMethod
(Class<?> type, String name, Class<?>[] parms) Searches through all methods looking for one with the specified name that will take the specified paramaters even if the parameter types are more generic in the actual method implementation.static void
-
Constructor Details
-
ClassUtils
public ClassUtils()
-
-
Method Details
-
setField
-
getAnnotation
public static <T extends Annotation> T getAnnotation(Class<?> clazz, String fieldName, Class<T> annotationClass) -
getAnnotation
-
getField
-
getDeclaredField
- Throws:
NoSuchFieldException
-
isAnnotationPresent
-
searchForMethod
Searches through all methods looking for one with the specified name that will take the specified paramaters even if the parameter types are more generic in the actual method implementation. This is similar to the findConstructor() method and has the similar limitations that it doesn't do a real widening scope search and simply processes the methods in order.- Parameters:
type
- paramname
- of classparms
- classes- Returns:
- Method object
-