Skip to content

Commit

Permalink
Sarthak | Adds @OverRide annotation to the execute method of all the …
Browse files Browse the repository at this point in the history
…commands
  • Loading branch information
SarthakMakhija committed Jan 10, 2025
1 parent 3d0c04b commit eff6d2b
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ class AddProjectCommand implements Command {
this.projects = projects;
}

@Override
public void execute(Arguments arguments) {
assert (arguments.size() == 1);
String projectName = arguments.get(0);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ class AddTaskCommand implements Command {
this.projects = projects;
}

@Override
public void execute(Arguments arguments) {
assert (arguments.size() == 2);
String projectName = arguments.get(0);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ class UncheckCommand implements Command {
this.nonExistingTaskId = nonExistingTaskId;
}

@Override
public void execute(Arguments arguments) throws Exception {
assert (arguments.size() == 1);
if (projects.markTaskWithIdNotDone(arguments.argumentAtIndexAsInt(0))) return;
Expand All @@ -41,6 +42,7 @@ class CheckCommand implements Command {
this.nonExistingTaskId = nonExistingTaskId;
}

@Override
public void execute(Arguments arguments) throws Exception {
assert (arguments.size() == 1);
if (projects.markTaskWithIdDone(arguments.argumentAtIndexAsInt(0))) return;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ class ShowCommand implements Command {
this.projects = projects;
}

@Override
public void execute(Arguments arguments) throws Exception {
assert (arguments.isEmpty());
this.writer.write(this.projects.format());
Expand Down

0 comments on commit eff6d2b

Please sign in to comment.