feature/tasks/enum-status-and-idgen #19

Merged
KamaSK merged 3 commits from feature/tasks/enum-status-and-idgen into main 2025-05-20 20:52:26 +03:00
3 changed files with 47 additions and 2 deletions
Showing only changes of commit 1932cdb297 - Show all commits

View File

@ -9,7 +9,7 @@ class Task {
private int id;
private String title;
private String description;
private boolean completed = false;
private boolean completed;
private LocalDate createdAt;
static {

View File

@ -0,0 +1,41 @@
package ru.kamask.pet;
public enum TaskStatus {
NEW("Новое") {
@Override
String getColorCode() {
return "\u001B[32m";
}
},
IN_PROGRESS("В работе") {
@Override
String getColorCode() {
return "\u001B[35m";
}
},
COMPLETED("Сделано") {
@Override
String getColorCode() {
return "\u001B[34m";
}
},
CANCELLED("Отменено") {
@Override
String getColorCode() {
return "\u001B[31m";
}
};
abstract String getColorCode();
private final String description;
TaskStatus(String description) {
this.description = description;
}
String getDescription() {
return description;
}
}

View File

@ -14,7 +14,11 @@ public class TodoApp {
TodoApp app = new TodoApp();
taskManager = app.new TaskManager();
app.run();
TaskStatus status = TaskStatus.valueOf("NEW");
System.out.println(status.getDescription());
// app.run();
}