forked from vmware-tanzu-learning/pal-tracker
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTimeEntry.java
More file actions
88 lines (72 loc) · 2.13 KB
/
TimeEntry.java
File metadata and controls
88 lines (72 loc) · 2.13 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
package io.pivotal.pal.tracker;
import java.time.LocalDate;
public class TimeEntry {
private long id;
private long projectId;
private long userId;
private LocalDate date;
private int hours;
public TimeEntry() {
}
public TimeEntry(long projectId, long userId, LocalDate date, int hours) {
this.projectId = projectId;
this.userId = userId;
this.date = date;
this.hours = hours;
}
public TimeEntry(long id, long projectId, long userId, LocalDate date, int hours) {
this.id = id;
this.projectId = projectId;
this.userId = userId;
this.date = date;
this.hours = hours;
}
public long getId() {
return id;
}
public void setId(long id) {
this.id = id;
}
public long getProjectId() {
return projectId;
}
public long getUserId() {
return userId;
}
public LocalDate getDate() {
return date;
}
public int getHours() {
return hours;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
TimeEntry timeEntry = (TimeEntry) o;
if (id != timeEntry.id) return false;
if (projectId != timeEntry.projectId) return false;
if (userId != timeEntry.userId) return false;
if (hours != timeEntry.hours) return false;
return date != null ? date.equals(timeEntry.date) : timeEntry.date == null;
}
@Override
public int hashCode() {
int result = (int) (id ^ (id >>> 32));
result = 31 * result + (int) (projectId ^ (projectId >>> 32));
result = 31 * result + (int) (userId ^ (userId >>> 32));
result = 31 * result + (date != null ? date.hashCode() : 0);
result = 31 * result + hours;
return result;
}
@Override
public String toString() {
return "TimeEntry{" +
"id=" + id +
", projectId=" + projectId +
", userId=" + userId +
", date='" + date + '\'' +
", hours=" + hours +
'}';
}
}