Class JavaAnnotationBuilder<AnnotationType extends JavaAnnotation>
java.lang.Object
com.github.tadukoo.java.annotation.JavaAnnotationBuilder<AnnotationType>
- Direct Known Subclasses:
EditableJavaAnnotation.EditableJavaAnnotationBuilder,UneditableJavaAnnotation.UneditableJavaAnnotationBuilder
Java Annotation Builder is used to build a new
JavaAnnotation. It contains the following parameters:
| Parameter | Description | Default or Required |
|---|---|---|
| name | The name of the annotation | Required |
- Since:
- Alpha v.0.3 (within JavaAnnotation), Alpha v.0.4 (on its own)
- Version:
- Beta v.0.5
- Author:
- Logan Ferree (Tadukoo)
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()Checks for any errors in the current parameters, then builds a newJavaAnnotationcanonicalName(String canonicalName) protected abstract AnnotationTypeConstructs a newJavaAnnotationwith the given parameterscopy(JavaAnnotation annotation) Copies the settings on the givenannotationinto the builderparameters(List<com.github.tadukoo.util.tuple.Pair<String, String>> parameters)
-
Field Details
-
name
The name of the annotation -
canonicalName
The canonical name of the annotation -
parameters
The parameters of the annotation (as Pairs of name and value)
-
-
Constructor Details
-
JavaAnnotationBuilder
protected JavaAnnotationBuilder()Constructs a newJavaAnnotationBuilder
-
-
Method Details
-
copy
Copies the settings on the givenannotationinto the builder- Parameters:
annotation- Theannotationto copy settings from- Returns:
- this, to continue building
-
name
- Parameters:
name- The name of the annotation- Returns:
- this, to continue building
-
canonicalName
- Parameters:
canonicalName- The canonical name of the annotation- Returns:
- this, to continue building
-
parameter
- Parameters:
name- The name of the parameter to be addedvalue- The value of the parameter to be added- Returns:
- this, to continue building
-
parameter
public JavaAnnotationBuilder<AnnotationType> parameter(com.github.tadukoo.util.tuple.Pair<String, String> parameter) - Parameters:
parameter- The parameter to be added (as a Pair of name and value)- Returns:
- this, to continue building
-
parameters
public JavaAnnotationBuilder<AnnotationType> parameters(List<com.github.tadukoo.util.tuple.Pair<String, String>> parameters) - Parameters:
parameters- The parameters of the annotation (as Pairs of name and value)- Returns:
- this, to continue building
-
build
Checks for any errors in the current parameters, then builds a newJavaAnnotation- Returns:
- A newly built
JavaAnnotation - Throws:
IllegalArgumentException- if anything is wrong with the current parameters
-
constructAnnotation
Constructs a newJavaAnnotationwith the given parameters- Returns:
- The newly constructed
JavaAnnotation
-