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
96 lines (74 loc) · 2.37 KB
/
Resume.java
File metadata and controls
96 lines (74 loc) · 2.37 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
package com.urise.webapp.model;
import java.util.EnumMap;
import java.util.Map;
import java.util.Objects;
import java.util.UUID;
/**
* Initial resume class
*/
public class Resume {
// Unique identifier
private final String uuid;
private final String fullName;
private final Map<ContactType, String> contacts = new EnumMap<>(ContactType.class);
private final Map<SectionType, AbstractSection> sections = new EnumMap<>(SectionType.class);
public Resume(String fullName) {
this(UUID.randomUUID().toString(), fullName);
}
public Resume(String uuid, String fullName) {
Objects.requireNonNull(fullName, "fullName must not be null");
Objects.requireNonNull(uuid, "uuid must not be null");
this.uuid = uuid;
this.fullName = fullName;
}
<<<<<<< HEAD
public String getContact (ContactType type){
return contacts.get(type);
}
public AbstractSection getSection (SectionType type){
return sections.get(type);
}
public void addSection (SectionType type, AbstractSection section){
sections.put(type,section);
}
public void addContact (ContactType type, String contact){
contacts.put(type,contact);
=======
public String getContact(ContactType type) {
return contacs.get(type);
}
public Section getSection(SectionType type) {
return sections.get(type);
}
public void addSection(SectionType type, Section section) {
sections.put(type, section);
}
public void addContact(ContactType type, String contact) {
contacs.put(type, contact);
>>>>>>> lesson 8.
}
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;
return Objects.equals(uuid, resume.uuid) &&
Objects.equals(fullName, resume.fullName) &&
Objects.equals(contacts, resume.contacts) &&
Objects.equals(sections, resume.sections);
}
@Override
public int hashCode() {
return Objects.hash(uuid, fullName, contacts, sections);
}
}