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