View Javadoc
1   package at.rseiler.spbee.core.pojo;
2   
3   import java.io.Serializable;
4   import java.util.ArrayList;
5   import java.util.List;
6   
7   /**
8    * Holds the information of an annotation.
9    *
10   * @author Reinhard Seiler {@literal <rseiler.developer@gmail.com>}
11   */
12  public class AnnotationInfo implements Serializable {
13  
14      private static final long serialVersionUID = 573649572871493759L;
15  
16      private final String annotationType;
17      private final List<AnnotationValueInfo> annotationValueInfos = new ArrayList<>();
18  
19      /**
20       * Constructs a new AnnotationInfo.
21       *
22       * @param annotationType the type of the annotation
23       */
24      public AnnotationInfo(String annotationType) {
25          this.annotationType = annotationType;
26      }
27  
28      /**
29       * Adds a parameter to the annotation.
30       *
31       * @param annotationValueInfo the parameter
32       * @return itself
33       */
34      public AnnotationInfo addAnnotationValueInfo(AnnotationValueInfo annotationValueInfo) {
35          annotationValueInfos.add(annotationValueInfo);
36          return this;
37      }
38  
39      /**
40       * Returns the type of the annotation.
41       *
42       * @return the type
43       */
44      public String getAnnotationType() {
45          return annotationType;
46      }
47  
48      /**
49       * Returns the parameters of the annotation.
50       *
51       * @return the parameters
52       */
53      public List<AnnotationValueInfo> getAnnotationValueInfos() {
54          return annotationValueInfos;
55      }
56  
57      @Override
58      public String toString() {
59          return "AnnotationInfo{" +
60                  "annotationType='" + annotationType + '\'' +
61                  ", annotationValueInfos=" + annotationValueInfos +
62                  '}';
63      }
64  
65  }