1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.mybatis.generator.api.dom.java;
17
18 import java.util.ArrayList;
19 import java.util.List;
20
21 public class Parameter {
22 private final String name;
23 private final FullyQualifiedJavaType type;
24 private final boolean isVarargs;
25
26 private final List<String> annotations = new ArrayList<>();
27
28 public Parameter(FullyQualifiedJavaType type, String name, boolean isVarargs) {
29 this.name = name;
30 this.type = type;
31 this.isVarargs = isVarargs;
32 }
33
34 public Parameter(FullyQualifiedJavaType type, String name) {
35 this(type, name, false);
36 }
37
38 public Parameter(FullyQualifiedJavaType type, String name, String annotation) {
39 this(type, name, false);
40 addAnnotation(annotation);
41 }
42
43 public Parameter(FullyQualifiedJavaType type, String name, String annotation, boolean isVarargs) {
44 this(type, name, isVarargs);
45 addAnnotation(annotation);
46 }
47
48 public String getName() {
49 return name;
50 }
51
52 public FullyQualifiedJavaType getType() {
53 return type;
54 }
55
56 public List<String> getAnnotations() {
57 return annotations;
58 }
59
60 public void addAnnotation(String annotation) {
61 annotations.add(annotation);
62 }
63
64 public boolean isVarargs() {
65 return isVarargs;
66 }
67 }