first commit of new persistence layer. new model classes
[mir.git] / source / mir / core / model / Topic.java
1 package mir.core.model;
2
3 import java.io.Serializable;
4 import java.util.Set;
5
6 import org.apache.commons.lang.builder.EqualsBuilder;
7 import org.apache.commons.lang.builder.HashCodeBuilder;
8 import org.apache.commons.lang.builder.ToStringBuilder;
9
10 /** @author Hibernate CodeGenerator */
11 public class Topic implements Serializable {
12
13     /** identifier field */
14     private Integer id;
15
16     /** persistent field */
17     private String title;
18
19     /** nullable persistent field */
20     private String description;
21
22     /** persistent field */
23     private String filename;
24
25     /** nullable persistent field */
26     private String mainUrl;
27
28     /** nullable persistent field */
29     private String archivUrl;
30
31     /** nullable persistent field */
32     private mir.core.model.Topic parentTopic;
33     
34     private Set content;
35
36     /** default constructor */
37     public Topic() {
38     }
39
40     public java.lang.Integer getId() {
41         return this.id;
42     }
43
44     public void setId(java.lang.Integer id) {
45         this.id = id;
46     }
47
48     public java.lang.String getTitle() {
49         return this.title;
50     }
51
52     public void setTitle(java.lang.String title) {
53         this.title = title;
54     }
55
56     public java.lang.String getDescription() {
57         return this.description;
58     }
59
60     public void setDescription(java.lang.String description) {
61         this.description = description;
62     }
63
64     public java.lang.String getFilename() {
65         return this.filename;
66     }
67
68     public void setFilename(java.lang.String filename) {
69         this.filename = filename;
70     }
71
72     public java.lang.String getMainUrl() {
73         return this.mainUrl;
74     }
75
76     public void setMainUrl(java.lang.String mainUrl) {
77         this.mainUrl = mainUrl;
78     }
79
80     public java.lang.String getArchivUrl() {
81         return this.archivUrl;
82     }
83
84     public void setArchivUrl(java.lang.String archivUrl) {
85         this.archivUrl = archivUrl;
86     }
87
88     public mir.core.model.Topic getParentTopic() {
89         return this.parentTopic;
90     }
91
92     public void setParentTopic(mir.core.model.Topic parentTopic) {
93         this.parentTopic = parentTopic;
94     }
95
96                 /**
97                  * @return
98                  */
99                 public Set getContent() {
100                         return content;
101                 }
102
103                 /**
104                  * @param content
105                  */
106                 public void setContent(Set content) {
107                         this.content = content;
108                 }
109
110     public String toString() {
111         return new ToStringBuilder(this)
112             .append("id", getId())
113             .toString();
114     }
115
116     public boolean equals(Object other) {
117         if ( !(other instanceof Topic) ) return false;
118         Topic castOther = (Topic) other;
119         return new EqualsBuilder()
120             .append(this.getId(), castOther.getId())
121             .isEquals();
122     }
123
124     public int hashCode() {
125         return new HashCodeBuilder()
126             .append(getId())
127             .toHashCode();
128     }
129
130 }