-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTask.java
More file actions
73 lines (57 loc) · 1.6 KB
/
Task.java
File metadata and controls
73 lines (57 loc) · 1.6 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
package model;
import java.util.Objects;
public class Task {
protected int taskId;
protected String title;
protected String description;
protected Status status;
public Task(String title, String description, Status status) {
this.title = title;
this.description = description;
this.status = status;
}
public int getTaskId() {
return taskId;
}
public void setTaskId(int taskId) {
this.taskId = taskId;
}
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
public Status getStatus() {
return status;
}
public void setStatus(Status status) {
this.status = status;
}
@Override
public String toString() {
return String.format("%s{id=%d, title=%s, description=%s, status=%s}",
this.getClass(),
taskId,
title,
description,
status
);
}
@Override
public boolean equals(Object obj) {
if (this == obj) return true;
if (obj == null || this.getClass() != obj.getClass()) return false;
Task copy = (Task) obj;
return Objects.equals(this.title, copy.title) &&
Objects.equals(this.description, copy.description) &&
this.status == copy.status &&
this.taskId == copy.taskId;
}
}