public class ClassUtils extends Object
Constructor and Description |
---|
ClassUtils() |
Modifier and Type | Method and Description |
---|---|
static <T extends Annotation> |
getAnnotation(Class<?> clazz,
Class<T> annotationClass) |
static <T extends Annotation> |
getAnnotation(Class<?> clazz,
String fieldName,
Class<T> annotationClass) |
static Field |
getDeclaredField(Class<?> clazz,
String fieldName) |
static <T> T |
getField(Object obj,
String fieldName) |
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 |
setField(Object obj,
String fieldName,
Object value) |
public static <T extends Annotation> T getAnnotation(Class<?> clazz, String fieldName, Class<T> annotationClass)
public static <T extends Annotation> T getAnnotation(Class<?> clazz, Class<T> annotationClass)
public static Field getDeclaredField(Class<?> clazz, String fieldName) throws NoSuchFieldException
NoSuchFieldException
public static boolean isAnnotationPresent(Class<?> clazz, Class<? extends Annotation> annotation)
public static Method searchForMethod(Class<?> type, String name, Class<?>[] parms)
type
- paramname
- of classparms
- classesCopyright © 2014–2019 The Redisson Project. All rights reserved.