public class ReflectionUtil
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
static void |
assertCallerAnnotation(java.lang.Class<? extends java.lang.annotation.Annotation> annotationClass,
java.lang.String message)
Ensures if the caller of the method calling this method is annotated with the specified
annotation.
|
static boolean |
setField(java.lang.Object source,
java.lang.String fieldName,
java.lang.Object value) |
public static boolean setField(@NonNull java.lang.Object source, @NonNull java.lang.String fieldName, @Nullable java.lang.Object value)
public static void assertCallerAnnotation(java.lang.Class<? extends java.lang.annotation.Annotation> annotationClass, java.lang.String message)
annotationClass
- the expected annotation classmessage
- the message that will included the exception if the check fails.java.lang.UnsupportedOperationException
- if the caller if the caller is not annotated as expected.