-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathResume.java
More file actions
108 lines (88 loc) · 2.85 KB
/
Resume.java
File metadata and controls
108 lines (88 loc) · 2.85 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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
package ru.javaops.webapp.model;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlRootElement;
import java.io.Serializable;
import java.util.EnumMap;
import java.util.Map;
import java.util.Objects;
import java.util.UUID;
/**
* Initial resume class
*/
@XmlRootElement
@XmlAccessorType(XmlAccessType.FIELD)
public class Resume implements Comparable<Resume>, Serializable {
private static final long serialVersionUID = 1L;
private Map<SectionType, AbstractSection> sections = new EnumMap<>(SectionType.class);
private Map<ContactType, String> contacts = new EnumMap<>(ContactType.class);
// Unique identifier
private String uuid;
private String fullName;
public Resume() {
}
public Resume(String fullName) {
this(UUID.randomUUID().toString(), fullName);
}
public Resume(String uuid, String fullName) {
Objects.requireNonNull(uuid, "uuid must not be null");
Objects.requireNonNull(fullName, "fullName must not ne null");
this.uuid = uuid;
this.fullName = fullName;
}
public String getUuid() {
return uuid;
}
public String getFullName() {
return fullName;
}
public void setFullName(String fullName) {
this.fullName = fullName;
}
public Map<SectionType, AbstractSection> getSections() {
return sections;
}
public void setSections(Map<SectionType, AbstractSection> sections) {
this.sections = sections;
}
public Map<ContactType, String> getContacts() {
return contacts;
}
public void setContacts(Map<ContactType, String> contacts) {
this.contacts = contacts;
}
public String getContact(ContactType type) {
return contacts.get(type);
}
public void addContact(ContactType type, String contact) {
contacts.put(type, contact);
}
public AbstractSection getSection(SectionType type) {
return sections.get(type);
}
public void addSection(SectionType type, AbstractSection abstractSection) {
sections.put(type, abstractSection);
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
Resume resume = (Resume) o;
return Objects.equals(uuid, resume.uuid) &&
Objects.equals(fullName, resume.fullName) &&
Objects.equals(sections, resume.sections) &&
Objects.equals(contacts, resume.contacts);
}
@Override
public int hashCode() {
return Objects.hash(uuid, fullName, sections, contacts);
}
@Override
public int compareTo(Resume o) {
return uuid.compareTo(o.uuid);
}
@Override
public String toString() {
return uuid + " (" + fullName + ")";
}
}