3d7a76c211cbd0c8aaa0284fc52d1eb090d78afc
[mir.git] / source / mir / core / model / Media.java
1 /*
2  * Media.java
3  * 
4  * Copyright (C) 2001, 2002, 2003 The Mir-coders group
5  *
6  * This file is part of Mir.
7  *
8  * Mir is free software; you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License as published by
10  * the Free Software Foundation; either version 2 of the License, or
11  * (at your option) any later version.
12  *
13  * Mir is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with Mir; if not, write to the Free Software
20  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
21  *
22  * In addition, as a special exception, The Mir-coders gives permission to link
23  * the code of this program with  any library licensed under the Apache Software License,
24  * The Sun (tm) Java Advanced Imaging library (JAI), The Sun JIMI library
25  * (or with modified versions of the above that use the same license as the above),
26  * and distribute linked combinations including the two.  You must obey the
27  * GNU General Public License in all respects for all of the code used other than
28  * the above mentioned libraries.  If you modify this file, you may extend this
29  * exception to your version of the file, but you are not obligated to do so.
30  * If you do not wish to do so, delete this exception statement from your version.
31  */
32  
33 package mir.core.model;
34
35 import java.io.Serializable;
36 import java.util.Date;
37 import java.util.Set;
38
39 import org.apache.commons.lang.builder.EqualsBuilder;
40 import org.apache.commons.lang.builder.HashCodeBuilder;
41 import org.apache.commons.lang.builder.ToStringBuilder;
42
43 /**
44  * 
45  * Media
46  * @author idefix
47  * @version $Id: Media.java,v 1.3 2003/08/17 19:13:19 idfx Exp $
48  */
49 public class Media implements Serializable {
50
51     /** identifier field */
52     private Integer id;
53
54     /** persistent field */
55     private String title;
56
57     /** nullable persistent field */
58     private String subtitle;
59
60     /** nullable persistent field */
61     private String edittitle;
62
63     /** persistent field */
64     private String date;
65
66     /** nullable persistent field */
67     private String creator;
68
69     /** nullable persistent field */
70     private String creatorMainUrl;
71
72     /** nullable persistent field */
73     private String creatorEmail;
74
75     /** nullable persistent field */
76     private String creatorAddress;
77
78     /** nullable persistent field */
79     private String creatorPhone;
80
81     /** nullable persistent field */
82     private String description;
83
84     /** nullable persistent field */
85     private String keywords;
86
87     /** nullable persistent field */
88     private String comment;
89
90     /** nullable persistent field */
91     private String source;
92
93     /** nullable persistent field */
94     private Date publishDate;
95
96     /** nullable persistent field */
97     private String publishServer;
98
99     /** nullable persistent field */
100     private String publishPath;
101
102     /** persistent field */
103     private boolean isPublished;
104
105     /** persistent field */
106     private boolean isProduced;
107
108     /** persistent field */
109     private Date webdbCreate;
110
111     /** nullable persistent field */
112     private Date webdbLastchange;
113
114     /** nullable persistent field */
115     private mir.core.model.Feature feature;
116
117     /** nullable persistent field */
118     private MirUser publisher;
119
120     /** nullable persistent field */
121     private Language language;
122
123     /** nullable persistent field */
124     private Rights rights;
125     
126     private Set content;
127
128     /** default constructor */
129     public Media() {
130     
131     }
132
133     public java.lang.Integer getId() {
134         return this.id;
135     }
136
137     public void setId(java.lang.Integer id) {
138         this.id = id;
139     }
140
141     public java.lang.String getTitle() {
142         return this.title;
143     }
144
145     public void setTitle(java.lang.String title) {
146         this.title = title;
147     }
148
149     public java.lang.String getSubtitle() {
150         return this.subtitle;
151     }
152
153     public void setSubtitle(java.lang.String subtitle) {
154         this.subtitle = subtitle;
155     }
156
157     public java.lang.String getEdittitle() {
158         return this.edittitle;
159     }
160
161     public void setEdittitle(java.lang.String edittitle) {
162         this.edittitle = edittitle;
163     }
164
165     public java.lang.String getDate() {
166         return this.date;
167     }
168
169     public void setDate(java.lang.String date) {
170         this.date = date;
171     }
172
173     public java.lang.String getCreator() {
174         return this.creator;
175     }
176
177     public void setCreator(java.lang.String creator) {
178         this.creator = creator;
179     }
180
181     public java.lang.String getCreatorMainUrl() {
182         return this.creatorMainUrl;
183     }
184
185     public void setCreatorMainUrl(java.lang.String creatorMainUrl) {
186         this.creatorMainUrl = creatorMainUrl;
187     }
188
189     public java.lang.String getCreatorEmail() {
190         return this.creatorEmail;
191     }
192
193     public void setCreatorEmail(java.lang.String creatorEmail) {
194         this.creatorEmail = creatorEmail;
195     }
196
197     public java.lang.String getCreatorAddress() {
198         return this.creatorAddress;
199     }
200
201     public void setCreatorAddress(java.lang.String creatorAddress) {
202         this.creatorAddress = creatorAddress;
203     }
204
205     public java.lang.String getCreatorPhone() {
206         return this.creatorPhone;
207     }
208
209     public void setCreatorPhone(java.lang.String creatorPhone) {
210         this.creatorPhone = creatorPhone;
211     }
212
213     public java.lang.String getDescription() {
214         return this.description;
215     }
216
217     public void setDescription(java.lang.String description) {
218         this.description = description;
219     }
220
221     public java.lang.String getKeywords() {
222         return this.keywords;
223     }
224
225     public void setKeywords(java.lang.String keywords) {
226         this.keywords = keywords;
227     }
228
229     public java.lang.String getComment() {
230         return this.comment;
231     }
232
233     public void setComment(java.lang.String comment) {
234         this.comment = comment;
235     }
236
237     public java.lang.String getSource() {
238         return this.source;
239     }
240
241     public void setSource(java.lang.String source) {
242         this.source = source;
243     }
244
245     public java.util.Date getPublishDate() {
246         return this.publishDate;
247     }
248
249     public void setPublishDate(java.util.Date publishDate) {
250         this.publishDate = publishDate;
251     }
252
253     public java.lang.String getPublishServer() {
254         return this.publishServer;
255     }
256
257     public void setPublishServer(java.lang.String publishServer) {
258         this.publishServer = publishServer;
259     }
260
261     public java.lang.String getPublishPath() {
262         return this.publishPath;
263     }
264
265     public void setPublishPath(java.lang.String publishPath) {
266         this.publishPath = publishPath;
267     }
268
269     public boolean isIsPublished() {
270         return this.isPublished;
271     }
272
273     public void setIsPublished(boolean isPublished) {
274         this.isPublished = isPublished;
275     }
276
277     public boolean isIsProduced() {
278         return this.isProduced;
279     }
280
281     public void setIsProduced(boolean isProduced) {
282         this.isProduced = isProduced;
283     }
284
285     public java.util.Date getWebdbCreate() {
286         return this.webdbCreate;
287     }
288
289     public void setWebdbCreate(java.util.Date webdbCreate) {
290         this.webdbCreate = webdbCreate;
291     }
292
293     public java.util.Date getWebdbLastchange() {
294         return this.webdbLastchange;
295     }
296
297     public void setWebdbLastchange(java.util.Date webdbLastchange) {
298         this.webdbLastchange = webdbLastchange;
299     }
300
301     public mir.core.model.Feature getFeature() {
302         return this.feature;
303     }
304
305     public void setFeature(mir.core.model.Feature feature) {
306         this.feature = feature;
307     }
308
309     public mir.core.model.MirUser getPublisher() {
310         return this.publisher;
311     }
312
313     public void setPublisher(mir.core.model.MirUser publisher) {
314         this.publisher = publisher;
315     }
316
317     public mir.core.model.Language getLanguage() {
318         return this.language;
319     }
320
321     public void setLanguage(mir.core.model.Language language) {
322         this.language = language;
323     }
324
325     public mir.core.model.Rights getRights() {
326         return this.rights;
327     }
328
329     public void setRights(mir.core.model.Rights rights) {
330         this.rights = rights;
331     }
332
333                 /**
334                  * @return
335                  */
336                 public Set getContent() {
337                         return content;
338                 }
339
340                 /**
341                  * @param content
342                  */
343                 public void setContent(Set content) {
344                         this.content = content;
345                 }
346
347                 /**
348                  * @return
349                  */
350                 public boolean isProduced() {
351                         return isProduced;
352                 }
353
354                 /**
355                  * @param isProduced
356                  */
357                 public void setProduced(boolean isProduced) {
358                         this.isProduced = isProduced;
359                 }
360
361                 /**
362                  * @return
363                  */
364                 public boolean isPublished() {
365                         return isPublished;
366                 }
367
368                 /**
369                  * @param isPublished
370                  */
371                 public void setPublished(boolean isPublished) {
372                         this.isPublished = isPublished;
373                 }
374
375     public String toString() {
376         return new ToStringBuilder(this)
377             .append("id", getId())
378             .toString();
379     }
380
381     public boolean equals(Object other) {
382         if ( !(other instanceof Media) ) return false;
383         Media castOther = (Media) other;
384         return new EqualsBuilder()
385             .append(this.getId(), castOther.getId())
386             .isEquals();
387     }
388
389     public int hashCode() {
390         return new HashCodeBuilder()
391             .append(getId())
392             .toHashCode();
393     }
394
395 }