1
2
3
4
5
6
7
8
9 package org.openprovenance.model;
10
11 import java.util.ArrayList;
12 import java.util.List;
13 import javax.xml.bind.JAXBElement;
14 import javax.xml.bind.annotation.XmlAccessType;
15 import javax.xml.bind.annotation.XmlAccessorType;
16 import javax.xml.bind.annotation.XmlAttribute;
17 import javax.xml.bind.annotation.XmlElement;
18 import javax.xml.bind.annotation.XmlElementRef;
19 import javax.xml.bind.annotation.XmlID;
20 import javax.xml.bind.annotation.XmlSchemaType;
21 import javax.xml.bind.annotation.XmlType;
22 import javax.xml.bind.annotation.adapters.CollapsedStringAdapter;
23 import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
24 import org.apache.commons.lang.builder.EqualsBuilder;
25 import org.apache.commons.lang.builder.HashCodeBuilder;
26 import org.apache.commons.lang.builder.ToStringBuilder;
27 import org.jvnet.jaxb2_commons.lang.Equals;
28 import org.jvnet.jaxb2_commons.lang.HashCode;
29 import org.jvnet.jaxb2_commons.lang.ToString;
30 import org.jvnet.jaxb2_commons.lang.builder.JAXBEqualsBuilder;
31 import org.jvnet.jaxb2_commons.lang.builder.JAXBHashCodeBuilder;
32 import org.jvnet.jaxb2_commons.lang.builder.JAXBToStringBuilder;
33
34
35 /***
36 * <p>Java class for Used complex type.
37 *
38 * <p>The following schema fragment specifies the expected content contained within this class.
39 *
40 * <pre>
41 * <complexType name="Used">
42 * <complexContent>
43 * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
44 * <sequence>
45 * <element name="effect" type="{http://openprovenance.org/model/v1.1.a}ProcessRef"/>
46 * <element name="role" type="{http://openprovenance.org/model/v1.1.a}Role"/>
47 * <element name="cause" type="{http://openprovenance.org/model/v1.1.a}ArtifactRef"/>
48 * <element name="account" type="{http://openprovenance.org/model/v1.1.a}AccountRef" maxOccurs="unbounded" minOccurs="0"/>
49 * <element name="time" type="{http://openprovenance.org/model/v1.1.a}OTime" minOccurs="0"/>
50 * <element ref="{http://openprovenance.org/model/v1.1.a}annotation" maxOccurs="unbounded" minOccurs="0"/>
51 * </sequence>
52 * <attribute name="id" type="{http://www.w3.org/2001/XMLSchema}ID" />
53 * </restriction>
54 * </complexContent>
55 * </complexType>
56 * </pre>
57 *
58 *
59 */
60 @XmlAccessorType(XmlAccessType.FIELD)
61 @XmlType(name = "Used", namespace = "http://openprovenance.org/model/v1.1.a", propOrder = {
62 "effect",
63 "role",
64 "cause",
65 "account",
66 "time",
67 "annotation"
68 })
69 public class Used implements Edge, Equals, HashCode, ToString
70 {
71
72 @XmlElement(namespace = "http://openprovenance.org/model/v1.1.a", required = true)
73 protected ProcessRef effect;
74 @XmlElement(namespace = "http://openprovenance.org/model/v1.1.a", required = true)
75 protected Role role;
76 @XmlElement(namespace = "http://openprovenance.org/model/v1.1.a", required = true)
77 protected ArtifactRef cause;
78 @XmlElement(namespace = "http://openprovenance.org/model/v1.1.a")
79 protected List<AccountRef> account;
80 @XmlElement(namespace = "http://openprovenance.org/model/v1.1.a")
81 protected OTime time;
82 @XmlElementRef(name = "annotation", namespace = "http://openprovenance.org/model/v1.1.a", type = JAXBElement.class)
83 protected List<JAXBElement<? extends EmbeddedAnnotation>> annotation;
84 @XmlAttribute
85 @XmlJavaTypeAdapter(CollapsedStringAdapter.class)
86 @XmlID
87 @XmlSchemaType(name = "ID")
88 protected String id;
89
90 /***
91 * Gets the value of the effect property.
92 *
93 * @return
94 * possible object is
95 * {@link ProcessRef }
96 *
97 */
98 public ProcessRef getEffect() {
99 return effect;
100 }
101
102 /***
103 * Sets the value of the effect property.
104 *
105 * @param value
106 * allowed object is
107 * {@link ProcessRef }
108 *
109 */
110 public void setEffect(ProcessRef value) {
111 this.effect = value;
112 }
113
114 /***
115 * Gets the value of the role property.
116 *
117 * @return
118 * possible object is
119 * {@link Role }
120 *
121 */
122 public Role getRole() {
123 return role;
124 }
125
126 /***
127 * Sets the value of the role property.
128 *
129 * @param value
130 * allowed object is
131 * {@link Role }
132 *
133 */
134 public void setRole(Role value) {
135 this.role = value;
136 }
137
138 /***
139 * Gets the value of the cause property.
140 *
141 * @return
142 * possible object is
143 * {@link ArtifactRef }
144 *
145 */
146 public ArtifactRef getCause() {
147 return cause;
148 }
149
150 /***
151 * Sets the value of the cause property.
152 *
153 * @param value
154 * allowed object is
155 * {@link ArtifactRef }
156 *
157 */
158 public void setCause(ArtifactRef value) {
159 this.cause = value;
160 }
161
162 /***
163 * Gets the value of the account property.
164 *
165 * <p>
166 * This accessor method returns a reference to the live list,
167 * not a snapshot. Therefore any modification you make to the
168 * returned list will be present inside the JAXB object.
169 * This is why there is not a <CODE>set</CODE> method for the account property.
170 *
171 * <p>
172 * For example, to add a new item, do as follows:
173 * <pre>
174 * getAccount().add(newItem);
175 * </pre>
176 *
177 *
178 * <p>
179 * Objects of the following type(s) are allowed in the list
180 * {@link AccountRef }
181 *
182 *
183 */
184 public List<AccountRef> getAccount() {
185 if (account == null) {
186 account = new ArrayList<AccountRef>();
187 }
188 return this.account;
189 }
190
191 /***
192 * Gets the value of the time property.
193 *
194 * @return
195 * possible object is
196 * {@link OTime }
197 *
198 */
199 public OTime getTime() {
200 return time;
201 }
202
203 /***
204 * Sets the value of the time property.
205 *
206 * @param value
207 * allowed object is
208 * {@link OTime }
209 *
210 */
211 public void setTime(OTime value) {
212 this.time = value;
213 }
214
215 /***
216 * Gets the value of the annotation property.
217 *
218 * <p>
219 * This accessor method returns a reference to the live list,
220 * not a snapshot. Therefore any modification you make to the
221 * returned list will be present inside the JAXB object.
222 * This is why there is not a <CODE>set</CODE> method for the annotation property.
223 *
224 * <p>
225 * For example, to add a new item, do as follows:
226 * <pre>
227 * getAnnotation().add(newItem);
228 * </pre>
229 *
230 *
231 * <p>
232 * Objects of the following type(s) are allowed in the list
233 * {@link JAXBElement }{@code <}{@link Type }{@code >}
234 * {@link JAXBElement }{@code <}{@link Label }{@code >}
235 * {@link JAXBElement }{@code <}{@link PName }{@code >}
236 * {@link JAXBElement }{@code <}{@link Profile }{@code >}
237 * {@link JAXBElement }{@code <}{@link EmbeddedAnnotation }{@code >}
238 * {@link JAXBElement }{@code <}{@link Value }{@code >}
239 *
240 *
241 */
242 public List<JAXBElement<? extends EmbeddedAnnotation>> getAnnotation() {
243 if (annotation == null) {
244 annotation = new ArrayList<JAXBElement<? extends EmbeddedAnnotation>>();
245 }
246 return this.annotation;
247 }
248
249 /***
250 * Gets the value of the id property.
251 *
252 * @return
253 * possible object is
254 * {@link String }
255 *
256 */
257 public String getId() {
258 return id;
259 }
260
261 /***
262 * Sets the value of the id property.
263 *
264 * @param value
265 * allowed object is
266 * {@link String }
267 *
268 */
269 public void setId(String value) {
270 this.id = value;
271 }
272
273 public void equals(Object object, EqualsBuilder equalsBuilder) {
274 if (!(object instanceof Used)) {
275 equalsBuilder.appendSuper(false);
276 return ;
277 }
278 if (this == object) {
279 return ;
280 }
281 final Used that = ((Used) object);
282 equalsBuilder.append(this.getEffect(), that.getEffect());
283 equalsBuilder.append(this.getRole(), that.getRole());
284 equalsBuilder.append(this.getCause(), that.getCause());
285 equalsBuilder.append(this.getAccount(), that.getAccount());
286 equalsBuilder.append(this.getTime(), that.getTime());
287 equalsBuilder.append(this.getAnnotation(), that.getAnnotation());
288 equalsBuilder.append(this.getId(), that.getId());
289 }
290
291 public boolean equals(Object object) {
292 if (!(object instanceof Used)) {
293 return false;
294 }
295 if (this == object) {
296 return true;
297 }
298 final EqualsBuilder equalsBuilder = new JAXBEqualsBuilder();
299 equals(object, equalsBuilder);
300 return equalsBuilder.isEquals();
301 }
302
303 public void hashCode(HashCodeBuilder hashCodeBuilder) {
304 hashCodeBuilder.append(this.getEffect());
305 hashCodeBuilder.append(this.getRole());
306 hashCodeBuilder.append(this.getCause());
307 hashCodeBuilder.append(this.getAccount());
308 hashCodeBuilder.append(this.getTime());
309 hashCodeBuilder.append(this.getAnnotation());
310 hashCodeBuilder.append(this.getId());
311 }
312
313 public int hashCode() {
314 final HashCodeBuilder hashCodeBuilder = new JAXBHashCodeBuilder();
315 hashCode(hashCodeBuilder);
316 return hashCodeBuilder.toHashCode();
317 }
318
319 public void toString(ToStringBuilder toStringBuilder) {
320 {
321 ProcessRef theEffect;
322 theEffect = this.getEffect();
323 toStringBuilder.append("effect", theEffect);
324 }
325 {
326 Role theRole;
327 theRole = this.getRole();
328 toStringBuilder.append("role", theRole);
329 }
330 {
331 ArtifactRef theCause;
332 theCause = this.getCause();
333 toStringBuilder.append("cause", theCause);
334 }
335 {
336 List<AccountRef> theAccount;
337 theAccount = this.getAccount();
338 toStringBuilder.append("account", theAccount);
339 }
340 {
341 OTime theTime;
342 theTime = this.getTime();
343 toStringBuilder.append("time", theTime);
344 }
345 {
346 List<JAXBElement<? extends EmbeddedAnnotation>> theAnnotation;
347 theAnnotation = this.getAnnotation();
348 toStringBuilder.append("annotation", theAnnotation);
349 }
350 {
351 String theId;
352 theId = this.getId();
353 toStringBuilder.append("id", theId);
354 }
355 }
356
357 public String toString() {
358 final ToStringBuilder toStringBuilder = new JAXBToStringBuilder(this);
359 toString(toStringBuilder);
360 return toStringBuilder.toString();
361 }
362
363 }