From 0c338604f103e280ce9031ad950693b534d6d8ef Mon Sep 17 00:00:00 2001 From: Yeo Zong Yao Date: Wed, 20 Mar 2024 04:00:14 +0800 Subject: [PATCH] checkstyle fixes --- src/main/java/seedu/bookbuddy/Parser.java | 54 +++++++++++------------ 1 file changed, 27 insertions(+), 27 deletions(-) diff --git a/src/main/java/seedu/bookbuddy/Parser.java b/src/main/java/seedu/bookbuddy/Parser.java index 14728a3b14..3bbc650d85 100644 --- a/src/main/java/seedu/bookbuddy/Parser.java +++ b/src/main/java/seedu/bookbuddy/Parser.java @@ -29,33 +29,33 @@ public static void parseCommand( String input, BookList books) { int index; try { switch (command) { - case ADD_COMMAND: - if (inputArray.length < 2) { - throw new InvalidCommandArgumentException("The add command requires a book title."); - } - books.addBook(inputArray[1]); - break; - case REMOVE_COMMAND: - index = Integer.parseInt(inputArray[1]); - books.deleteBook(index); - break; - case LIST_COMMAND: - books.printAllBooks(); - break; - case MARK_COMMAND: - index = Integer.parseInt(inputArray[1]); - books.markDoneByIndex(index); - break; - case UNMARK_COMMAND: - index = Integer.parseInt(inputArray[1]); - books.markUndoneByIndex(index); - break; - case EXIT_COMMAND: - BookBuddy.printExitMessage(); - System.exit(0); - break; - default: - throw new UnsupportedCommandException("Sorry but that is not a valid command. Please try again"); + case ADD_COMMAND: + if (inputArray.length < 2) { + throw new InvalidCommandArgumentException("The add command requires a book title."); + } + books.addBook(inputArray[1]); + break; + case REMOVE_COMMAND: + index = Integer.parseInt(inputArray[1]); + books.deleteBook(index); + break; + case LIST_COMMAND: + books.printAllBooks(); + break; + case MARK_COMMAND: + index = Integer.parseInt(inputArray[1]); + books.markDoneByIndex(index); + break; + case UNMARK_COMMAND: + index = Integer.parseInt(inputArray[1]); + books.markUndoneByIndex(index); + break; + case EXIT_COMMAND: + BookBuddy.printExitMessage(); + System.exit(0); + break; + default: + throw new UnsupportedCommandException("Sorry but that is not a valid command. Please try again"); } } catch (NumberFormatException e) { throw new InvalidBookIndexException("Book index must be an integer.");