forked from nus-cs2103-AY1617S1/addressbook-level4
-
Notifications
You must be signed in to change notification settings - Fork 3
/
ExitCommand.java
39 lines (31 loc) · 1.04 KB
/
ExitCommand.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
package seedu.agendum.logic.commands;
import seedu.agendum.commons.core.EventsCenter;
import seedu.agendum.commons.events.ui.ExitAppRequestEvent;
/**
* Terminates the program.
*/
public class ExitCommand extends Command {
// COMMAND_WORD, COMMAND_FORMAT, COMMAND_DESCRIPTION are for display in help window
public static final String COMMAND_WORD = "exit";
public static String COMMAND_FORMAT = "exit";
public static String COMMAND_DESCRIPTION = "exit Agendum";
public static final String MESSAGE_EXIT_ACKNOWLEDGEMENT = "Exiting Agendum as requested ...";
public ExitCommand() {}
@Override
public CommandResult execute() {
EventsCenter.getInstance().post(new ExitAppRequestEvent());
return new CommandResult(MESSAGE_EXIT_ACKNOWLEDGEMENT);
}
@Override
public String getName() {
return COMMAND_WORD;
}
@Override
public String getFormat() {
return COMMAND_FORMAT;
}
@Override
public String getDescription() {
return COMMAND_DESCRIPTION;
}
}