1
2
3
4
5
6
7
8 package org.astrogrid.registry.beans.resource.votable;
9
10
11
12
13
14 import java.io.IOException;
15 import java.io.Reader;
16 import java.io.Serializable;
17 import java.io.Writer;
18 import org.astrogrid.registry.beans.resource.votable.types.Yesno;
19 import org.exolab.castor.xml.MarshalException;
20 import org.exolab.castor.xml.Marshaller;
21 import org.exolab.castor.xml.Unmarshaller;
22 import org.exolab.castor.xml.ValidationException;
23 import org.xml.sax.ContentHandler;
24
25 /***
26 * Class MIN.
27 *
28 * @version $Revision: 1.14 $ $Date: 2007/01/04 16:26:13 $
29 */
30 public class MIN extends org.astrogrid.common.bean.BaseBean
31 implements java.io.Serializable
32 {
33
34
35
36
37
38
39 /***
40 * internal content storage
41 */
42 private java.lang.String _content = "";
43
44 /***
45 * Field _value
46 */
47 private java.lang.String _value;
48
49 /***
50 * Field _inclusive
51 */
52 private org.astrogrid.registry.beans.resource.votable.types.Yesno _inclusive = org.astrogrid.registry.beans.resource.votable.types.Yesno.valueOf("yes");
53
54
55
56
57
58
59 public MIN() {
60 super();
61 setContent("");
62 setInclusive(org.astrogrid.registry.beans.resource.votable.types.Yesno.valueOf("yes"));
63 }
64
65
66
67
68
69
70 /***
71 * Note: hashCode() has not been overriden
72 *
73 * @param obj
74 */
75 public boolean equals(java.lang.Object obj)
76 {
77 if ( this == obj )
78 return true;
79
80 if (super.equals(obj)==false)
81 return false;
82
83 if (obj instanceof MIN) {
84
85 MIN temp = (MIN)obj;
86 if (this._content != null) {
87 if (temp._content == null) return false;
88 else if (!(this._content.equals(temp._content)))
89 return false;
90 }
91 else if (temp._content != null)
92 return false;
93 if (this._value != null) {
94 if (temp._value == null) return false;
95 else if (!(this._value.equals(temp._value)))
96 return false;
97 }
98 else if (temp._value != null)
99 return false;
100 if (this._inclusive != null) {
101 if (temp._inclusive == null) return false;
102 else if (!(this._inclusive.equals(temp._inclusive)))
103 return false;
104 }
105 else if (temp._inclusive != null)
106 return false;
107 return true;
108 }
109 return false;
110 }
111
112 /***
113 * Returns the value of field 'content'. The field 'content'
114 * has the following description: internal content storage
115 *
116 * @return the value of field 'content'.
117 */
118 public java.lang.String getContent()
119 {
120 return this._content;
121 }
122
123 /***
124 * Returns the value of field 'inclusive'.
125 *
126 * @return the value of field 'inclusive'.
127 */
128 public org.astrogrid.registry.beans.resource.votable.types.Yesno getInclusive()
129 {
130 return this._inclusive;
131 }
132
133 /***
134 * Returns the value of field 'value'.
135 *
136 * @return the value of field 'value'.
137 */
138 public java.lang.String getValue()
139 {
140 return this._value;
141 }
142
143 /***
144 * Method isValid
145 */
146 public boolean isValid()
147 {
148 try {
149 validate();
150 }
151 catch (org.exolab.castor.xml.ValidationException vex) {
152 return false;
153 }
154 return true;
155 }
156
157 /***
158 * Method marshal
159 *
160 * @param out
161 */
162 public void marshal(java.io.Writer out)
163 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
164 {
165
166 Marshaller.marshal(this, out);
167 }
168
169 /***
170 * Method marshal
171 *
172 * @param handler
173 */
174 public void marshal(org.xml.sax.ContentHandler handler)
175 throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
176 {
177
178 Marshaller.marshal(this, handler);
179 }
180
181 /***
182 * Sets the value of field 'content'. The field 'content' has
183 * the following description: internal content storage
184 *
185 * @param content the value of field 'content'.
186 */
187 public void setContent(java.lang.String content)
188 {
189 this._content = content;
190 }
191
192 /***
193 * Sets the value of field 'inclusive'.
194 *
195 * @param inclusive the value of field 'inclusive'.
196 */
197 public void setInclusive(org.astrogrid.registry.beans.resource.votable.types.Yesno inclusive)
198 {
199 this._inclusive = inclusive;
200 }
201
202 /***
203 * Sets the value of field 'value'.
204 *
205 * @param value the value of field 'value'.
206 */
207 public void setValue(java.lang.String value)
208 {
209 this._value = value;
210 }
211
212 /***
213 * Method unmarshalMIN
214 *
215 * @param reader
216 */
217 public static org.astrogrid.registry.beans.resource.votable.MIN unmarshalMIN(java.io.Reader reader)
218 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
219 {
220 return (org.astrogrid.registry.beans.resource.votable.MIN) Unmarshaller.unmarshal(org.astrogrid.registry.beans.resource.votable.MIN.class, reader);
221 }
222
223 /***
224 * Method validate
225 */
226 public void validate()
227 throws org.exolab.castor.xml.ValidationException
228 {
229 org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
230 validator.validate(this);
231 }
232
233 }