1
|
package eu.dnetlib.goldoa.domain;
|
2
|
|
3
|
import com.google.gwt.user.client.rpc.IsSerializable;
|
4
|
|
5
|
/**
|
6
|
* Created by antleb on 3/8/15.
|
7
|
*/
|
8
|
public class PersonRole implements IsSerializable {
|
9
|
|
10
|
private Person person;
|
11
|
private Role role;
|
12
|
private boolean approved = false;
|
13
|
|
14
|
public PersonRole() {
|
15
|
}
|
16
|
|
17
|
public PersonRole(Person person, Role role, boolean approved) {
|
18
|
this.person = person;
|
19
|
this.role = role;
|
20
|
this.approved = approved;
|
21
|
}
|
22
|
|
23
|
public Person getPerson() {
|
24
|
return person;
|
25
|
}
|
26
|
|
27
|
public void setPerson(Person person) {
|
28
|
this.person = person;
|
29
|
}
|
30
|
|
31
|
public Role getRole() {
|
32
|
return role;
|
33
|
}
|
34
|
|
35
|
public void setRole(Role role) {
|
36
|
this.role = role;
|
37
|
}
|
38
|
|
39
|
public boolean isApproved() {
|
40
|
return approved;
|
41
|
}
|
42
|
|
43
|
public void setApproved(boolean approved) {
|
44
|
this.approved = approved;
|
45
|
}
|
46
|
|
47
|
@Override
|
48
|
public boolean equals(Object o) {
|
49
|
if (this == o) return true;
|
50
|
if (o == null || getClass() != o.getClass()) return false;
|
51
|
|
52
|
PersonRole that = (PersonRole) o;
|
53
|
|
54
|
if (approved != that.approved) return false;
|
55
|
if (person != null ? !person.equals(that.person) : that.person != null) return false;
|
56
|
if (role != null ? !role.equals(that.role) : that.role != null) return false;
|
57
|
|
58
|
return true;
|
59
|
}
|
60
|
|
61
|
@Override
|
62
|
public int hashCode() {
|
63
|
int result = person != null ? person.hashCode() : 0;
|
64
|
result = 31 * result + (role != null ? role.hashCode() : 0);
|
65
|
result = 31 * result + (approved ? 1 : 0);
|
66
|
return result;
|
67
|
}
|
68
|
}
|