1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.rice.kew.api.identity;
17
18 import org.kuali.rice.kew.api.user.UserId;
19
20
21
22
23
24
25
26 public class EmployeeId implements UserId {
27 private static final long serialVersionUID = -1335314734556834644L;
28 private String employeeId;
29
30 public EmployeeId() {
31 }
32
33 public EmployeeId(String employeeId) {
34 setEmployeeId(employeeId);
35 }
36
37 public String getEmployeeId() {
38 return this.employeeId;
39 }
40
41 public void setEmployeeId(String employeeId) {
42 this.employeeId = (employeeId == null ? null : employeeId.trim());
43 }
44
45 @Override
46 public String getId() {
47 return getEmployeeId();
48 }
49
50
51
52
53
54
55 @Override
56 public boolean isEmpty() {
57 return (employeeId == null || employeeId.trim().length() == 0);
58 }
59
60
61
62
63 public boolean equals(Object obj) {
64
65 if (obj != null && (obj instanceof EmployeeId)) {
66 EmployeeId a = (EmployeeId) obj;
67
68 if (getEmployeeId() == null) {
69 return false;
70 }
71
72 return employeeId.equals(a.getEmployeeId());
73 }
74
75 return false;
76 }
77
78 public int hashCode() {
79 return employeeId == null ? 0 : employeeId.hashCode();
80 }
81
82 public String toString() {
83 if (employeeId == null) {
84 return "employeeId: null";
85 }
86 return "employeeId: " + employeeId;
87 }
88
89 }