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.Optional;
19
20 public class Field extends JavaElement {
21 private FullyQualifiedJavaType type;
22 private String name;
23 private String initializationString;
24 private boolean isTransient;
25 private boolean isVolatile;
26 private boolean isFinal;
27
28 public Field(String name, FullyQualifiedJavaType type) {
29 this.name = name;
30 this.type = type;
31 }
32
33 public Field(Field field) {
34 super(field);
35 this.type = field.type;
36 this.name = field.name;
37 this.initializationString = field.initializationString;
38 this.isTransient = field.isTransient;
39 this.isVolatile = field.isVolatile;
40 this.isFinal = field.isFinal;
41 }
42
43 public String getName() {
44 return name;
45 }
46
47 public void setName(String name) {
48 this.name = name;
49 }
50
51 public FullyQualifiedJavaType getType() {
52 return type;
53 }
54
55 public void setType(FullyQualifiedJavaType type) {
56 this.type = type;
57 }
58
59 public Optional<String> getInitializationString() {
60 return Optional.ofNullable(initializationString);
61 }
62
63 public void setInitializationString(String initializationString) {
64 this.initializationString = initializationString;
65 }
66
67 public boolean isTransient() {
68 return isTransient;
69 }
70
71 public void setTransient(boolean isTransient) {
72 this.isTransient = isTransient;
73 }
74
75 public boolean isVolatile() {
76 return isVolatile;
77 }
78
79 public void setVolatile(boolean isVolatile) {
80 this.isVolatile = isVolatile;
81 }
82
83 public boolean isFinal() {
84 return isFinal;
85 }
86
87 public void setFinal(boolean isFinal) {
88 this.isFinal = isFinal;
89 }
90 }