-
Notifications
You must be signed in to change notification settings - Fork 1
/
Country.java
108 lines (99 loc) · 2.23 KB
/
Country.java
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
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
/**
* The Country class for storing country information
* @Author Tim Zhang
*/
public class Country {
private int attendeeCount;
public List<String> attendees = new ArrayList<>();
public String name;
private String startDate;
/**
* Setter
* @param name
*/
public Country(String name) {
this.name = name;
}
/**
* Setter
* @param attendeeCount
*/
public void setAttendeeCount(int attendeeCount) {
this.attendeeCount = attendeeCount;
}
/**
* Setter
* @param attendees
*/
public void setAttendees(List<String> attendees) {
this.attendees = attendees;
}
/**
* Setter
* @param startDate
*/
public void setStartDate(String startDate) {
this.startDate = startDate;
}
/**
* Getter
* @return name variable
*/
public String getName() {
return name;
}
/**
* Getter
* @return attendeeCount variable
*/
public int getAttendeeCount() {
return attendeeCount;
}
/**
* Getter
* @return attendees variable
*/
public List<String> getAttendees() {
return attendees;
}
/**
* Getter
* @return startDate variable
*/
public String getStartDate() {
return startDate;
}
/**
* When comparing, compares two country name.
* if two string values are equal, then returns equal.
* @param o
* @return
*/
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
Country country = (Country) o;
return name.equals(country.name);
}
/**
* Hashcode returns name variable hash.
* @return
*/
@Override
public int hashCode() {
return Objects.hash(name);
}
@Override
public String toString() {
return "Country{" +
"name='" + name + '\'' +
", attendeeCount=" + attendeeCount +
", attendees=" + attendees +
", best_date='" + startDate + '\'' +
'}';
}
}