From 1f1ff804f4bee4dbf47aa2fccd40d2c065e7af35 Mon Sep 17 00:00:00 2001 From: Dexter Hoon Date: Tue, 14 Nov 2023 03:38:06 +0800 Subject: [PATCH] Resolve checkstyle errors --- .../java/seedu/cafectrl/storage/Decoder.java | 38 +++++++++---------- .../java/seedu/cafectrl/storage/Encoder.java | 8 ++-- .../java/seedu/cafectrl/ui/ErrorMessages.java | 3 -- 3 files changed, 23 insertions(+), 26 deletions(-) diff --git a/src/main/java/seedu/cafectrl/storage/Decoder.java b/src/main/java/seedu/cafectrl/storage/Decoder.java index b23bf0896..47c21be8e 100644 --- a/src/main/java/seedu/cafectrl/storage/Decoder.java +++ b/src/main/java/seedu/cafectrl/storage/Decoder.java @@ -32,29 +32,29 @@ public class Decoder { private static final String INGREDIENT_DIVIDER = " - "; /** For menu decoder */ - public static final int MAX_INGREDIENTS_STRING_ARRAY_SIZE = 1; - public static final int DISH_NAME_INDEX_DISH_ARRAY = 0; - public static final int DISH_PRICE_INDEX_DISH_ARRAY = 1; - public static final int DISH_INGREDIENT_START_INDEX = 2; - public static final int NAME_INDEX_INGREDIENT_ARRAY = 0; - public static final int QTY_INDEX_INGREDIENT_ARRAY = 1; - public static final int UNIT_INDEX_INGREDIENT_ARRAY = 2; + private static final int MAX_INGREDIENTS_STRING_ARRAY_SIZE = 1; + private static final int DISH_NAME_INDEX_DISH_ARRAY = 0; + private static final int DISH_PRICE_INDEX_DISH_ARRAY = 1; + private static final int DISH_INGREDIENT_START_INDEX = 2; + private static final int NAME_INDEX_INGREDIENT_ARRAY = 0; + private static final int QTY_INDEX_INGREDIENT_ARRAY = 1; + private static final int UNIT_INDEX_INGREDIENT_ARRAY = 2; /** for stock pantry decoder */ - public static final int NAME_INDEX_PANTRY = 0; - public static final int QTY_INDEX_PANTRY = 1; - public static final int UNIT_INDEX_PANTRY = 2; - public static final int MAX_PANTRY_ARRAY_SIZE = 3; + private static final int NAME_INDEX_PANTRY = 0; + private static final int QTY_INDEX_PANTRY = 1; + private static final int UNIT_INDEX_PANTRY = 2; + private static final int MAX_PANTRY_ARRAY_SIZE = 3; /** for sales decoder */ - public static final int DAY_INDEX_SALES = 0; - public static final int DISH_NAME_INDEX_SALES = 1; - public static final int QTY_INDEX_SALES = 2; - public static final int DISH_PRICE_INDEX_SALES = 3; - public static final int STATUS_INDEX_SALES = 4; - public static final String TRUE_STRING = "true"; - public static final String FALSE_STRING = "false"; - public static final int MIN_DISH_PRICE = 0; + private static final int DAY_INDEX_SALES = 0; + private static final int DISH_NAME_INDEX_SALES = 1; + private static final int QTY_INDEX_SALES = 2; + private static final int DISH_PRICE_INDEX_SALES = 3; + private static final int STATUS_INDEX_SALES = 4; + private static final String TRUE_STRING = "true"; + private static final String FALSE_STRING = "false"; + private static final int MIN_DISH_PRICE = 0; //@@author ShaniceTang /** diff --git a/src/main/java/seedu/cafectrl/storage/Encoder.java b/src/main/java/seedu/cafectrl/storage/Encoder.java index a530a6c2a..f6d7b76a2 100644 --- a/src/main/java/seedu/cafectrl/storage/Encoder.java +++ b/src/main/java/seedu/cafectrl/storage/Encoder.java @@ -23,10 +23,10 @@ public class Encoder { private static final String DIVIDER = " | "; private static final String INGREDIENT_DIVIDER = " - "; private static final Logger logger = Logger.getLogger(CafeCtrl.class.getName()); - public static final String LINE_BREAK = "\n"; - public static final String EMPTY_STRING = ""; - public static final String CARRIAGE_RETURN = "\r"; - public static final String TWO_DECIMAL_PLACE_FORMAT = "%.2f"; + private static final String LINE_BREAK = "\n"; + private static final String EMPTY_STRING = ""; + private static final String CARRIAGE_RETURN = "\r"; + private static final String TWO_DECIMAL_PLACE_FORMAT = "%.2f"; //@@author Cazh1 /** diff --git a/src/main/java/seedu/cafectrl/ui/ErrorMessages.java b/src/main/java/seedu/cafectrl/ui/ErrorMessages.java index a43347b06..fc51a24c3 100644 --- a/src/main/java/seedu/cafectrl/ui/ErrorMessages.java +++ b/src/main/java/seedu/cafectrl/ui/ErrorMessages.java @@ -1,7 +1,6 @@ package seedu.cafectrl.ui; import seedu.cafectrl.command.EditPriceCommand; -import seedu.cafectrl.command.HelpCommand; import seedu.cafectrl.command.ListTotalSalesCommand; public class ErrorMessages { @@ -94,8 +93,6 @@ public class ErrorMessages { + "for the add command input"; public static final String NULL_STRING_IN_REPEAT_ARGUMENT = "Null string detected in isRepeatedArgument function"; public static final String INVALID_SALES_DATA = "orders.txt: Invalid format, this order will be removed -> "; - public static final String INVALID_ORDER_DATA = "orders.txt: Dish is not in current menu, " - + "this order will be removed -> "; public static final String INVALID_ORDER_STATUS = "orders.txt: Invalid status, this order will be removed -> "; public static final String INVALID_ORDER_QTY = "orders.txt: Invalid quantity (order quantity has to be more than 0)" + ", this order will be removed -> ";