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 TypeMethodDescriptionvoid
Add a singleAnnotation
with the specified class name.void
add
(ClassName className, Consumer<Annotation.Builder> annotation) Add a singleAnnotation
with the specified class name andConsumer
to customize it.deepCopy()
boolean
Specify if this container has a an annotation with the specifiedClassName
.boolean
isEmpty()
Specify if this container is empty.boolean
Remove 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:
true
if 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:
true
if the annotation with the specified class name exists
-
values
Return theannotations
.- Returns:
- the annotations
-
add
Add a singleAnnotation
with the specified class name andConsumer
to 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
- aConsumer
to customize theAnnotation
-
add
Add a singleAnnotation
with 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:
true
if such an annotation exists,false
otherwise
-
deepCopy
-