-
Notifications
You must be signed in to change notification settings - Fork 12
Expand file tree
/
Copy pathAppoitment.java
More file actions
32 lines (25 loc) · 973 Bytes
/
Appoitment.java
File metadata and controls
32 lines (25 loc) · 973 Bytes
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
package org.codedifferently;
import java.io.Serializable;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
class Appointment implements Serializable {
private String customerID;
private LocalDateTime time;
private boolean isCompleted;
public Appointment(String customerID, LocalDateTime time) {
this.customerID = customerID;
this.time = time;
this.isCompleted = false;
}
public String getCustomerID() { return customerID; }
public LocalDateTime getTime() { return time; }
public boolean isCompleted() { return isCompleted; }
public void complete() { this.isCompleted = true; }
@Override
public String toString() {
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm");
return "Appointment | Customer ID: " + customerID +
" | Time: " + time.format(formatter) +
" | Completed: " + isCompleted;
}
}