Package oracle.dbtools.plugin.api.types
Class AnnotationSet
java.lang.Object
oracle.dbtools.plugin.api.types.AnnotationSet
- All Implemented Interfaces:
Iterable<Annotation>
Immutable set of
Annotation instances- Since:
- 19.3.0
- Author:
- cdivilly
-
Method Summary
Modifier and TypeMethodDescriptionelement()The element which is annotated with theseAnnotationsbooleanstatic AnnotationSetfrom(AnnotatedElement element) Generate the set of annotations that this element is annotated with<T extends Annotation>
TgetAnnotation(Class<T> annotationClass) Returns this element's annotation for the specified type if such an annotation is present, else null.inthashCode()booleanisAnnotationPresent(Class<? extends Annotation> annotationClass) Returns true if an annotation for the specified type is present on this element, else false.booleanisEmpty()Indicates if this annotation set is emptyiterator()Gives the subset of Annotations that representQualifierannotationsscope()Indicates theScopeannotation if any is presentintsize()Indicates the number of annotations presenttoString()Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.lang.Iterable
forEach, spliterator
-
Method Details
-
element
The element which is annotated with theseAnnotations- Returns:
AnnotatedElementinstance
-
isAnnotationPresent
Returns true if an annotation for the specified type is present on this element, else false. This method is designed primarily for convenient access to marker annotations.The truth value returned by this method is equivalent to:
getAnnotation(annotationClass) != nullThe body of the default method is specified to be the code above.
- Parameters:
annotationClass- the Class object corresponding to the annotation type- Returns:
- true if an annotation for the specified annotation type is present on this element, else false
- Throws:
NullPointerException- if the given annotation class is null
-
getAnnotation
Returns this element's annotation for the specified type if such an annotation is present, else null.- Type Parameters:
T- the type of the annotation to query for and return if present- Parameters:
annotationClass- the Class object corresponding to the annotation type- Returns:
- this element's annotation for the specified annotation type if present on this element, else null
- Throws:
NullPointerException- if the given annotation class is null
-
equals
-
hashCode
public int hashCode() -
isEmpty
public boolean isEmpty()Indicates if this annotation set is empty- Returns:
- true if the set is empty, false otherwise
-
iterator
- Specified by:
iteratorin interfaceIterable<Annotation>
-
qualifiers
Gives the subset of Annotations that representQualifierannotations -
scope
Indicates theScopeannotation if any is present- Returns:
- Annotation annotated with
Scopeor null if no such annotation is present
-
size
public int size()Indicates the number of annotations present- Returns:
- The number of annotations in this set
-
toString
-
from
Generate the set of annotations that this element is annotated with- Parameters:
element- The element to examine- Returns:
AnnotationSetfor the element
-