1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.rice.kew.api.document.node;
17
18 import java.io.Serializable;
19 import java.util.Collection;
20
21 import javax.xml.bind.annotation.XmlAccessType;
22 import javax.xml.bind.annotation.XmlAccessorType;
23 import javax.xml.bind.annotation.XmlAnyElement;
24 import javax.xml.bind.annotation.XmlElement;
25 import javax.xml.bind.annotation.XmlRootElement;
26 import javax.xml.bind.annotation.XmlType;
27
28 import org.kuali.rice.core.api.CoreConstants;
29 import org.kuali.rice.core.api.mo.AbstractDataTransferObject;
30 import org.kuali.rice.core.api.mo.ModelBuilder;
31 import org.w3c.dom.Element;
32
33 @XmlRootElement(name = RouteNodeInstanceState.Constants.ROOT_ELEMENT_NAME)
34 @XmlAccessorType(XmlAccessType.NONE)
35 @XmlType(name = RouteNodeInstanceState.Constants.TYPE_NAME, propOrder = {
36 RouteNodeInstanceState.Elements.VALUE,
37 RouteNodeInstanceState.Elements.KEY,
38 RouteNodeInstanceState.Elements.ID,
39 CoreConstants.CommonElements.FUTURE_ELEMENTS
40 })
41 public final class RouteNodeInstanceState extends AbstractDataTransferObject
42 implements RouteNodeInstanceStateContract
43 {
44
45 @XmlElement(name = Elements.ID, required = false)
46 private final String id;
47 @XmlElement(name = Elements.VALUE, required = false)
48 private final String value;
49 @XmlElement(name = Elements.KEY, required = false)
50 private final String key;
51 @SuppressWarnings("unused")
52 @XmlAnyElement
53 private final Collection<Element> _futureElements = null;
54
55
56
57
58
59 private RouteNodeInstanceState() {
60 this.id = null;
61 this.value = null;
62 this.key = null;
63 }
64
65 private RouteNodeInstanceState(Builder builder) {
66 this.id = builder.getId();
67 this.value = builder.getValue();
68 this.key = builder.getKey();
69 }
70
71 @Override
72 public String getId() {
73 return this.id;
74 }
75
76 @Override
77 public String getValue() {
78 return this.value;
79 }
80
81 @Override
82 public String getKey() {
83 return this.key;
84 }
85
86
87
88
89 public final static class Builder
90 implements Serializable, ModelBuilder, RouteNodeInstanceStateContract
91 {
92
93 private String id;
94 private String value;
95 private String key;
96
97 private Builder() {
98
99 }
100
101 public static Builder create() {
102
103 return new Builder();
104 }
105
106 public static Builder create(RouteNodeInstanceStateContract contract) {
107 if (contract == null) {
108 throw new IllegalArgumentException("contract was null");
109 }
110
111 Builder builder = create();
112 builder.setId(contract.getId());
113 builder.setValue(contract.getValue());
114 builder.setKey(contract.getKey());
115 return builder;
116 }
117
118 public RouteNodeInstanceState build() {
119 return new RouteNodeInstanceState(this);
120 }
121
122 @Override
123 public String getValue() {
124 return this.value;
125 }
126
127 @Override
128 public String getKey() {
129 return this.key;
130 }
131
132 @Override
133 public String getId() {
134 return this.id;
135 }
136
137 public void setValue(String value) {
138
139 this.value = value;
140 }
141
142 public void setKey(String key) {
143
144 this.key = key;
145 }
146
147 public void setId(String id) {
148
149 this.id = id;
150 }
151
152 }
153
154
155
156
157
158
159 static class Constants {
160
161 final static String ROOT_ELEMENT_NAME = "routeNodeInstanceState";
162 final static String TYPE_NAME = "RouteNodeInstanceStateType";
163
164 }
165
166
167
168
169
170
171 static class Elements {
172
173 final static String VALUE = "value";
174 final static String KEY = "key";
175 final static String ID = "id";
176
177 }
178
179 }
180