37711266a3230a184ead14018bb0654592ec0031
[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.7 2003/12/20 20:27:09 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 comment;
86
87     /** nullable persistent field */
88     private String source;
89
90     /** nullable persistent field */
91     private Date publishDate;
92
93     /** nullable persistent field */
94     private String publishServer;
95
96     /** nullable persistent field */
97     private String publishPath;
98
99     /** persistent field */
100     private boolean isPublished;
101
102     /** persistent field */
103     private boolean isProduced;
104
105     /** persistent field */
106     private Date webdbCreate;
107
108     /** nullable persistent field */
109     private Date webdbLastchange;
110
111     /** nullable persistent field */
112     private MirUser publisher;
113
114     /** nullable persistent field */
115     private Language language;
116
117     /** nullable persistent field */
118     private Rights rights;
119     
120     private Set content;
121
122     /** default constructor */
123     public Media() {
124     
125     }
126
127     public java.lang.Integer getId() {
128         return this.id;
129     }
130
131     public void setId(java.lang.Integer id) {
132         this.id = id;
133     }
134
135     public java.lang.String getTitle() {
136         return this.title;
137     }
138
139     public void setTitle(java.lang.String title) {
140         this.title = title;
141     }
142
143     public java.lang.String getSubtitle() {
144         return this.subtitle;
145     }
146
147     public void setSubtitle(java.lang.String subtitle) {
148         this.subtitle = subtitle;
149     }
150
151     public java.lang.String getEdittitle() {
152         return this.edittitle;
153     }
154
155     public void setEdittitle(java.lang.String edittitle) {
156         this.edittitle = edittitle;
157     }
158
159     public java.lang.String getDate() {
160         return this.date;
161     }
162
163     public void setDate(java.lang.String date) {
164         this.date = date;
165     }
166
167     public java.lang.String getCreator() {
168         return this.creator;
169     }
170
171     public void setCreator(java.lang.String creator) {
172         this.creator = creator;
173     }
174
175     public java.lang.String getCreatorMainUrl() {
176         return this.creatorMainUrl;
177     }
178
179     public void setCreatorMainUrl(java.lang.String creatorMainUrl) {
180         this.creatorMainUrl = creatorMainUrl;
181     }
182
183     public java.lang.String getCreatorEmail() {
184         return this.creatorEmail;
185     }
186
187     public void setCreatorEmail(java.lang.String creatorEmail) {
188         this.creatorEmail = creatorEmail;
189     }
190
191     public java.lang.String getCreatorAddress() {
192         return this.creatorAddress;
193     }
194
195     public void setCreatorAddress(java.lang.String creatorAddress) {
196         this.creatorAddress = creatorAddress;
197     }
198
199     public java.lang.String getCreatorPhone() {
200         return this.creatorPhone;
201     }
202
203     public void setCreatorPhone(java.lang.String creatorPhone) {
204         this.creatorPhone = creatorPhone;
205     }
206
207     public java.lang.String getDescription() {
208         return this.description;
209     }
210
211     public void setDescription(java.lang.String description) {
212         this.description = description;
213     }
214
215     public java.lang.String getComment() {
216         return this.comment;
217     }
218
219     public void setComment(java.lang.String comment) {
220         this.comment = comment;
221     }
222
223     public java.lang.String getSource() {
224         return this.source;
225     }
226
227     public void setSource(java.lang.String source) {
228         this.source = source;
229     }
230
231     public java.util.Date getPublishDate() {
232         return this.publishDate;
233     }
234
235     public void setPublishDate(java.util.Date publishDate) {
236         this.publishDate = publishDate;
237     }
238
239     public java.lang.String getPublishServer() {
240         return this.publishServer;
241     }
242
243     public void setPublishServer(java.lang.String publishServer) {
244         this.publishServer = publishServer;
245     }
246
247     public java.lang.String getPublishPath() {
248         return this.publishPath;
249     }
250
251     public void setPublishPath(java.lang.String publishPath) {
252         this.publishPath = publishPath;
253     }
254
255     public java.util.Date getWebdbCreate() {
256         return this.webdbCreate;
257     }
258
259     public void setWebdbCreate(java.util.Date webdbCreate) {
260         this.webdbCreate = webdbCreate;
261     }
262
263     public java.util.Date getWebdbLastchange() {
264         return this.webdbLastchange;
265     }
266
267     public void setWebdbLastchange(java.util.Date webdbLastchange) {
268         this.webdbLastchange = webdbLastchange;
269     }
270
271     public mir.core.model.MirUser getPublisher() {
272         return this.publisher;
273     }
274
275     public void setPublisher(mir.core.model.MirUser publisher) {
276         this.publisher = publisher;
277     }
278
279     public mir.core.model.Language getLanguage() {
280         return this.language;
281     }
282
283     public void setLanguage(Language language) {
284         this.language = language;
285     }
286
287     public mir.core.model.Rights getRights() {
288         return this.rights;
289     }
290
291     public void setRights(mir.core.model.Rights rights) {
292         this.rights = rights;
293     }
294
295                 /**
296                  * @return
297                  */
298                 public Set getContent() {
299                         return content;
300                 }
301
302                 /**
303                  * @param content
304                  */
305                 public void setContent(Set content) {
306                         this.content = content;
307                 }
308
309                 /**
310                  * @return
311                  */
312                 public boolean isProduced() {
313                         return isProduced;
314                 }
315
316                 /**
317                  * @return
318                  */
319                 public boolean getProduced() {
320                         return isProduced();
321                 }
322                 
323                 /**
324                  * @param isProduced
325                  */
326                 public void setProduced(boolean isProduced) {
327                         this.isProduced = isProduced;
328                 }
329
330                 /**
331                  * @return
332                  */
333                 public boolean isPublished() {
334                         return isPublished;
335                 }
336
337                 /**
338                  * @param isPublished
339                  */
340                 public void setPublished(boolean isPublished) {
341                         this.isPublished = isPublished;
342                 }
343
344     public String toString() {
345         return new ToStringBuilder(this)
346             .append("id", getId())
347             .toString();
348     }
349
350     public boolean equals(Object other) {
351         if ( !(other instanceof Media) ) return false;
352         Media castOther = (Media) other;
353         return new EqualsBuilder()
354             .append(this.getId(), castOther.getId())
355             .isEquals();
356     }
357
358     public int hashCode() {
359         return new HashCodeBuilder()
360             .append(getId())
361             .toHashCode();
362     }
363
364 }