ADD: metaHas and metaFindAll as functional sugar

This commit is contained in:
Jonas Pöhler
2021-12-17 13:56:08 +01:00
parent 68b7deba9d
commit 058021f8d0
@@ -71,6 +71,14 @@ public class AnnotationUtil {
return typeGet(clazz, annotation) != null;
}
public static boolean metaHas(AnnotatedElement element, Class<?> annotationType) {
return !metaFindAll(element, annotationType).isEmpty();
}
public static Set<Annotation> metaFindAll(AnnotatedElement element, Class<?> annotationType) {
return metaFindAllFor(element, Collections.singleton(annotationType));
}
/**
* Find all the annotations for the filter searching meta-annotations.
*/