132fc46ffca4dbe763669c4a5c8f22208ab72af6
[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.5 2003/09/05 20:23:59 idfx Exp $
48  */
49 public class Media implements Serializable, IMedia {
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 java.util.Date getWebdbCreate() {
270         return this.webdbCreate;
271     }
272
273     public void setWebdbCreate(java.util.Date webdbCreate) {
274         this.webdbCreate = webdbCreate;
275     }
276
277     public java.util.Date getWebdbLastchange() {
278         return this.webdbLastchange;
279     }
280
281     public void setWebdbLastchange(java.util.Date webdbLastchange) {
282         this.webdbLastchange = webdbLastchange;
283     }
284
285     public mir.core.model.Feature getFeature() {
286         return this.feature;
287     }
288
289     public void setFeature(mir.core.model.Feature feature) {
290         this.feature = feature;
291     }
292
293     public mir.core.model.MirUser getPublisher() {
294         return this.publisher;
295     }
296
297     public void setPublisher(mir.core.model.MirUser publisher) {
298         this.publisher = publisher;
299     }
300
301     public mir.core.model.Language getLanguage() {
302         return this.language;
303     }
304
305     public void setLanguage(mir.core.model.Language language) {
306         this.language = language;
307     }
308
309     public mir.core.model.Rights getRights() {
310         return this.rights;
311     }
312
313     public void setRights(mir.core.model.Rights rights) {
314         this.rights = rights;
315     }
316
317                 /**
318                  * @return
319                  */
320                 public Set getContent() {
321                         return content;
322                 }
323
324                 /**
325                  * @param content
326                  */
327                 public void setContent(Set content) {
328                         this.content = content;
329                 }
330
331                 /**
332                  * @return
333                  */
334                 public boolean isProduced() {
335                         return isProduced;
336                 }
337
338                 /**
339                  * @param isProduced
340                  */
341                 public void setProduced(boolean isProduced) {
342                         this.isProduced = isProduced;
343                 }
344
345                 /**
346                  * @return
347                  */
348                 public boolean isPublished() {
349                         return isPublished;
350                 }
351
352                 /**
353                  * @param isPublished
354                  */
355                 public void setPublished(boolean isPublished) {
356                         this.isPublished = isPublished;
357                 }
358
359     public String toString() {
360         return new ToStringBuilder(this)
361             .append("id", getId())
362             .toString();
363     }
364
365     public boolean equals(Object other) {
366         if ( !(other instanceof Media) ) return false;
367         Media castOther = (Media) other;
368         return new EqualsBuilder()
369             .append(this.getId(), castOther.getId())
370             .isEquals();
371     }
372
373     public int hashCode() {
374         return new HashCodeBuilder()
375             .append(getId())
376             .toHashCode();
377     }
378
379 }