-
Notifications
You must be signed in to change notification settings - Fork 7
/
UserData.java
39 lines (31 loc) · 904 Bytes
/
UserData.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
import java.time.LocalDateTime;
import java.util.Scanner;
public class UserData {
private Task task;
private LocalDateTime completionTime;
private String notes;
public UserData(Task task) {
this.task = task;
this.completionTime = LocalDateTime.now();
this.notes = "";
}
public Task getTask() {
return task;
}
public LocalDateTime getCompletionTime() {
return completionTime;
}
public String getNotes() {
return notes;
}
public void setNotes(String notes) {
this.notes = notes;
}
public void gatherData() {
Scanner scanner = new Scanner(System.in);
System.out.println("Task completed: " + task.getName());
System.out.print("Notes (optional): ");
String notes = scanner.nextLine();
setNotes(notes);
}
}