1
2
3
4
5
6 package fr.ifremer.quadrige2.core.dao.administration.user;
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29 import java.io.Serializable;
30 import org.apache.commons.lang3.builder.EqualsBuilder;
31 import org.apache.commons.lang3.builder.HashCodeBuilder;
32
33
34
35
36 public class PrivilegeTransferPK implements Serializable, Comparable<PrivilegeTransferPK>
37 {
38
39
40
41 private static final long serialVersionUID = 1864781534107863371L;
42
43 public PrivilegeTransferPK()
44 {
45 }
46
47 public PrivilegeTransferPK(DepartmentImpl toDepartment, DepartmentImpl fromDepartment)
48 {
49 this.toDepartment = toDepartment;
50 this.fromDepartment = fromDepartment;
51 }
52
53 private DepartmentImpl toDepartment;
54
55 public DepartmentImpl getToDepartment()
56 {
57 return this.toDepartment;
58 }
59
60 public void setToDepartment(DepartmentImpl toDepartment)
61 {
62 this.toDepartment = toDepartment;
63 }
64
65 private DepartmentImpl fromDepartment;
66
67 public DepartmentImpl getFromDepartment()
68 {
69 return this.fromDepartment;
70 }
71
72 public void setFromDepartment(DepartmentImpl fromDepartment)
73 {
74 this.fromDepartment = fromDepartment;
75 }
76
77 @Override
78 public boolean equals(Object object)
79 {
80 if (this == object)
81 {
82 return true;
83 }
84 if (!(object instanceof PrivilegeTransferPK))
85 {
86 return false;
87 }
88 final PrivilegeTransferPK that = (PrivilegeTransferPK)object;
89 return new EqualsBuilder()
90 .append(this.getToDepartment(),that.getToDepartment())
91 .append(this.getFromDepartment(),that.getFromDepartment())
92 .isEquals();
93 }
94
95 @Override
96 public int hashCode()
97 {
98 return new HashCodeBuilder()
99 .append(getToDepartment())
100 .append(getFromDepartment())
101 .toHashCode();
102 }
103
104
105
106
107 @Override
108 public int compareTo(PrivilegeTransferPK o)
109 {
110 int cmp = 0;
111 return cmp;
112 }
113 }