-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathLogEntry.java
More file actions
90 lines (69 loc) · 1.99 KB
/
LogEntry.java
File metadata and controls
90 lines (69 loc) · 1.99 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
package org.cleancode.journal.domain;
import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.Objects;
public class LogEntry implements Serializable {
private Type type;
private String comment;
private String topicId;
private LocalDateTime dateTime;
private Score score = new Score();
public LogEntry(Type type) {
this.type = type;
}
public Type getType() {
return type;
}
public String getTopicId() {
return topicId;
}
public void setTopicId(String topicId) {
this.topicId = topicId;
}
public void setType(Type type) {
this.type = type;
}
public boolean isIrrelevant() {
return type == Type.Irrelevant;
}
public boolean isFulfilled() {
return type == Type.Fulfilled;
}
public boolean isIgnored() {
return type == Type.Violated;
}
public String getComment() {
return comment;
}
public void setComment(String comment) {
this.comment = comment;
}
public LocalDateTime getDateTime() {
return dateTime;
}
public void setDateTime(LocalDateTime dateTime) {
this.dateTime = dateTime;
}
public Score getScore() {
return score;
}
public void setScore(Score score) {
this.score = score;
}
@Override
public String toString() {
return "LogEntry{" + "type=" + type + '}';
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (!(o instanceof LogEntry)) return false;
LogEntry logEntry = (LogEntry) o;
return type == logEntry.type && Objects.equals(comment, logEntry.comment) && topicId.equals(logEntry.topicId) && dateTime.equals(logEntry.dateTime) && score.equals(logEntry.score);
}
@Override
public int hashCode() {
return Objects.hash(type, comment, topicId, dateTime, score);
}
public enum Type {Irrelevant, Fulfilled, Violated, Achievement}
}