T - the annotation element typepublic interface AnnotationTrait<T extends AnnotatedElement>
| Modifier and Type | Method and Description |
|---|---|
T |
getAnnotatedElement()
Get the annotated element .
|
default <A extends Annotation> |
getAnnotation(Class<A> annotationType)
Get the given annotation on the annotated element.
|
default <A extends Annotation> |
getAnnotations(Class<A> annotationType)
Get all the annotations of the given type.
|
default Annotation[] |
getMetaAnnotations(Collection<Class<? extends Annotation>>... metaAnnotationTypes)
Get the meta annotations declared on the annotated element itself or annotations on the
annotated element.
|
default boolean |
hasAnyAnnotations(Class<? extends Annotation>... annotationTypes)
Determine if the annotated element has any of the given annotations.
|
default boolean |
hasAnyAnnotations(Collection<Class<? extends Annotation>> annotationTypes)
Determine if the annotated element has any of the given annotations.
|
T getAnnotatedElement()
default <A extends Annotation> Optional<A> getAnnotation(Class<A> annotationType)
A - annotation typeannotationType - the annotation typedefault <A extends Annotation> List<A> getAnnotations(Class<A> annotationType)
A - annotation typeannotationType - the annotation typedefault Annotation[] getMetaAnnotations(Collection<Class<? extends Annotation>>... metaAnnotationTypes)
metaAnnotationTypes - an array of meta annotationsdefault boolean hasAnyAnnotations(Class<? extends Annotation>... annotationTypes)
annotationTypes - the annotations we are looking fordefault boolean hasAnyAnnotations(Collection<Class<? extends Annotation>> annotationTypes)
annotationTypes - the annotations we are looking forCopyright © 2016–2018 Testify Project. All rights reserved.