1 /**
2 *
3 */
4 package ar.com.jiji.kaya.model;
5
6 import java.io.Serializable;
7
8 import org.apache.commons.lang.builder.EqualsBuilder;
9
10 /**
11 * Un rol. El atributo name es el valor que se usa para distinguir al rol en
12 * otras partes del sistema.
13 *
14 * @author lparra
15 * @version $Revision$ $Date$
16 */
17 public class Role implements Serializable {
18 private static final long serialVersionUID = 1L;
19
20 private Long id;
21
22 private String description;
23
24 private String name;
25
26 public String getName() {
27 return name;
28 }
29
30 public void setName(String name) {
31 this.name = name;
32 }
33
34 protected Role() {
35 }
36
37 public Role(String name) {
38 setName(name);
39 }
40
41 public String getDescription() {
42 return description;
43 }
44
45 public void setDescription(String description) {
46 this.description = description;
47 }
48
49 public Long getId() {
50 return id;
51 }
52
53 protected void setId(Long id) {
54 this.id = id;
55 }
56
57 @Override
58 public boolean equals(Object obj) {
59 if (!(obj instanceof Role))
60 return false;
61 Role r = (Role) obj;
62 EqualsBuilder builder = new EqualsBuilder();
63 return builder.append(getId(), r.getId()).append(getDescription(),
64 r.getDescription()).isEquals();
65
66 }
67
68 @Override
69 public String toString() {
70 return getId() + " " + getDescription();
71 }
72 }