-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathResume.java
More file actions
60 lines (43 loc) · 1.29 KB
/
Copy pathResume.java
File metadata and controls
60 lines (43 loc) · 1.29 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
package model;
import com.sun.istack.internal.NotNull;
import java.util.UUID;
public class Resume implements Comparable<Resume> {
private final String uuid;
private final String fullName;
public Resume(@NotNull final String fullName) {
this(UUID.randomUUID().toString(), fullName);
}
public Resume(@NotNull final String uuid,@NotNull final String fullName) {
this.uuid = uuid;
this.fullName = fullName;
}
public String getUuid() {
return uuid;
}
public String getFullName() {
return fullName;
}
@Override
public String toString() {
return uuid + '(' + fullName + ')';
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
Resume resume = (Resume) o;
if (!uuid.equals(resume.uuid)) return false;
return fullName.equals(resume.fullName);
}
@Override
public int hashCode() {
int result = uuid.hashCode();
result = 31 * result + fullName.hashCode();
return result;
}
@Override
public int compareTo(Resume o) {
int cmp = fullName.compareTo(o.fullName);
return cmp != 0 ? cmp : uuid.compareTo(o.getUuid());
}
}