KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > tigris > scarab > util > xmlissues > XmlActivity


1 package org.tigris.scarab.util.xmlissues;
2
3 /* ================================================================
4  * Copyright (c) 2000-2002 CollabNet. All rights reserved.
5  *
6  * Redistribution and use in source and binary forms, with or without
7  * modification, are permitted provided that the following conditions are
8  * met:
9  *
10  * 1. Redistributions of source code must retain the above copyright
11  * notice, this list of conditions and the following disclaimer.
12  *
13  * 2. Redistributions in binary form must reproduce the above copyright
14  * notice, this list of conditions and the following disclaimer in the
15  * documentation and/or other materials provided with the distribution.
16  *
17  * 3. The end-user documentation included with the redistribution, if
18  * any, must include the following acknowlegement: "This product includes
19  * software developed by Collab.Net <http://www.Collab.Net/>."
20  * Alternately, this acknowlegement may appear in the software itself, if
21  * and wherever such third-party acknowlegements normally appear.
22  *
23  * 4. The hosted project names must not be used to endorse or promote
24  * products derived from this software without prior written
25  * permission. For written permission, please contact info@collab.net.
26  *
27  * 5. Products derived from this software may not use the "Tigris" or
28  * "Scarab" names nor may "Tigris" or "Scarab" appear in their names without
29  * prior written permission of Collab.Net.
30  *
31  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
32  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
33  * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
34  * IN NO EVENT SHALL COLLAB.NET OR ITS CONTRIBUTORS BE LIABLE FOR ANY
35  * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
36  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
37  * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
38  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
39  * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
40  * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
41  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
42  *
43  * ====================================================================
44  *
45  * This software consists of voluntary contributions made by many
46  * individuals on behalf of Collab.Net.
47  */

48
49 public class XmlActivity implements java.io.Serializable JavaDoc
50 {
51     private String JavaDoc id = null;
52     private String JavaDoc attribute = null;
53     private String JavaDoc oldNumericValue = null;
54     private String JavaDoc newNumericValue = null;
55     private String JavaDoc oldUser = null;
56     private String JavaDoc newUser = null;
57     private String JavaDoc oldOption = null;
58     private String JavaDoc newOption = null;
59     private String JavaDoc oldValue = null;
60     private String JavaDoc newValue = null;
61     private Dependency dependency = null;
62     private String JavaDoc description = null;
63     private EndDate endDate = null;
64     private XmlAttachment attachment = null;
65
66     private boolean isNewActivity = true;
67     
68     public XmlActivity()
69     {
70     }
71
72     public boolean isNewActivity()
73     {
74         return isNewActivity;
75     }
76
77     public boolean isRemoveUserActivity()
78     {
79         return (getNewUser() == null && getOldUser() != null);
80     }
81
82     public boolean isAddDependency()
83     {
84         return (getDependency() != null &&
85                 getOldValue() == null &&
86                 getNewValue() != null);
87     }
88
89     public boolean isDeleteDependency()
90     {
91         return (getDependency() != null &&
92                 getOldValue() != null &&
93                 getNewValue() == null);
94     }
95
96     public boolean isUpdateDependency()
97     {
98         return (getDependency() != null &&
99                 getOldValue() != null &&
100                 getNewValue() != null);
101     }
102
103     public String JavaDoc getId()
104     {
105         return id;
106     }
107
108     public void setId(String JavaDoc id)
109     {
110         this.id = id;
111     }
112
113     public void setAttribute(String JavaDoc attribute)
114     {
115         this.attribute = attribute;
116     }
117
118     public String JavaDoc getAttribute()
119     {
120         return this.attribute;
121     }
122
123     public void setOldNumericValue(String JavaDoc oldNumericValue)
124     {
125         this.oldNumericValue = oldNumericValue;
126         isNewActivity = false;
127     }
128
129     public String JavaDoc getOldNumericValue()
130     {
131         return this.oldNumericValue;
132     }
133
134     public void setNewNumericValue(String JavaDoc newNumericValue)
135     {
136         this.newNumericValue = newNumericValue;
137     }
138
139     public String JavaDoc getNewNumericValue()
140     {
141         return this.newNumericValue;
142     }
143
144     public void setOldUser(String JavaDoc oldUser)
145     {
146         this.oldUser = oldUser;
147         isNewActivity = false;
148     }
149
150     public String JavaDoc getOldUser()
151     {
152         return this.oldUser;
153     }
154
155     public void setNewUser(String JavaDoc newUser)
156     {
157         this.newUser = newUser;
158     }
159
160     public String JavaDoc getNewUser()
161     {
162         return this.newUser;
163     }
164
165     public void setOldOption(String JavaDoc oldOption)
166     {
167         this.oldOption = oldOption;
168         isNewActivity = false;
169     }
170
171     public String JavaDoc getOldOption()
172     {
173         return this.oldOption;
174     }
175
176     public void setNewOption(String JavaDoc newOption)
177     {
178         this.newOption = newOption;
179     }
180
181     public String JavaDoc getNewOption()
182     {
183         return this.newOption;
184     }
185
186     public void setOldValue(String JavaDoc oldValue)
187     {
188         this.oldValue = oldValue;
189         isNewActivity = false;
190     }
191
192     public String JavaDoc getOldValue()
193     {
194         return this.oldValue;
195     }
196
197     public void setNewValue(String JavaDoc newValue)
198     {
199         this.newValue = newValue;
200     }
201
202     public String JavaDoc getNewValue()
203     {
204         return this.newValue;
205     }
206
207     public Dependency getDependency()
208     {
209         return dependency;
210     }
211     
212     public void setDependency(Dependency name)
213     {
214         this.dependency = name;
215         isNewActivity = true;
216     }
217
218     public void setDescription(String JavaDoc description)
219     {
220         this.description = description;
221     }
222
223     public String JavaDoc getDescription()
224     {
225         return this.description;
226     }
227
228     public EndDate getEndDate()
229     {
230         return endDate;
231     }
232     
233     public void setEndDate(EndDate endDate)
234     {
235         this.endDate = endDate;
236     }
237
238     public void setAttachment(XmlAttachment attachment)
239     {
240         this.attachment = attachment;
241     }
242
243     public XmlAttachment getAttachment()
244     {
245         return this.attachment;
246     }
247     
248     public String JavaDoc toString()
249     {
250         return ("Activity Id: " + id);
251     }
252 }
253
Popular Tags