Class AnnotationContainer
java.lang.Object
io.spring.initializr.generator.language.AnnotationContainer
A container for annotations defined on an annotated element.
- Author:
- Stephane Nicoll
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidAdd a singleAnnotationwith the specified class name.voidadd(ClassName className, Consumer<Annotation.Builder> annotation) Add a singleAnnotationwith the specified class name andConsumerto customize it.deepCopy()booleanSpecify if this container has a an annotation with the specifiedClassName.booleanisEmpty()Specify if this container is empty.booleanRemove the annotation with the specifiedClassName.values()Return theannotations.
-
Constructor Details
-
AnnotationContainer
public AnnotationContainer()
-
-
Method Details
-
isEmpty
public boolean isEmpty()Specify if this container is empty.- Returns:
trueif no annotation is registered
-
has
Specify if this container has a an annotation with the specifiedClassName.- Parameters:
className- the class name of an annotation- Returns:
trueif the annotation with the specified class name exists
-
values
Return theannotations.- Returns:
- the annotations
-
add
Add a singleAnnotationwith the specified class name andConsumerto customize it. If the annotation has already been added, the consumer can be used to further tune attributes- Parameters:
className- the class name of an annotationannotation- aConsumerto customize theAnnotation
-
add
Add a singleAnnotationwith the specified class name. Does nothing If the annotation has already been added.- Parameters:
className- the class name of an annotation
-
remove
Remove the annotation with the specifiedClassName.- Parameters:
className- the class name of the annotation- Returns:
trueif such an annotation exists,falseotherwise
-
deepCopy
-