8f62fab06c5b91d2b356c6faef103550205da20e
[mir.git] / source / mir / core / model / Rights.java
1 package mir.core.model;
2
3 import java.io.Serializable;
4
5 import org.apache.commons.lang.builder.EqualsBuilder;
6 import org.apache.commons.lang.builder.HashCodeBuilder;
7 import org.apache.commons.lang.builder.ToStringBuilder;
8
9 /** @author Hibernate CodeGenerator */
10 public class Rights implements Serializable {
11
12     /** identifier field */
13     private Integer id;
14
15     /** persistent field */
16     private String name;
17
18     /** nullable persistent field */
19     private String description;
20
21     /** full constructor */
22     public Rights(java.lang.String name, java.lang.String description) {
23         this.name = name;
24         this.description = description;
25     }
26
27     /** default constructor */
28     public Rights() {
29     }
30
31     /** minimal constructor */
32     public Rights(java.lang.String name) {
33         this.name = name;
34     }
35
36     public java.lang.Integer getId() {
37         return this.id;
38     }
39
40     public void setId(java.lang.Integer id) {
41         this.id = id;
42     }
43
44     public java.lang.String getName() {
45         return this.name;
46     }
47
48     public void setName(java.lang.String name) {
49         this.name = name;
50     }
51
52     public java.lang.String getDescription() {
53         return this.description;
54     }
55
56     public void setDescription(java.lang.String description) {
57         this.description = description;
58     }
59
60     public String toString() {
61         return new ToStringBuilder(this)
62             .append("id", getId())
63             .toString();
64     }
65
66     public boolean equals(Object other) {
67         if ( !(other instanceof Rights) ) return false;
68         Rights castOther = (Rights) other;
69         return new EqualsBuilder()
70             .append(this.getId(), castOther.getId())
71             .isEquals();
72     }
73
74     public int hashCode() {
75         return new HashCodeBuilder()
76             .append(getId())
77             .toHashCode();
78     }
79
80 }