-
Notifications
You must be signed in to change notification settings - Fork 40
Expand file tree
/
Copy pathNomination.java
More file actions
130 lines (112 loc) · 4.01 KB
/
Nomination.java
File metadata and controls
130 lines (112 loc) · 4.01 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
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
package test.model;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonProperty;
import javax.ws.rs.core.GenericType;
import java.util.Date;
import java.util.List;
import java.util.Objects;
/**
* This is a java class that represents a White House Nomination. This will get
* loaded through the White House Nominations Appointment dataset. It will use Java Dates, however,
* the test dataset will use Floating Timestamps for nominationDate and Fixed Timestamps for confirmationVoteDate.
*/
@JsonIgnoreProperties(ignoreUnknown=true)
public class Nomination
{
public static final GenericType<List<Nomination>> LIST_TYPE = new GenericType<List<Nomination>>() {};
final String name;
final String position;
final String agencyName;
final String agencyWebsite;
final Date nominationDate;
final Date confirmationVoteDate;
final Boolean confirmed;
final Boolean holdover;
@JsonCreator
public Nomination(@JsonProperty("name") String name,
@JsonProperty("position") String position,
@JsonProperty("agency_name") String agencyName,
@JsonProperty("agency_website") String agencyWebsite,
@JsonProperty("nomination_date") Date nominationDate,
@JsonProperty("confirmation_vote") Date confirmationVoteDate,
@JsonProperty("confirmed") Boolean confirmed,
@JsonProperty("holdover") Boolean holdover)
{
this.name = name;
this.position = position;
this.agencyName = agencyName;
this.agencyWebsite = agencyWebsite;
this.nominationDate = nominationDate;
this.confirmationVoteDate = confirmationVoteDate;
this.confirmed = confirmed;
this.holdover = holdover;
}
public String getName()
{
return name;
}
public String getPosition()
{
return position;
}
@JsonProperty("agency_name")
public String getAgencyName()
{
return agencyName;
}
@JsonProperty("agency_website")
public String getAgencyWebsite()
{
return agencyWebsite;
}
@JsonProperty("nomination_date")
public Date getNominationDate()
{
return nominationDate;
}
@JsonProperty("confirmation_vote")
public Date getConfirmationVoteDate()
{
return confirmationVoteDate;
}
public Boolean getConfirmed()
{
return confirmed;
}
public Boolean getHoldover()
{
return holdover;
}
@Override
public boolean equals(final Object o) {
if (this == o) return true;
if (!(o instanceof Nomination)) return false;
final Nomination that = (Nomination) o;
return Objects.equals(name, that.name) &&
Objects.equals(position, that.position) &&
Objects.equals(agencyName, that.agencyName) &&
Objects.equals(agencyWebsite, that.agencyWebsite) &&
Objects.equals(nominationDate, that.nominationDate) &&
Objects.equals(confirmationVoteDate, that.confirmationVoteDate) &&
Objects.equals(confirmed, that.confirmed) &&
Objects.equals(holdover, that.holdover);
}
@Override
public int hashCode() {
return Objects.hash(name, position, agencyName, agencyWebsite, nominationDate, confirmationVoteDate, confirmed, holdover);
}
@Override
public String toString() {
return "Nomination{" +
"name='" + name + '\'' +
", position='" + position + '\'' +
", agencyName='" + agencyName + '\'' +
", agencyWebsite='" + agencyWebsite + '\'' +
", nominationDate=" + nominationDate +
", confirmationVoteDate=" + confirmationVoteDate +
", confirmed=" + confirmed +
", holdover=" + holdover +
'}';
}
}