forked from JavaOPs/basejava
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathResume.java
More file actions
49 lines (37 loc) · 925 Bytes
/
Resume.java
File metadata and controls
49 lines (37 loc) · 925 Bytes
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
package ru.topjava.webapp.model;
import java.util.UUID;
/**
* Initial resume class
*/
public class Resume implements Comparable<Resume> {
// Unique identifier
private final String uuid;
public Resume() {
this(UUID.randomUUID().toString());
}
public Resume(String uuid) {
this.uuid = uuid;
}
public String getUuid() {
return uuid;
}
@Override
public String toString() {
return uuid;
}
@Override
public boolean equals(Object object) {
if (this == object) return true;
if (object == null || getClass() != object.getClass()) return false;
Resume resume = (Resume) object;
return uuid.equals(resume.uuid);
}
@Override
public int hashCode() {
return uuid.hashCode();
}
@Override
public int compareTo(Resume resume) {
return uuid.compareTo(resume.uuid);
}
}