-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTask.java
More file actions
43 lines (27 loc) · 1.01 KB
/
Task.java
File metadata and controls
43 lines (27 loc) · 1.01 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
package com.example.tasktracker;
import jakarta.persistence.*;
import java.time.LocalDate;
@Entity
public class Task {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;
private String title;
private LocalDate dueDate;
private boolean completed;
public Task() {}
public Task(String title, LocalDate dueDate, boolean completed) {
this.title = title;
this.dueDate = dueDate;
this.completed = completed;
}
// Getters and Setters
public Long getId() { return id; }
public void setId(Long id) { this.id = id; }
public String getTitle() { return title; }
public void setTitle(String title) { this.title = title; }
public LocalDate getDueDate() { return dueDate; }
public void setDueDate(LocalDate dueDate) { this.dueDate = dueDate; }
public boolean isCompleted() { return completed; }
public void setCompleted(boolean completed) { this.completed = completed; }
}