From 7911783ff79adfc34e1decde2dda85417fc406aa Mon Sep 17 00:00:00 2001 From: Zhang Zhiyao Date: Wed, 3 Nov 2021 15:13:48 +0800 Subject: [PATCH 1/5] update java doc --- docs/UserGuide.md | 2 +- .../seedu/address/commons/core/Config.java | 35 +++++++++++++++++-- .../address/commons/core/GuiSettings.java | 17 +++++++++ .../address/commons/core/index/Index.java | 25 ++++++++++++- 4 files changed, 75 insertions(+), 4 deletions(-) diff --git a/docs/UserGuide.md b/docs/UserGuide.md index e774f75c773..f43f4640ac2 100644 --- a/docs/UserGuide.md +++ b/docs/UserGuide.md @@ -364,7 +364,7 @@ If your changes to the data file makes its format invalid, ezFoodie will discard ## FAQ **Q**: How do I transfer my data to another Computer?
-**A**: Install the application in the other computer and overwrite the empty data file it creates with the file that contains the data of your previous AddressBook home folder. +**A**: Install the application in the other computer and overwrite the empty data file it creates with the file that contains the data of your previous ezFoodie home folder. -------------------------------------------------------------------------------------------------------------------- diff --git a/src/main/java/seedu/address/commons/core/Config.java b/src/main/java/seedu/address/commons/core/Config.java index 91145745521..09d2f647eeb 100644 --- a/src/main/java/seedu/address/commons/core/Config.java +++ b/src/main/java/seedu/address/commons/core/Config.java @@ -6,32 +6,55 @@ import java.util.logging.Level; /** - * Config values used by the app + * Config values used by the application */ public class Config { - + /** + * Gets the default congig json file + */ public static final Path DEFAULT_CONFIG_FILE = Paths.get("config.json"); // Config values customizable through config file private Level logLevel = Level.INFO; private Path userPrefsFilePath = Paths.get("preferences.json"); + /** + * Gets Log Level + * @return Level + */ public Level getLogLevel() { return logLevel; } + /** + * Sets Log Level + * @param logLevel + */ public void setLogLevel(Level logLevel) { this.logLevel = logLevel; } + /** + * Gets User Prefs File Path + * @return Path + */ public Path getUserPrefsFilePath() { return userPrefsFilePath; } + /** + * Sets User Prefs File Path + * @param userPrefsFilePath + */ public void setUserPrefsFilePath(Path userPrefsFilePath) { this.userPrefsFilePath = userPrefsFilePath; } + /** + * Overrides the equal method + * @param other + * @return boolean + */ @Override public boolean equals(Object other) { if (other == this) { @@ -47,11 +70,19 @@ public boolean equals(Object other) { && Objects.equals(userPrefsFilePath, o.userPrefsFilePath); } + /** + * Overrides hashcode method + * @return int + */ @Override public int hashCode() { return Objects.hash(logLevel, userPrefsFilePath); } + /** + * Overrides toString method + * @return String the log level and Config file location + */ @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/src/main/java/seedu/address/commons/core/GuiSettings.java b/src/main/java/seedu/address/commons/core/GuiSettings.java index ba33653be67..916f29b9383 100644 --- a/src/main/java/seedu/address/commons/core/GuiSettings.java +++ b/src/main/java/seedu/address/commons/core/GuiSettings.java @@ -35,18 +35,35 @@ public GuiSettings(double windowWidth, double windowHeight, int xPosition, int y windowCoordinates = new Point(xPosition, yPosition); } + /** + * Gets GUI window width + * @return double the width of window + */ public double getWindowWidth() { return windowWidth; } + /** + * Gets GUI window height + * @return double the height of window + */ public double getWindowHeight() { return windowHeight; } + /** + * Gets GUI window coordinates + * @return Point + */ public Point getWindowCoordinates() { return windowCoordinates != null ? new Point(windowCoordinates) : null; } + /** + * Overrides the equal method for comparing + * @param other + * @return + */ @Override public boolean equals(Object other) { if (other == this) { diff --git a/src/main/java/seedu/address/commons/core/index/Index.java b/src/main/java/seedu/address/commons/core/index/Index.java index 19536439c09..48c3458bfe5 100644 --- a/src/main/java/seedu/address/commons/core/index/Index.java +++ b/src/main/java/seedu/address/commons/core/index/Index.java @@ -6,13 +6,14 @@ * {@code Index} should be used right from the start (when parsing in a new user input), so that if the current * component wants to communicate with another component, it can send an {@code Index} to avoid having to know what * base the other component is using for its index. However, after receiving the {@code Index}, that component can - * convert it back to an int if the index will not be passed to a different component again. + * convert it back to an integer if the index will not be passed to a different component again. */ public class Index { private int zeroBasedIndex; /** * Index can only be created by calling {@link Index#fromZeroBased(int)} or + * * {@link Index#fromOneBased(int)}. */ private Index(int zeroBasedIndex) { @@ -23,16 +24,29 @@ private Index(int zeroBasedIndex) { this.zeroBasedIndex = zeroBasedIndex; } + /** + * Gets zero based integer + * + * @return Zero Based index + */ public int getZeroBased() { return zeroBasedIndex; } + /** + * Gets one based integer + * + * @return Get one based integer + */ public int getOneBased() { return zeroBasedIndex + 1; } /** * Creates a new {@code Index} using a zero-based index. + * + * @param zeroBasedIndex + * @return Index of zeroBasedIndex */ public static Index fromZeroBased(int zeroBasedIndex) { return new Index(zeroBasedIndex); @@ -40,11 +54,20 @@ public static Index fromZeroBased(int zeroBasedIndex) { /** * Creates a new {@code Index} using a one-based index. + * + * @param oneBasedIndex + * @return Index of oneBasedIndex */ public static Index fromOneBased(int oneBasedIndex) { return new Index(oneBasedIndex - 1); } + /** + * Overrides the equal method + * + * @param other + * @return Boolean + */ @Override public boolean equals(Object other) { return other == this // short circuit if same object From b21a039dfa4e2d0bae078a90691081275e5549ea Mon Sep 17 00:00:00 2001 From: Zhang Zhiyao Date: Thu, 4 Nov 2021 04:00:13 +0800 Subject: [PATCH 2/5] javadoc until to reservations --- .../seedu/address/commons/core/Config.java | 25 ++++-- .../address/commons/core/GuiSettings.java | 24 +++-- .../seedu/address/commons/core/Messages.java | 32 ++++++- .../seedu/address/commons/core/Version.java | 48 +++++++++- .../exceptions/PermissionException.java | 4 + .../commons/status/ExecutionStatus.java | 3 + .../address/commons/status/LoginStatus.java | 13 ++- .../address/commons/status/SortStatus.java | 3 + .../seedu/address/logic/LogicManager.java | 89 +++++++++++++++++++ .../address/logic/commands/AddCommand.java | 14 +++ .../logic/commands/AddMemberCommand.java | 19 +++- .../logic/commands/AddReservationCommand.java | 27 +++++- .../logic/commands/AddTransactionCommand.java | 25 +++++- .../address/logic/commands/ClearCommand.java | 13 +++ .../address/logic/commands/CommandResult.java | 32 +++++++ .../address/logic/commands/DeleteCommand.java | 14 +++ .../logic/commands/DeleteMemberCommand.java | 30 ++++++- .../commands/DeleteReservationCommand.java | 33 ++++++- .../commands/DeleteTransactionCommand.java | 33 ++++++- .../address/logic/commands/EditCommand.java | 14 +++ .../logic/commands/EditMemberCommand.java | 86 ++++++++++++++++++ .../commands/EditReservationCommand.java | 65 +++++++++++++- .../commands/EditTransactionCommand.java | 61 ++++++++++++- .../address/logic/commands/ExitCommand.java | 12 +++ .../address/logic/commands/FindCommand.java | 43 +++++++++ .../address/logic/commands/HelpCommand.java | 15 ++++ .../address/logic/commands/ListCommand.java | 22 ++++- .../address/logic/commands/LoginCommand.java | 28 ++++++ .../address/logic/commands/LogoutCommand.java | 17 ++++ .../address/logic/commands/RedeemCommand.java | 42 ++++++++- .../address/logic/commands/SortCommand.java | 30 +++++++ .../logic/commands/SummaryCommand.java | 21 +++++ .../address/logic/commands/ViewCommand.java | 22 +++++ .../commands/exceptions/CommandException.java | 11 +++ .../logic/parser/AddCommandParser.java | 3 + .../logic/parser/AddMemberCommandParser.java | 3 + .../parser/AddReservationCommandParser.java | 3 + .../parser/AddTransactionCommandParser.java | 3 + .../seedu/address/logic/parser/CliSyntax.java | 70 +++++++++++++++ .../parser/DeleteMemberCommandParser.java | 3 + .../DeleteReservationCommandParser.java | 4 +- .../DeleteTransactionCommandParser.java | 3 + .../logic/parser/EditCommandParser.java | 3 + .../logic/parser/EditMemberCommandParser.java | 3 + .../parser/EditReservationCommandParser.java | 3 + .../parser/EditTransactionCommandParser.java | 7 +- .../logic/parser/FindCommandParser.java | 3 + .../logic/parser/ListCommandParser.java | 3 + .../logic/parser/LoginCommandParser.java | 3 + .../seedu/address/logic/parser/Prefix.java | 22 +++++ .../logic/parser/RedeemCommandParser.java | 10 ++- .../logic/parser/SortCommandParser.java | 3 + .../logic/parser/ViewCommandParser.java | 2 + .../parser/exceptions/ParseException.java | 12 ++- .../seedu/address/model/account/Password.java | 31 +++++++ .../seedu/address/model/member/Address.java | 24 ++++- .../seedu/address/model/member/Credit.java | 45 +++++++++- .../model/member/CreditSortComparator.java | 22 +++++ .../seedu/address/model/member/Email.java | 28 +++++- .../EmailContainsKeywordsPredicate.java | 16 ++++ .../java/seedu/address/model/member/Id.java | 36 ++++++++ .../member/IdContainsKeywordsPredicate.java | 16 ++++ .../seedu/address/model/member/Member.java | 59 ++++++++++++ .../java/seedu/address/model/member/Name.java | 25 +++++- .../member/NameContainsKeywordsPredicate.java | 16 ++++ .../seedu/address/model/member/Phone.java | 20 ++++- .../PhoneContainsKeywordsPredicate.java | 16 ++++ .../seedu/address/model/member/Point.java | 41 ++++++++- ...strationDateContainsKeywordsPredicate.java | 16 ++++ .../model/member/UniqueMemberList.java | 42 +++++++++ .../exceptions/DuplicateMemberException.java | 3 + .../address/model/reservation/DateTime.java | 30 ++++++- .../seedu/address/model/reservation/Id.java | 36 ++++++++ 73 files changed, 1604 insertions(+), 54 deletions(-) diff --git a/src/main/java/seedu/address/commons/core/Config.java b/src/main/java/seedu/address/commons/core/Config.java index 09d2f647eeb..a88bc3c50de 100644 --- a/src/main/java/seedu/address/commons/core/Config.java +++ b/src/main/java/seedu/address/commons/core/Config.java @@ -10,7 +10,7 @@ */ public class Config { /** - * Gets the default congig json file + * Gets the default config json file. */ public static final Path DEFAULT_CONFIG_FILE = Paths.get("config.json"); @@ -19,7 +19,8 @@ public class Config { private Path userPrefsFilePath = Paths.get("preferences.json"); /** - * Gets Log Level + * Gets Log Level. + * * @return Level */ public Level getLogLevel() { @@ -27,7 +28,8 @@ public Level getLogLevel() { } /** - * Sets Log Level + * Sets Log Level. + * * @param logLevel */ public void setLogLevel(Level logLevel) { @@ -35,7 +37,8 @@ public void setLogLevel(Level logLevel) { } /** - * Gets User Prefs File Path + * Gets User Prefs File Path. + * * @return Path */ public Path getUserPrefsFilePath() { @@ -43,7 +46,8 @@ public Path getUserPrefsFilePath() { } /** - * Sets User Prefs File Path + * Sets User Prefs File Path. + * * @param userPrefsFilePath */ public void setUserPrefsFilePath(Path userPrefsFilePath) { @@ -51,7 +55,8 @@ public void setUserPrefsFilePath(Path userPrefsFilePath) { } /** - * Overrides the equal method + * Overrides the equal method for Config class. + * * @param other * @return boolean */ @@ -71,8 +76,9 @@ public boolean equals(Object other) { } /** - * Overrides hashcode method - * @return int + * Overrides hashcode method for Config class. + * + * @return int objects after hashed with logLevel and userPrefsFilePath */ @Override public int hashCode() { @@ -80,7 +86,8 @@ public int hashCode() { } /** - * Overrides toString method + * Overrides toString method for Config class. + * * @return String the log level and Config file location */ @Override diff --git a/src/main/java/seedu/address/commons/core/GuiSettings.java b/src/main/java/seedu/address/commons/core/GuiSettings.java index 916f29b9383..3c900ef379a 100644 --- a/src/main/java/seedu/address/commons/core/GuiSettings.java +++ b/src/main/java/seedu/address/commons/core/GuiSettings.java @@ -36,7 +36,8 @@ public GuiSettings(double windowWidth, double windowHeight, int xPosition, int y } /** - * Gets GUI window width + * Gets GUI window width. + * * @return double the width of window */ public double getWindowWidth() { @@ -44,7 +45,8 @@ public double getWindowWidth() { } /** - * Gets GUI window height + * Gets GUI window height. + * * @return double the height of window */ public double getWindowHeight() { @@ -52,7 +54,8 @@ public double getWindowHeight() { } /** - * Gets GUI window coordinates + * Gets GUI window coordinates. + * * @return Point */ public Point getWindowCoordinates() { @@ -60,9 +63,10 @@ public Point getWindowCoordinates() { } /** - * Overrides the equal method for comparing + * Overrides the equal method for GuiSettings. + * * @param other - * @return + * @return boolean */ @Override public boolean equals(Object other) { @@ -80,11 +84,21 @@ public boolean equals(Object other) { && Objects.equals(windowCoordinates, o.windowCoordinates); } + /** + * Overrides the hashCode method + * + * @return int objects after hashed with windowWidth, windowHeight and windowCoordinates. + */ @Override public int hashCode() { return Objects.hash(windowWidth, windowHeight, windowCoordinates); } + /** + * Overrides the toString Method for GuiSettings. + * + * @return String including all width, height and Position + */ @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/src/main/java/seedu/address/commons/core/Messages.java b/src/main/java/seedu/address/commons/core/Messages.java index 2ca42ee4357..b084f206252 100644 --- a/src/main/java/seedu/address/commons/core/Messages.java +++ b/src/main/java/seedu/address/commons/core/Messages.java @@ -6,14 +6,44 @@ * Container for user visible messages. */ public class Messages { - + /** + * Represents the MESSAGE_UNKNOWN_COMMAND. + */ public static final String MESSAGE_UNKNOWN_COMMAND = "Unknown command"; + + /** + * Represents the MESSAGE_INVALID_COMMAND_FORMAT. + */ public static final String MESSAGE_INVALID_COMMAND_FORMAT = "Invalid command format! \n%1$s"; + + /** + * Represents the MESSAGE_INVALID_MEMBER_DISPLAYED_INDEX. + */ public static final String MESSAGE_INVALID_MEMBER_DISPLAYED_INDEX = "The member index provided is invalid"; + + /** + * Represents the MESSAGE_INVALID_MEMBER_DISPLAYED_ID. + */ public static final String MESSAGE_INVALID_MEMBER_DISPLAYED_ID = "The member ID provided is invalid"; + + /** + * Represents the MESSAGE_INVALID_TRANSACTION_DISPLAYED_ID. + */ public static final String MESSAGE_INVALID_TRANSACTION_DISPLAYED_ID = "The transaction ID provided is invalid"; + + /** + * Represents the MESSAGE_INVALID_RESERVATION_DISPLAYED_ID. + */ public static final String MESSAGE_INVALID_RESERVATION_DISPLAYED_ID = "The reservation ID provided is invalid"; + + /** + * Represents the MESSAGE_MEMBERS_LISTED_OVERVIEW. + */ public static final String MESSAGE_MEMBERS_LISTED_OVERVIEW = "%1$d members listed!"; + + /** + * Represents the MESSAGE_PERMISSION_DENIED. + */ public static final String MESSAGE_PERMISSION_DENIED = "Permission denied! Please login as " + LoginStatus.MANAGER; } diff --git a/src/main/java/seedu/address/commons/core/Version.java b/src/main/java/seedu/address/commons/core/Version.java index 12142ec1e32..595c2696d51 100644 --- a/src/main/java/seedu/address/commons/core/Version.java +++ b/src/main/java/seedu/address/commons/core/Version.java @@ -7,10 +7,13 @@ import com.fasterxml.jackson.annotation.JsonValue; /** - * Represents a version with major, minor and patch number + * Represents a version with major, minor and patch number. */ public class Version implements Comparable { + /** + * Sets the VERSION_REGEX. + */ public static final String VERSION_REGEX = "V(\\d+)\\.(\\d+)\\.(\\d+)(ea)?"; private static final String EXCEPTION_STRING_NOT_VERSION = "String is not a valid Version. %s"; @@ -32,24 +35,45 @@ public Version(int major, int minor, int patch, boolean isEarlyAccess) { this.isEarlyAccess = isEarlyAccess; } + /** + * Gets the major. + * + * @return int + */ public int getMajor() { return major; } + /** + * Gets the minor. + * + * @return int + */ public int getMinor() { return minor; } + /** + * Gets the patch. + * + * @return int + */ public int getPatch() { return patch; } + /** + * Judges the isEarlyAccess. + * + * @return int + */ public boolean isEarlyAccess() { return isEarlyAccess; } /** * Parses a version number string in the format V1.2.3. + * * @param versionString version number string * @return a Version object */ @@ -67,11 +91,22 @@ public static Version fromString(String versionString) throws IllegalArgumentExc versionMatcher.group(4) == null ? false : true); } + /** + * Overrides the toString for Version class. + * + * @return String for Version + */ @JsonValue public String toString() { return String.format("V%d.%d.%d%s", major, minor, patch, isEarlyAccess ? "ea" : ""); } + /** + * Overrides the compareTo method for Version class. + * + * @param other + * @return int + */ @Override public int compareTo(Version other) { if (major != other.major) { @@ -92,6 +127,12 @@ public int compareTo(Version other) { return 1; } + /** + * Overrides the equal method for Version class. + * + * @param obj + * @return boolean + */ @Override public boolean equals(Object obj) { if (obj == null) { @@ -105,6 +146,11 @@ public boolean equals(Object obj) { return compareTo(other) == 0; } + /** + * Overrides the hashCode for Version class. + * + * @return int + */ @Override public int hashCode() { String hash = String.format("%03d%03d%03d", major, minor, patch); diff --git a/src/main/java/seedu/address/commons/exceptions/PermissionException.java b/src/main/java/seedu/address/commons/exceptions/PermissionException.java index 83e9eec26d3..604e54a1f1b 100644 --- a/src/main/java/seedu/address/commons/exceptions/PermissionException.java +++ b/src/main/java/seedu/address/commons/exceptions/PermissionException.java @@ -4,6 +4,10 @@ * Represents an error during insufficient permission. */ public class PermissionException extends Exception { + + /** + * @param message should contain relevant information on the failed constraint(s) + */ public PermissionException(String message) { super(message); } diff --git a/src/main/java/seedu/address/commons/status/ExecutionStatus.java b/src/main/java/seedu/address/commons/status/ExecutionStatus.java index 370b6a0c8f0..b766a6961a9 100644 --- a/src/main/java/seedu/address/commons/status/ExecutionStatus.java +++ b/src/main/java/seedu/address/commons/status/ExecutionStatus.java @@ -1,5 +1,8 @@ package seedu.address.commons.status; +/** + * Represents the ExecutionStatus. + */ public enum ExecutionStatus { NORMAL, TEST } diff --git a/src/main/java/seedu/address/commons/status/LoginStatus.java b/src/main/java/seedu/address/commons/status/LoginStatus.java index f4c8053b1bb..7ab37494450 100644 --- a/src/main/java/seedu/address/commons/status/LoginStatus.java +++ b/src/main/java/seedu/address/commons/status/LoginStatus.java @@ -2,21 +2,32 @@ import javafx.beans.property.SimpleStringProperty; +/** + * Represents the Execution Status. + */ public enum LoginStatus { STAFF("STAFF"), MANAGER("MANAGER"); + /** + * Represents the static the simple string property. + */ public static final SimpleStringProperty CURRENT_STATUS = new SimpleStringProperty(STAFF.value); private final String value; + /** + * Constructs {@code LoginStatus} with the given value. + */ LoginStatus(String value) { this.value = value; } /** - * Returns {@code LoginStatus}. + * Gets login status. + * + * Returns {@code LoginStatus} */ public static LoginStatus getLoginStatus() { if (CURRENT_STATUS.getValue().equals(STAFF.value)) { diff --git a/src/main/java/seedu/address/commons/status/SortStatus.java b/src/main/java/seedu/address/commons/status/SortStatus.java index afc6dda7238..bf9aa4874df 100644 --- a/src/main/java/seedu/address/commons/status/SortStatus.java +++ b/src/main/java/seedu/address/commons/status/SortStatus.java @@ -1,5 +1,8 @@ package seedu.address.commons.status; +/** + * Represents the Sort Status. + */ public enum SortStatus { ASC, DESC } diff --git a/src/main/java/seedu/address/logic/LogicManager.java b/src/main/java/seedu/address/logic/LogicManager.java index ede4fb671b4..cc533f05e06 100644 --- a/src/main/java/seedu/address/logic/LogicManager.java +++ b/src/main/java/seedu/address/logic/LogicManager.java @@ -49,6 +49,15 @@ public LogicManager(Model model, Storage storage, ExecutionStatus executionStatu ezFoodieParser = new EzFoodieParser(model, executionStatus); } + /** + * Executes with given string of command text. + * + * @param commandText The command as entered by the user. + * @return {@code CommandResult} + * @throws CommandException + * @throws ParseException + * @throws PermissionException + */ @Override public CommandResult execute(String commandText) throws CommandException, ParseException, PermissionException { logger.info("----------------[USER COMMAND][" + commandText + "]"); @@ -66,81 +75,161 @@ public CommandResult execute(String commandText) throws CommandException, ParseE return commandResult; } + /** + * Gets EzFoodie. + * + * @return ReadOnlyEzFoodie + */ @Override public ReadOnlyEzFoodie getEzFoodie() { return model.getEzFoodie(); } + /** + * Gets updated member list. + * + * @return ObservableList + */ @Override public ObservableList getUpdatedMemberList() { return model.getUpdatedMemberList(); } + /** + * Gets updated member list for view. + * + * @return ObservableList + */ @Override public ObservableList getUpdatedMemberListForView () { return model.getUpdatedMemberListForView(); } + /** + * Gets number of members. + * + * @return int + */ @Override public int getNumberOfMembers() { return model.getNumberOfMembers(); } + /** + * Gets number of members by tier. + * + * @return HashMap + */ @Override public HashMap getNumberOfMembersByTiers() { return model.getNumberOfMembersByTiers(); } + /** + * Gets number of transactions. + * + * @return int + */ @Override public int getNumberOfTransactions() { return model.getNumberOfTransactions(); } + /** + * Gets number of transactions in the past month. + * + * @return int + */ @Override public int getNumberOfTransactionsPastMonth() { return model.getNumberOfTransactionsPastMonth(); } + /** + * Gets number of transaction in past three months. + * + * @return int + */ @Override public int getNumberOfTransactionsPastThreeMonth() { return model.getNumberOfTransactionsPastThreeMonth(); } + /** + * Gets number of transactions in past six months. + * + * @return int + */ @Override public int getNumberOfTransactionsPastSixMonths() { return model.getNumberOfTransactionsPastSixMonth(); } + /** + * Gets total amount of transactions. + * + * @return double + */ @Override public double getTotalAmountOfTransactions() { return model.getTotalAmountOfTransactions(); } + /** + * Gets total amount of transactions in the past month. + * + * @return double + */ @Override public double getTotalAmountOfTransactionsPastMonth() { return model.getTotalAmountOfTransactionsPastMonth(); } + /** + * Gets total amount of transactions in the past three months. + * + * @return double + */ @Override public double getTotalAmountOfTransactionsPastThreeMonth() { return model.getTotalAmountOfTransactionsPastThreeMonth(); } + /** + * Gets total amount of transactions in the past six months. + * + * @return double + */ @Override public double getTotalAmountOfTransactionsPastSixMonth() { return model.getTotalAmountOfTransactionsPastSixMonth(); } + /** + * Gets EzFoodie Path. + * + * @return Path + */ @Override public Path getEzFoodieFilePath() { return model.getEzFoodieFilePath(); } + /** + * Gets Gui Settings. + * + * @return + */ @Override public GuiSettings getGuiSettings() { return model.getGuiSettings(); } + /** + * Sets Gui settings. + * + * @param guiSettings + */ @Override public void setGuiSettings(GuiSettings guiSettings) { model.setGuiSettings(guiSettings); diff --git a/src/main/java/seedu/address/logic/commands/AddCommand.java b/src/main/java/seedu/address/logic/commands/AddCommand.java index 2e6485429e3..8dabbf2f2cf 100644 --- a/src/main/java/seedu/address/logic/commands/AddCommand.java +++ b/src/main/java/seedu/address/logic/commands/AddCommand.java @@ -11,12 +11,26 @@ */ public abstract class AddCommand extends Command { + /** + * Stands for COMMAND WORD for add command. + */ public static final String COMMAND_WORD = "add"; + + /** + * Stands for output message. + */ public static final String MESSAGE_USAGE = COMMAND_WORD + ": Adds a member or a transaction to the ezFoodie.\n" + "With " + PREFIX_MEMBER + " (member details) or " + PREFIX_TRANSACTION + " (transaction details)"; + /** + * Overrides the execute method for addCommand class to execute model. + * + * @param model {@code Model} which the command should operate on. + * @return CommandResult for execute addCommand + * @throws CommandException + */ @Override public abstract CommandResult execute(Model model) throws CommandException; diff --git a/src/main/java/seedu/address/logic/commands/AddMemberCommand.java b/src/main/java/seedu/address/logic/commands/AddMemberCommand.java index a543f4ed5d3..8e3196246d8 100644 --- a/src/main/java/seedu/address/logic/commands/AddMemberCommand.java +++ b/src/main/java/seedu/address/logic/commands/AddMemberCommand.java @@ -17,6 +17,9 @@ */ public class AddMemberCommand extends AddCommand { + /** + * Stands for COMMAND WORD for add member. + */ public static final String MESSAGE_USAGE = COMMAND_WORD + ": Adds a member to the ezFoodie. " + "Parameters: " + PREFIX_MEMBER + " " @@ -40,13 +43,20 @@ public class AddMemberCommand extends AddCommand { private final Member toAdd; /** - * Creates an AddMemberCommand to add the specified {@code Member} + * Creates an AddMemberCommand to add the specified {@code Member}. */ public AddMemberCommand(Member member) { requireNonNull(member); toAdd = member; } + /** + * Overrides and executes model. + * + * @param model {@code Model} which the command should operate on. + * @return CommandResult with toAdd member + * @throws CommandException + */ @Override public CommandResult execute(Model model) throws CommandException { requireNonNull(model); @@ -59,10 +69,17 @@ public CommandResult execute(Model model) throws CommandException { return new CommandResult(String.format(MESSAGE_SUCCESS, toAdd)); } + /** + * Overrides the equals method. + * + * @param other + * @return boolean + */ @Override public boolean equals(Object other) { return other == this // short circuit if same object || (other instanceof AddMemberCommand // instanceof handles nulls && toAdd.equals(((AddMemberCommand) other).toAdd)); } + } diff --git a/src/main/java/seedu/address/logic/commands/AddReservationCommand.java b/src/main/java/seedu/address/logic/commands/AddReservationCommand.java index 27e4913753a..6597db45130 100644 --- a/src/main/java/seedu/address/logic/commands/AddReservationCommand.java +++ b/src/main/java/seedu/address/logic/commands/AddReservationCommand.java @@ -33,6 +33,9 @@ */ public class AddReservationCommand extends AddCommand { + /** + * Stands for the message add reservation command. + */ public static final String MESSAGE_USAGE = COMMAND_WORD + ": Adds reservation to member " + "by member ID in the ezFoodie. " + "Parameters: " @@ -46,13 +49,16 @@ public class AddReservationCommand extends AddCommand { + PREFIX_REMARK + " " + "2 people " + PREFIX_ID + " " + "10001"; + /** + * Stands for message success for new reservation added. + */ public static final String MESSAGE_SUCCESS = "New reservation added: %1$s"; private final Reservation reservationToAdd; private final Id idToAdd; /** - * Creates an AddReservationCommand to add the specified {@code Member} + * Constructs an AddReservationCommand to add the specified {@code Member}. */ public AddReservationCommand(Reservation reservation, Id id) { requireNonNull(id); @@ -60,6 +66,13 @@ public AddReservationCommand(Reservation reservation, Id id) { idToAdd = id; } + /** + * Overrides and executes the model. + * + * @param model {@code Model} which the command should operate on. + * @return CommandResult with edited member + * @throws CommandException + */ @Override public CommandResult execute(Model model) throws CommandException { requireNonNull(model); @@ -77,7 +90,11 @@ public CommandResult execute(Model model) throws CommandException { } /** - * Creates and returns a {@code Member} with the details of {@code memberToEdit} + * Creates and returns a {@code Member} with the details of {@code memberToEdit}. + * + * @param memberToEdit + * @param reservation + * @return member with updated reservations */ private static Member createUpdatedReservations(Member memberToEdit, Reservation reservation) { assert memberToEdit != null; @@ -101,6 +118,12 @@ private static Member createUpdatedReservations(Member memberToEdit, Reservation transactions, updatedReservations, tags); } + /** + * Overrides the equal method. + * + * @param other + * @return boolean + */ @Override public boolean equals(Object other) { return other == this // short circuit if same object diff --git a/src/main/java/seedu/address/logic/commands/AddTransactionCommand.java b/src/main/java/seedu/address/logic/commands/AddTransactionCommand.java index 25606bb3a01..a2876d3c260 100644 --- a/src/main/java/seedu/address/logic/commands/AddTransactionCommand.java +++ b/src/main/java/seedu/address/logic/commands/AddTransactionCommand.java @@ -32,6 +32,9 @@ */ public class AddTransactionCommand extends AddCommand { + /** + * Stands for the message add transaction command. + */ public static final String MESSAGE_USAGE = COMMAND_WORD + ": Adds a transaction to each member in the ezFoodie. " + "Parameters: " + PREFIX_TRANSACTION + " " @@ -48,7 +51,7 @@ public class AddTransactionCommand extends AddCommand { private final Id idToAdd; /** - * Creates an AddTransactionCommand to add the specified {@code Member} + * Constructs an AddTransactionCommand to add the specified {@code Member} */ public AddTransactionCommand(Transaction transaction, Id id) { requireAllNonNull(transaction, id); @@ -56,6 +59,13 @@ public AddTransactionCommand(Transaction transaction, Id id) { idToAdd = id; } + /** + * Overrides and executes the model. + * + * @param model {@code Model} which the command should operate on. + * @return CommandResult with edited member + * @throws CommandException + */ @Override public CommandResult execute(Model model) throws CommandException { requireNonNull(model); @@ -71,8 +81,13 @@ public CommandResult execute(Model model) throws CommandException { throw new CommandException(Messages.MESSAGE_INVALID_MEMBER_DISPLAYED_ID); } } + /** - * Creates and returns a {@code Member} with the details of {@code memberToEdit} + * Creates and returns a {@code Member} with the details of {@code memberToEdit}. + * + * @param memberToEdit + * @param transaction + * @return member with updated transactions and points */ private static Member createUpdatedCreditAndPointsMember(Member memberToEdit, Transaction transaction) { assert memberToEdit != null; @@ -97,6 +112,12 @@ private static Member createUpdatedCreditAndPointsMember(Member memberToEdit, Tr updatePoint, updatedTransactions, reservations, updatedTags); } + /** + * Overrides the equal method. + * + * @param other + * @return boolean + */ @Override public boolean equals(Object other) { return other == this // short circuit if same object diff --git a/src/main/java/seedu/address/logic/commands/ClearCommand.java b/src/main/java/seedu/address/logic/commands/ClearCommand.java index c75f9f90422..b9b77dbf8d4 100644 --- a/src/main/java/seedu/address/logic/commands/ClearCommand.java +++ b/src/main/java/seedu/address/logic/commands/ClearCommand.java @@ -10,10 +10,23 @@ */ public class ClearCommand extends Command { + /** + * Stands for Clean command word. + */ public static final String COMMAND_WORD = "clear"; + + /** + * Stands for success message for clear command. + */ public static final String MESSAGE_SUCCESS = "ezFoodie has been cleared!"; + /** + * Overrides and Executes the model. + * + * @param model {@code Model} which the command should operate on + * @return CommandResult + */ @Override public CommandResult execute(Model model) { requireNonNull(model); diff --git a/src/main/java/seedu/address/logic/commands/CommandResult.java b/src/main/java/seedu/address/logic/commands/CommandResult.java index 2f86be4e41f..73d36ab17ed 100644 --- a/src/main/java/seedu/address/logic/commands/CommandResult.java +++ b/src/main/java/seedu/address/logic/commands/CommandResult.java @@ -33,6 +33,12 @@ public class CommandResult { /** * Constructs a {@code CommandResult} with the specified fields. + * + * @param feedbackToUser + * @param showHelp + * @param exit + * @param showMemberView + * @param showSummary */ public CommandResult(String feedbackToUser, boolean showHelp, boolean exit, boolean showMemberView, boolean showSummary) { @@ -46,17 +52,26 @@ public CommandResult(String feedbackToUser, boolean showHelp, boolean exit, bool /** * Constructs a {@code CommandResult} with the specified {@code feedbackToUser}, * and other fields set to their default value. + * + * @param feedbackToUser */ public CommandResult(String feedbackToUser) { this(feedbackToUser, false, false, false, false); } + /** + * Gets feedback to user + * + * @return string for feedback to user + */ public String getFeedbackToUser() { return feedbackToUser; } /** * Determines whether the app should show help window. + * + * @return boolean */ public boolean isShowHelp() { return showHelp; @@ -64,6 +79,8 @@ public boolean isShowHelp() { /** * Determines whether the app should show member window. + * + * @return boolean */ public boolean isShowMemberView() { return showMemberView; @@ -71,6 +88,8 @@ public boolean isShowMemberView() { /** * Determines whether the app should show summary window. + * + * @return boolean */ public boolean isShowSummary() { return showSummary; @@ -78,11 +97,19 @@ public boolean isShowSummary() { /** * Determines whether the app should exit. + * + * @return boolean */ public boolean isExit() { return exit; } + /** + * Overrides the equal method. + * + * @param other + * @return boolean + */ @Override public boolean equals(Object other) { if (other == this) { @@ -102,6 +129,11 @@ public boolean equals(Object other) { && showSummary == otherCommandResult.showSummary; } + /** + * Overrides the hashCode method. + * + * @return int for hashed value + */ @Override public int hashCode() { return Objects.hash(feedbackToUser, showHelp, showMemberView, exit, showSummary); diff --git a/src/main/java/seedu/address/logic/commands/DeleteCommand.java b/src/main/java/seedu/address/logic/commands/DeleteCommand.java index 8e719db5898..3f3364e11a1 100644 --- a/src/main/java/seedu/address/logic/commands/DeleteCommand.java +++ b/src/main/java/seedu/address/logic/commands/DeleteCommand.java @@ -11,12 +11,26 @@ */ public abstract class DeleteCommand extends Command { + /** + * Stands for delete command. + */ public static final String COMMAND_WORD = "del"; + + /** + * Stands for the message of delete command from the ezFoodie. + */ public static final String MESSAGE_USAGE = COMMAND_WORD + ": Deletes a member or a transaction from the ezFoodie.\n" + "With " + PREFIX_MEMBER + " (member details) or " + PREFIX_TRANSACTION + " (transaction details)"; + /** + * Overrides and executes model. + * + * @param model {@code Model} which the command should operate on. + * @return CommandResult + * @throws CommandException + */ @Override public abstract CommandResult execute(Model model) throws CommandException; diff --git a/src/main/java/seedu/address/logic/commands/DeleteMemberCommand.java b/src/main/java/seedu/address/logic/commands/DeleteMemberCommand.java index b4306c95d42..13762ffb86e 100644 --- a/src/main/java/seedu/address/logic/commands/DeleteMemberCommand.java +++ b/src/main/java/seedu/address/logic/commands/DeleteMemberCommand.java @@ -19,8 +19,14 @@ */ public class DeleteMemberCommand extends DeleteCommand { + /** + * Stands for delete command. + */ public static final String COMMAND_WORD = "del"; + /** + * Stands for the message of delete command related to a member from the ezFoodie. + */ public static final String MESSAGE_USAGE = COMMAND_WORD + ": Deletes the member identified by the index number used in the displayed member list or member ID.\n" + "Parameters:\n" @@ -31,13 +37,18 @@ public class DeleteMemberCommand extends DeleteCommand { + "Delete by index number: " + COMMAND_WORD + " " + PREFIX_MEMBER + " " + PREFIX_INDEX + " 1\n" + "Delete by member ID: " + COMMAND_WORD + " " + PREFIX_MEMBER + " " + PREFIX_ID + " 10001"; + /** + * Stands for succeed message of delete member. + */ public static final String MESSAGE_SUCCESS = "Deleted Member: %1$s"; private final Index index; private final Id id; /** - * Creates an DeleteCommand to delete the specified {@code Member} by index number + * Creates an DeleteCommand to delete the specified {@code Member} by index number. + * + * @param index */ public DeleteMemberCommand(Index index) { requireNonNull(index); @@ -46,7 +57,9 @@ public DeleteMemberCommand(Index index) { } /** - * Creates an DeleteCommand to delete the specified {@code Member} by member ID + * Creates an DeleteCommand to delete the specified {@code Member} by member ID. + * + * @param id */ public DeleteMemberCommand(Id id) { requireNonNull(id); @@ -54,6 +67,13 @@ public DeleteMemberCommand(Id id) { index = null; } + /** + * Overrides and executes model. + * + * @param model {@code Model} which the command should operate on. + * @return CommandResult + * @throws CommandException + */ @Override public CommandResult execute(Model model) throws CommandException { requireNonNull(model); @@ -80,6 +100,12 @@ public CommandResult execute(Model model) throws CommandException { } + /** + * Overrides equals method. + * + * @param other + * @return + */ @Override public boolean equals(Object other) { return other == this // short circuit if same object diff --git a/src/main/java/seedu/address/logic/commands/DeleteReservationCommand.java b/src/main/java/seedu/address/logic/commands/DeleteReservationCommand.java index afe1b96d06d..b9e20721fde 100644 --- a/src/main/java/seedu/address/logic/commands/DeleteReservationCommand.java +++ b/src/main/java/seedu/address/logic/commands/DeleteReservationCommand.java @@ -31,8 +31,14 @@ */ public class DeleteReservationCommand extends DeleteCommand { + /** + * Stands for delete command. + */ public static final String COMMAND_WORD = "del"; + /** + * Stands for the message of delete command related to reservations. + */ public static final String MESSAGE_USAGE = COMMAND_WORD + ": Deletes the reservation identified by the member ID and reservation ID.\n" + "Parameters:\n" @@ -42,13 +48,19 @@ public class DeleteReservationCommand extends DeleteCommand { + "Delete by member ID and reservation ID: " + COMMAND_WORD + " " + PREFIX_RESERVATION + " " + PREFIX_ID + " 10001100001"; + /** + * Stands for succeed message of delete reservation. + */ public static final String MESSAGE_SUCCESS = "Deleted reservation: %1$s"; private final seedu.address.model.member.Id memberId; private final Id reservationId; /** - * Creates an DeleteCommand to delete the specified {@code Member} by member ID and transaction ID + * Constructs DeleteReservationCommand to delete the specified {@code Member} by member ID and transaction ID. + * + * @param memberId + * @param reservationId */ public DeleteReservationCommand(seedu.address.model.member.Id memberId, Id reservationId) { requireAllNonNull(memberId, reservationId); @@ -57,7 +69,11 @@ public DeleteReservationCommand(seedu.address.model.member.Id memberId, Id reser } /** - * Creates and returns a {@code Member} with the details of {@code memberToEdit} + * Creates and returns a {@code Member} with the details of {@code memberToEdit}. + * + * @param memberToEdit + * @param reservation + * @return Member with updated reservation */ private static Member createUpdatedReservation(Member memberToEdit, Reservation reservation) { assert memberToEdit != null; @@ -81,6 +97,13 @@ private static Member createUpdatedReservation(Member memberToEdit, Reservation transactions, reservations, updatedTags); } + /** + * Overrides and executes the model. + * + * @param model {@code Model} which the command should operate on. + * @return CommandResult + * @throws CommandException + */ @Override public CommandResult execute(Model model) throws CommandException { requireNonNull(model); @@ -103,6 +126,12 @@ public CommandResult execute(Model model) throws CommandException { } } + /** + * Overrides the equals method. + * + * @param other + * @return boolean + */ @Override public boolean equals(Object other) { return other == this // short circuit if same object diff --git a/src/main/java/seedu/address/logic/commands/DeleteTransactionCommand.java b/src/main/java/seedu/address/logic/commands/DeleteTransactionCommand.java index 6f35d541b98..29a54cec980 100644 --- a/src/main/java/seedu/address/logic/commands/DeleteTransactionCommand.java +++ b/src/main/java/seedu/address/logic/commands/DeleteTransactionCommand.java @@ -31,8 +31,14 @@ */ public class DeleteTransactionCommand extends DeleteCommand { + /** + * Stands for delete command. + */ public static final String COMMAND_WORD = "del"; + /** + * Stands for the message of delete command related to transaction. + */ public static final String MESSAGE_USAGE = COMMAND_WORD + ": Deletes the transaction identified by the member ID and transaction ID.\n" + "Parameters:\n" @@ -42,13 +48,19 @@ public class DeleteTransactionCommand extends DeleteCommand { + "Delete by member ID and transaction ID: " + COMMAND_WORD + " " + PREFIX_TRANSACTION + " " + PREFIX_ID + " 10001100001"; + /** + * Stands for succeed message of delete transaction. + */ public static final String MESSAGE_SUCCESS = "Deleted Transaction: %1$s"; private final seedu.address.model.member.Id memberId; private final seedu.address.model.transaction.Id transactionId; /** - * Creates an DeleteCommand to delete the specified {@code Member} by member ID and transaction ID + * Constructs an DeleteCommand to delete the specified {@code Member} by member ID and transaction ID. + * + * @param memberId + * @param transactionId */ public DeleteTransactionCommand( seedu.address.model.member.Id memberId, seedu.address.model.transaction.Id transactionId) { @@ -58,7 +70,11 @@ public DeleteTransactionCommand( } /** - * Creates and returns a {@code Member} with the details of {@code memberToEdit} + * Creates and returns a {@code Member} with the details of {@code memberToEdit}. + * + * @param memberToEdit + * @param transaction + * @return Member with added transactions and updated credits */ private static Member createUpdatedCredits(Member memberToEdit, Transaction transaction) { assert memberToEdit != null; @@ -85,6 +101,13 @@ private static Member createUpdatedCredits(Member memberToEdit, Transaction tran updatePoint, updatedTransactions, reservations, updatedTags); } + /** + * Overrides and executes the model. + * + * @param model {@code Model} which the command should operate on. + * @return CommandResult + * @throws CommandException + */ @Override public CommandResult execute(Model model) throws CommandException { requireNonNull(model); @@ -107,6 +130,12 @@ public CommandResult execute(Model model) throws CommandException { } } + /** + * Overrides the equals method + * + * @param other + * @return boolean + */ @Override public boolean equals(Object other) { return other == this // short circuit if same object diff --git a/src/main/java/seedu/address/logic/commands/EditCommand.java b/src/main/java/seedu/address/logic/commands/EditCommand.java index 7ee0785f99c..4cf5e982de5 100644 --- a/src/main/java/seedu/address/logic/commands/EditCommand.java +++ b/src/main/java/seedu/address/logic/commands/EditCommand.java @@ -11,12 +11,26 @@ */ public abstract class EditCommand extends Command { + /** + * Stands for edit command. + */ public static final String COMMAND_WORD = "edit"; + + /** + * Stands for the message of edit command. + */ public static final String MESSAGE_USAGE = COMMAND_WORD + ": Edits a member or a transaction in the ezFoodie.\n" + "With " + PREFIX_MEMBER + " (member details) or " + PREFIX_TRANSACTION + " (transaction details)"; + /** + * Overrides the executes command. + * + * @param model {@code Model} which the command should operate on. + * @return + * @throws CommandException + */ @Override public abstract CommandResult execute(Model model) throws CommandException; diff --git a/src/main/java/seedu/address/logic/commands/EditMemberCommand.java b/src/main/java/seedu/address/logic/commands/EditMemberCommand.java index fc9b72503c8..c3e21ded799 100644 --- a/src/main/java/seedu/address/logic/commands/EditMemberCommand.java +++ b/src/main/java/seedu/address/logic/commands/EditMemberCommand.java @@ -40,8 +40,14 @@ */ public class EditMemberCommand extends EditCommand { + /** + * Stands for edit command. + */ public static final String COMMAND_WORD = "edit"; + /** + * Stands for the message of edit command. + */ public static final String MESSAGE_USAGE = COMMAND_WORD + ": Edits the details of the member identified " + "by the index number used in the displayed member list or the member ID. " + "Existing values will be overwritten by the input values.\n" @@ -67,8 +73,19 @@ public class EditMemberCommand extends EditCommand { + PREFIX_PHONE + " 91234567 " + PREFIX_EMAIL + " johndoe@example.com"; + /** + * Stands for succeed message of edit member. + */ public static final String MESSAGE_SUCCESS = "Edited Member: %1$s"; + + /** + * Stands for message of not edited which need fields provided. + */ public static final String MESSAGE_NOT_EDITED = "At least one field to edit must be provided."; + + /** + * Stands for message of duplicate message. + */ public static final String MESSAGE_DUPLICATE_MEMBER = "This member already exists in the ezFoodie."; private final Index index; @@ -76,6 +93,8 @@ public class EditMemberCommand extends EditCommand { private final EditMemberDescriptor editMemberDescriptor; /** + * Constructs EditMemberCommand to edit member by index. + * * @param index of the member in the updated member list to edit * @param editMemberDescriptor details to edit the member with */ @@ -89,6 +108,8 @@ public EditMemberCommand(Index index, EditMemberDescriptor editMemberDescriptor) } /** + * Constructs EditMemberCommand to edit member by member id. + * * @param id of the member in the updated member list to edit * @param editMemberDescriptor details to edit the member with */ @@ -101,6 +122,13 @@ public EditMemberCommand(Id id, EditMemberDescriptor editMemberDescriptor) { this.editMemberDescriptor = new EditMemberDescriptor(editMemberDescriptor); } + /** + * Overrides and executes model. + * + * @param model {@code Model} which the command should operate on. + * @return CommandResult + * @throws CommandException + */ @Override public CommandResult execute(Model model) throws CommandException { requireNonNull(model); @@ -134,6 +162,10 @@ public CommandResult execute(Model model) throws CommandException { /** * Creates and returns a {@code Member} with the details of {@code memberToEdit} * edited with {@code editMemberDescriptor}. + * + * @param memberToEdit + * @param editMemberDescriptor + * @return Member with edited member */ private static Member createEditedMember(Member memberToEdit, EditMemberDescriptor editMemberDescriptor) { assert memberToEdit != null; @@ -154,6 +186,12 @@ private static Member createEditedMember(Member memberToEdit, EditMemberDescript transactions, reservations, updatedTags); } + /** + * Overrides the equals method. + * + * @param other + * @return boolean + */ @Override public boolean equals(Object other) { return other == this // short circuit if same object @@ -195,34 +233,74 @@ public boolean isAnyFieldEdited() { return CollectionUtil.isAnyNonNull(name, phone, email, address, tags); } + /** + * Sets name. + * + * @param name + */ public void setName(Name name) { this.name = name; } + /** + * Gets name. + * + * @return Optional + */ public Optional getName() { return Optional.ofNullable(name); } + /** + * Sets phone. + * + * @param phone + */ public void setPhone(Phone phone) { this.phone = phone; } + /** + * Gets phone. + * + * @return Optional + */ public Optional getPhone() { return Optional.ofNullable(phone); } + /** + * Sets email. + * + * @param email + */ public void setEmail(Email email) { this.email = email; } + /** + * Gets email. + * + * @return Optional + */ public Optional getEmail() { return Optional.ofNullable(email); } + /** + * Sets address. + * + * @param address + */ public void setAddress(Address address) { this.address = address; } + /** + * Gets address. + * + * @return Optional
+ */ public Optional
getAddress() { return Optional.ofNullable(address); } @@ -230,6 +308,8 @@ public Optional
getAddress() { /** * Sets {@code tags} to this object's {@code tags}. * A defensive copy of {@code tags} is used internally. + * + * @param tags */ public void setTags(Set tags) { this.tags = (tags != null) ? new HashSet<>(tags) : null; @@ -244,6 +324,12 @@ public Optional> getTags() { return (tags != null) ? Optional.of(Collections.unmodifiableSet(tags)) : Optional.empty(); } + /** + * Overrides the equal method. + * + * @param other + * @return boolean + */ @Override public boolean equals(Object other) { // short circuit if same object diff --git a/src/main/java/seedu/address/logic/commands/EditReservationCommand.java b/src/main/java/seedu/address/logic/commands/EditReservationCommand.java index d7529433ffe..542eafa2209 100644 --- a/src/main/java/seedu/address/logic/commands/EditReservationCommand.java +++ b/src/main/java/seedu/address/logic/commands/EditReservationCommand.java @@ -36,8 +36,14 @@ */ public class EditReservationCommand extends EditCommand { + /** + * Stands for edit command. + */ public static final String COMMAND_WORD = "edit"; + /** + * Stands for the message of edit reservation command. + */ public static final String MESSAGE_USAGE = COMMAND_WORD + ": Edits the details of the reservation identified " + "by the member ID and reservation ID. " + "Existing values will be overwritten by the input values.\n" @@ -52,14 +58,22 @@ public class EditReservationCommand extends EditCommand { + PREFIX_DATE_TIME + " 2021-12-01 13:00" + PREFIX_REMARK + " 3 people"; + /** + * Stands for succeed message of edit member + */ public static final String MESSAGE_SUCCESS = "Edited Member: %1$s"; - public static final String MESSAGE_NOT_EDITED = "At least one field to edit must be provided."; + /** + * Stands for message of not edited which need fields provided. + */ + public static final String MESSAGE_NOT_EDITED = "At least one field to edit must be provided."; private final seedu.address.model.member.Id memberId; private final seedu.address.model.reservation.Id reservationId; private final EditReservationDescriptor editReservationDescriptor; /** + * Constructs the EditReservationCommand + * * @param memberId of the member in the updated member list to edit * @param reservationId of the reservation in the reservation list to edit * @param editReservationDescriptor details to edit the reservation with @@ -76,6 +90,11 @@ public EditReservationCommand( /** * Creates and returns a {@code Member} with the details of {@code memberToEdit} + * + * @param memberToEdit + * @param reservationToEdit + * @param editReservationDescriptor + * @return member with updated credits */ private static Member createUpdatedCredits( Member memberToEdit, Reservation reservationToEdit, EditReservationDescriptor editReservationDescriptor) { @@ -107,6 +126,13 @@ private static Member createUpdatedCredits( transactions, updatedReservations, updatedTags); } + /** + * Overrides and executes the model. + * + * @param model {@code Model} which the command should operate on. + * @return CommandResult + * @throws CommandException + */ @Override public CommandResult execute(Model model) throws CommandException { requireNonNull(model); @@ -129,6 +155,12 @@ public CommandResult execute(Model model) throws CommandException { } } + /** + * Overrides the equal method. + * + * @param other + * @return boolean + */ @Override public boolean equals(Object other) { return other == this // short circuit if same object @@ -147,6 +179,9 @@ public static class EditReservationDescriptor { private DateTime dateTime; private Remark remark; + /** + * Constructs the EditReservationDescriptor without input + */ public EditReservationDescriptor() {} /** @@ -160,27 +195,55 @@ public EditReservationDescriptor(EditReservationDescriptor toCopy) { /** * Returns true if at least one field is edited. + * + * @return boolean */ public boolean isAnyFieldEdited() { return CollectionUtil.isAnyNonNull(dateTime, remark); } + /** + * Sets DateTime. + * + * @param dateTime + */ public void setDateTime(DateTime dateTime) { this.dateTime = dateTime; } + /** + * Gets dateTime. + * + * @return dateTime + */ public Optional getDateTime() { return Optional.ofNullable(dateTime); } + /** + * Sets remark. + * + * @param remark + */ public void setRemark(Remark remark) { this.remark = remark; } + /** + * Gets remark. + * + * @return Optional + */ public Optional getRemark() { return Optional.ofNullable(remark); } + /** + * Override the equal method. + * + * @param other + * @return boolean + */ @Override public boolean equals(Object other) { // short circuit if same object diff --git a/src/main/java/seedu/address/logic/commands/EditTransactionCommand.java b/src/main/java/seedu/address/logic/commands/EditTransactionCommand.java index b13457c67d8..12a9d687d48 100644 --- a/src/main/java/seedu/address/logic/commands/EditTransactionCommand.java +++ b/src/main/java/seedu/address/logic/commands/EditTransactionCommand.java @@ -34,8 +34,14 @@ */ public class EditTransactionCommand extends EditCommand { + /** + * Stands for edit command. + */ public static final String COMMAND_WORD = "edit"; + /** + * Stands for the message of edit command for edit transaction. + */ public static final String MESSAGE_USAGE = COMMAND_WORD + ": Edits the details of the transaction identified " + "by the member ID and transaction ID. " + "Existing values will be overwritten by the input values.\n" @@ -48,7 +54,14 @@ public class EditTransactionCommand extends EditCommand { + COMMAND_WORD + " " + PREFIX_TRANSACTION + " " + PREFIX_ID + " 10001100001 " + PREFIX_BILLING + " 123.45"; + /** + * Stands for succeed message of edit member. + */ public static final String MESSAGE_SUCCESS = "Edited Member: %1$s"; + + /** + * Stands for message of not edited which need fields provided. + */ public static final String MESSAGE_NOT_EDITED = "At least one field to edit must be provided."; private final seedu.address.model.member.Id memberId; @@ -56,6 +69,8 @@ public class EditTransactionCommand extends EditCommand { private final EditTransactionDescriptor editTransactionDescriptor; /** + * Constructs EditTransactionCommand. + * * @param memberId of the member in the updated member list to edit * @param transactionId of the transaction in the transaction list to edit * @param editTransactionDescriptor details to edit the transaction with @@ -71,7 +86,12 @@ public EditTransactionCommand( } /** - * Creates and returns a {@code Member} with the details of {@code memberToEdit} + * Creates and returns a {@code Member} with the details of {@code memberToEdit}. + * + * @param memberToEdit + * @param transactionToEdit + * @param editTransactionDescriptor + * @return member with updated credits */ private static Member createUpdatedCredits( Member memberToEdit, Transaction transactionToEdit, EditTransactionDescriptor editTransactionDescriptor) { @@ -109,6 +129,13 @@ private static Member createUpdatedCredits( updatePoint, updatedTransactions, reservations, updatedTags); } + /** + * Overrides and executes model + * + * @param model {@code Model} which the command should operate on. + * @return CommandResult + * @throws CommandException + */ @Override public CommandResult execute(Model model) throws CommandException { requireNonNull(model); @@ -131,6 +158,12 @@ public CommandResult execute(Model model) throws CommandException { } } + /** + * Overrides the equals method. + * + * @param other + * @return boolean + */ @Override public boolean equals(Object other) { return other == this // short circuit if same object @@ -167,22 +200,48 @@ public boolean isAnyFieldEdited() { return CollectionUtil.isAnyNonNull(timestamp, billing); } + /** + * Sets time stamp. + * + * @param timestamp + */ public void setTimestamp(Timestamp timestamp) { this.timestamp = timestamp; } + /** + * Gets time stamp + * + * @return Optional + */ public Optional getTimestamp() { return Optional.ofNullable(timestamp); } + /** + * Sets Billing + * + * @param billing + */ public void setBilling(Billing billing) { this.billing = billing; } + /** + * Gets billing + * + * @return Optional + */ public Optional getBilling() { return Optional.ofNullable(billing); } + /** + * Overrides the equals method. + * + * @param other + * @return boolean + */ @Override public boolean equals(Object other) { // short circuit if same object diff --git a/src/main/java/seedu/address/logic/commands/ExitCommand.java b/src/main/java/seedu/address/logic/commands/ExitCommand.java index c46ca05a216..4f8c7653f14 100644 --- a/src/main/java/seedu/address/logic/commands/ExitCommand.java +++ b/src/main/java/seedu/address/logic/commands/ExitCommand.java @@ -7,10 +7,22 @@ */ public class ExitCommand extends Command { + /** + * Stands for exit command. + */ public static final String COMMAND_WORD = "exit"; + /** + * Stands for the message of exit success command. + */ public static final String MESSAGE_EXIT_ACKNOWLEDGEMENT = "Exiting ezFoodie as requested ..."; + /** + * Overrides and executes the model + * + * @param model {@code Model} which the command should operate on. + * @return CommandResult + */ @Override public CommandResult execute(Model model) { return new CommandResult(MESSAGE_EXIT_ACKNOWLEDGEMENT, false, true, false, false); diff --git a/src/main/java/seedu/address/logic/commands/FindCommand.java b/src/main/java/seedu/address/logic/commands/FindCommand.java index 9854e87cbed..bc9bab515d8 100644 --- a/src/main/java/seedu/address/logic/commands/FindCommand.java +++ b/src/main/java/seedu/address/logic/commands/FindCommand.java @@ -25,8 +25,14 @@ */ public class FindCommand extends Command { + /** + * Stands for find command. + */ public static final String COMMAND_WORD = "find"; + /** + * Stands for the message of find command. + */ public static final String MESSAGE_USAGE = COMMAND_WORD + ": Finds all members whose ids, names, phones or emails contain any of " + "the specified keywords (case-insensitive) or within a specific of registration dates " @@ -47,26 +53,57 @@ public class FindCommand extends Command { private final Predicate predicate; + /** + * Constructs FindCommand through Id. + * + * @param predicate + */ public FindCommand(IdContainsKeywordsPredicate predicate) { this.predicate = predicate; } + /** + * Constructs FindCommand through Name. + * + * @param predicate + */ public FindCommand(NameContainsKeywordsPredicate predicate) { this.predicate = predicate; } + /** + * Constructs FindCommand through Phone. + * + * @param predicate + */ public FindCommand(PhoneContainsKeywordsPredicate predicate) { this.predicate = predicate; } + /** + * Constructs FindCommand through Email. + * + * @param predicate + */ public FindCommand(EmailContainsKeywordsPredicate predicate) { this.predicate = predicate; } + /** + * Constructs FindCommand through RegistrationDate. + * + * @param predicate + */ public FindCommand(RegistrationDateContainsKeywordsPredicate predicate) { this.predicate = predicate; } + /** + * Overrides and executes model. + * + * @param model {@code Model} which the command should operate on. + * @return CommandResult + */ @Override public CommandResult execute(Model model) { requireNonNull(model); @@ -75,6 +112,12 @@ public CommandResult execute(Model model) { String.format(Messages.MESSAGE_MEMBERS_LISTED_OVERVIEW, model.getUpdatedMemberList().size())); } + /** + * Overrides the equals method. + * + * @param other + * @return boolean + */ @Override public boolean equals(Object other) { return other == this // short circuit if same object diff --git a/src/main/java/seedu/address/logic/commands/HelpCommand.java b/src/main/java/seedu/address/logic/commands/HelpCommand.java index 492a3633fbd..b6b0d261df9 100644 --- a/src/main/java/seedu/address/logic/commands/HelpCommand.java +++ b/src/main/java/seedu/address/logic/commands/HelpCommand.java @@ -7,13 +7,28 @@ */ public class HelpCommand extends Command { + /** + * Stands for help command. + */ public static final String COMMAND_WORD = "help"; + /** + * Stands for the message of help command. + */ public static final String MESSAGE_USAGE = COMMAND_WORD + ": Shows program usage instructions.\n" + "Example: " + COMMAND_WORD; + /** + * Stands for the message of help command and show help window. + */ public static final String SHOWING_HELP_MESSAGE = "Opened help window."; + /** + * Overrides and executes the model. + * + * @param model {@code Model} which the command should operate on. + * @return CommandResult + */ @Override public CommandResult execute(Model model) { return new CommandResult(SHOWING_HELP_MESSAGE, true, false, false, false); diff --git a/src/main/java/seedu/address/logic/commands/ListCommand.java b/src/main/java/seedu/address/logic/commands/ListCommand.java index 3a1911d4800..7f9ddb640ec 100644 --- a/src/main/java/seedu/address/logic/commands/ListCommand.java +++ b/src/main/java/seedu/address/logic/commands/ListCommand.java @@ -11,16 +11,30 @@ */ public class ListCommand extends Command { + /** + * Stands for list command. + */ public static final String COMMAND_WORD = "list"; + /** + * Stands for the message of list command. + */ public static final String MESSAGE_USAGE = COMMAND_WORD + ": Lists out all members.\n" + "Parameters: " + PREFIX_MEMBER + "\n" + "Example: " + COMMAND_WORD + " " + PREFIX_MEMBER; + /** + * Stands for the message success listed + */ public static final String MESSAGE_SUCCESS = "Listed all members"; - + /** + * Overrides and Executes the model. + * + * @param model {@code Model} which the command should operate on. + * @return CommandResult + */ @Override public CommandResult execute(Model model) { requireNonNull(model); @@ -28,6 +42,12 @@ public CommandResult execute(Model model) { return new CommandResult(MESSAGE_SUCCESS); } + /** + * Overrides the equals method. + * + * @param other + * @return boolean + */ @Override public boolean equals(Object other) { return other instanceof ListCommand; diff --git a/src/main/java/seedu/address/logic/commands/LoginCommand.java b/src/main/java/seedu/address/logic/commands/LoginCommand.java index 41f621ba0ef..6199a7faef2 100644 --- a/src/main/java/seedu/address/logic/commands/LoginCommand.java +++ b/src/main/java/seedu/address/logic/commands/LoginCommand.java @@ -9,24 +9,52 @@ */ public class LoginCommand extends Command { + /** + * Stands for login command. + */ public static final String COMMAND_WORD = "login"; + /** + * Stands for the message of login command. + */ public static final String MESSAGE_USAGE = COMMAND_WORD + ": Logs in as a manager by password.\n" + "Parameters: PASSWORD (case-sensitive and must be not empty, default by " + Password.DEFAULT_PLAINTEXT_PASSWORD + ")\n" + "Example: " + COMMAND_WORD + " " + Password.DEFAULT_PLAINTEXT_PASSWORD; + /** + * Stands for the message of login successfully. + */ public static final String MESSAGE_SUCCESS = "Logged in successfully!"; + + /** + * Stands for the message of login failed. + */ public static final String MESSAGE_FAILURE = "Failed to login!"; + + /** + * Stands for the message of login status. + */ public static final String MESSAGE_ALREADY_IN_STATUS = "You are already in MANAGER login status!"; private final Password password; + /** + * Constructs LoginCommand + * + * @param password + */ public LoginCommand(Password password) { this.password = password; } + /** + * Overrides and executes the model + * + * @param model {@code Model} which the command should operate on. + * @return CommandResult + */ @Override public CommandResult execute(Model model) { if (LoginStatus.getLoginStatus() == LoginStatus.MANAGER) { diff --git a/src/main/java/seedu/address/logic/commands/LogoutCommand.java b/src/main/java/seedu/address/logic/commands/LogoutCommand.java index 52a464c08fd..21e5e465e5a 100644 --- a/src/main/java/seedu/address/logic/commands/LogoutCommand.java +++ b/src/main/java/seedu/address/logic/commands/LogoutCommand.java @@ -11,10 +11,27 @@ */ public class LogoutCommand extends Command { + /** + * Stands for logout command. + */ public static final String COMMAND_WORD = "logout"; + + /** + * Stands for the message of logout successfully. + */ public static final String MESSAGE_SUCCESS = "Logged out successfully!"; + + /** + * Stands for the message of logout status. + */ public static final String MESSAGE_ALREADY_IN_STATUS = "You are already in STAFF login status!"; + /** + * Overrides and executes the model. + * + * @param model {@code Model} which the command should operate on. + * @return CommandResult + */ @Override public CommandResult execute(Model model) { requireNonNull(model); diff --git a/src/main/java/seedu/address/logic/commands/RedeemCommand.java b/src/main/java/seedu/address/logic/commands/RedeemCommand.java index a5f4d077905..ffa6c945629 100644 --- a/src/main/java/seedu/address/logic/commands/RedeemCommand.java +++ b/src/main/java/seedu/address/logic/commands/RedeemCommand.java @@ -28,10 +28,19 @@ import seedu.address.model.tag.Tag; import seedu.address.model.transaction.Transaction; +/** + * Redeems point from an existing member in the ezFoodie. + */ public class RedeemCommand extends Command { + /** + * Stands for redeem command. + */ public static final String COMMAND_WORD = "redeem"; + /** + * Stands for the message of redeem command. + */ public static final String MESSAGE_USAGE = COMMAND_WORD + ": Redeems points from member id in the ezFoodie. " + "Parameters: " + PREFIX_REDEEM + " [points]" @@ -46,8 +55,19 @@ public class RedeemCommand extends Command { + PREFIX_REDEEM + " 100 " + PREFIX_INDEX + " 1\n"; + /** + * Stands for message for redeem points successfully. + */ public static final String MESSAGE_SUCCESS_REDEMPTION = "Redemption is done"; + + /** + * Stands for message for duplicate member. + */ public static final String MESSAGE_DUPLICATE_MEMBER = "This member already exists in the ezFoodie."; + + /** + * Stands for message when redemption point exceed. + */ public static final String MESSAGE_INVALID_POINTS_LESS_THAN_ZERO = "Redeemed point has already exceeded\n" + "Points can't redeemed less than 0\n" + "Please try again"; @@ -57,7 +77,10 @@ public class RedeemCommand extends Command { private final Index indexToRedeem; /** - * Creates an redeemPointsCommand to add the specified {@code Member} + * Constructs an RedeemCommand to add the specified {@code Member} by id. + * + * @param pointsToRedeemList + * @param id */ public RedeemCommand(List pointsToRedeemList, Id id) { requireAllNonNull(pointsToRedeemList, id); @@ -67,7 +90,10 @@ public RedeemCommand(List pointsToRedeemList, Id id) { } /** - * Creates an redeemPointsCommand to add the specified {@code Member} + * Constructs an RedeemCommand to add the specified {@code Member} by index. + * + * @param pointsToRedeemList + * @param index */ public RedeemCommand(List pointsToRedeemList, Index index) { requireAllNonNull(pointsToRedeemList, index); @@ -76,6 +102,13 @@ public RedeemCommand(List pointsToRedeemList, Index index) { this.idToRedeem = null; } + /** + * Overrides and executes the model. + * + * @param model {@code Model} which the command should operate on. + * @return CommandResult + * @throws CommandException + */ @Override public CommandResult execute(Model model) throws CommandException { requireNonNull(model); @@ -109,6 +142,11 @@ public CommandResult execute(Model model) throws CommandException { /** * Creates and returns a {@code Member} with the details of {@code memberToEdit} * edited with {@code editMemberDescriptor}. + * + * @param memberToRedeemPoints + * @param toRedeemPointsList + * @return Member with redeemed Points + * @throws CommandException */ private static Member createToRedeemPointsMember(Member memberToRedeemPoints, List toRedeemPointsList) throws CommandException { diff --git a/src/main/java/seedu/address/logic/commands/SortCommand.java b/src/main/java/seedu/address/logic/commands/SortCommand.java index 2fd4ae6b133..d917e713bf4 100644 --- a/src/main/java/seedu/address/logic/commands/SortCommand.java +++ b/src/main/java/seedu/address/logic/commands/SortCommand.java @@ -15,8 +15,14 @@ */ public class SortCommand extends Command { + /** + * Stands for sort command. + */ public static final String COMMAND_WORD = "sort"; + /** + * Stands for the message of Sort command. + */ public static final String MESSAGE_USAGE = COMMAND_WORD + ": Sorts all members by credit in ascending or descending " + "and displays them as a list with index numbers.\n" @@ -29,15 +35,33 @@ public class SortCommand extends Command { + "Sort credit in descending: " + COMMAND_WORD + " " + PREFIX_MEMBER + " " + PREFIX_CREDIT + " " + PREFIX_DESC; + /** + * Stands for the message of sorted in ascending. + */ public static final String MESSAGE_SORT_ASC = "Members sorted by credit in ascending!"; + + /** + * Stands for the message of sorted in descending. + */ public static final String MESSAGE_SORT_DESC = "Members sorted by credit in descending!"; private final CreditSortComparator comparator; + /** + * Constructs SortCommand。 + * + * @param comparator + */ public SortCommand(CreditSortComparator comparator) { this.comparator = comparator; } + /** + * Overrides and executes the model. + * + * @param model {@code Model} which the command should operate on. + * @return CommandResult + */ @Override public CommandResult execute(Model model) { requireNonNull(model); @@ -49,6 +73,12 @@ public CommandResult execute(Model model) { } } + /** + * Overrides the equals method. + * + * @param other + * @return + */ @Override public boolean equals(Object other) { return other == this // short circuit if same object diff --git a/src/main/java/seedu/address/logic/commands/SummaryCommand.java b/src/main/java/seedu/address/logic/commands/SummaryCommand.java index adc6e56b018..1a567f3a2a4 100644 --- a/src/main/java/seedu/address/logic/commands/SummaryCommand.java +++ b/src/main/java/seedu/address/logic/commands/SummaryCommand.java @@ -11,14 +11,29 @@ */ public class SummaryCommand extends Command { + /** + * Stands for summary command. + */ public static final String COMMAND_WORD = "summary"; + /** + * Stands for the message of summary command. + */ public static final String MESSAGE_USAGE = COMMAND_WORD + ": Shows summary for members and transactions.\n" + "Example: " + COMMAND_WORD; + /** + * Stands for the message of open summary window successfully. + */ public static final String SHOWING_SUMMARY_MESSAGE = "Opened summary window."; + /** + * Overrides and executes model. + * + * @param model {@code Model} which the command should operate on. + * @return CommandResult + */ @Override public CommandResult execute(Model model) { requireNonNull(model); @@ -26,6 +41,12 @@ public CommandResult execute(Model model) { false, false, false, true); } + /** + * Overrides the equals method. + * + * @param other + * @return boolean + */ @Override public boolean equals(Object other) { return other == this diff --git a/src/main/java/seedu/address/logic/commands/ViewCommand.java b/src/main/java/seedu/address/logic/commands/ViewCommand.java index ec44e7e327d..9ec7508d25b 100644 --- a/src/main/java/seedu/address/logic/commands/ViewCommand.java +++ b/src/main/java/seedu/address/logic/commands/ViewCommand.java @@ -15,10 +15,19 @@ */ public class ViewCommand extends Command { + /** + * Stands for view command. + */ public static final String COMMAND_WORD = "show"; + /** + * Stands for the message of open view window successfully. + */ public static final String SHOWING_VIEW_MESSAGE = "Opened view window."; + /** + * Stands for the message of show and view command. + */ public static final String MESSAGE_USAGE = COMMAND_WORD + ": View a specific member's details, " + "accessed by member ID.\n" @@ -31,12 +40,19 @@ public class ViewCommand extends Command { /** * Construct the view command based on member id predicate. + * * @param predicate */ public ViewCommand(IdContainsKeywordsPredicate predicate) { this.predicate = predicate; } + /** + * Overrides and executes the model. + * + * @param model {@code Model} which the command should operate on. + * @return CommandResult + */ @Override public CommandResult execute(Model model) { requireNonNull(model); @@ -44,6 +60,12 @@ public CommandResult execute(Model model) { return new CommandResult(SHOWING_VIEW_MESSAGE, false, false, true, false); } + /** + * Override the equals method + * + * @param other + * @return boolean + */ @Override public boolean equals(Object other) { return other == this // short circuit if same object diff --git a/src/main/java/seedu/address/logic/commands/exceptions/CommandException.java b/src/main/java/seedu/address/logic/commands/exceptions/CommandException.java index a16bd14f2cd..c99e6a64bf0 100644 --- a/src/main/java/seedu/address/logic/commands/exceptions/CommandException.java +++ b/src/main/java/seedu/address/logic/commands/exceptions/CommandException.java @@ -1,15 +1,26 @@ package seedu.address.logic.commands.exceptions; +import seedu.address.logic.commands.Command; + /** * Represents an error which occurs during execution of a {@link Command}. */ public class CommandException extends Exception { + + /** + * Constructs a new {@code CommandException} with the specified detail {@code message}. + * + * @param message + */ public CommandException(String message) { super(message); } /** * Constructs a new {@code CommandException} with the specified detail {@code message} and {@code cause}. + * + * @param message + * @param cause */ public CommandException(String message, Throwable cause) { super(message, cause); diff --git a/src/main/java/seedu/address/logic/parser/AddCommandParser.java b/src/main/java/seedu/address/logic/parser/AddCommandParser.java index 2b123d057d9..a8fcbf622f9 100644 --- a/src/main/java/seedu/address/logic/parser/AddCommandParser.java +++ b/src/main/java/seedu/address/logic/parser/AddCommandParser.java @@ -11,6 +11,9 @@ public abstract class AddCommandParser { /** * Parses the given {@code String} of arguments in the context of the AddCommand * and returns an AddCommand object for execution. + * + * @param args + * @return AddCommand * @throws ParseException if the user input does not conform the expected format */ public abstract AddCommand parse(String args) throws ParseException; diff --git a/src/main/java/seedu/address/logic/parser/AddMemberCommandParser.java b/src/main/java/seedu/address/logic/parser/AddMemberCommandParser.java index c8fdb3fad13..a4e1f8152fe 100644 --- a/src/main/java/seedu/address/logic/parser/AddMemberCommandParser.java +++ b/src/main/java/seedu/address/logic/parser/AddMemberCommandParser.java @@ -65,6 +65,9 @@ private String generateIdStub() { /** * Parses the given {@code String} of arguments in the context of the AddMemberCommand * and returns an AddMemberCommand object for execution. + * + * @param args + * @return AddMember * @throws ParseException if the user input does not conform the expected format */ @Override diff --git a/src/main/java/seedu/address/logic/parser/AddReservationCommandParser.java b/src/main/java/seedu/address/logic/parser/AddReservationCommandParser.java index 9b48cb3bfe4..bcc1422eef4 100644 --- a/src/main/java/seedu/address/logic/parser/AddReservationCommandParser.java +++ b/src/main/java/seedu/address/logic/parser/AddReservationCommandParser.java @@ -58,6 +58,9 @@ private String generateIdStub() { /** * Parses the given {@code String} of arguments in the context of the AddReservationCommand * and returns an AddReservationCommand object for execution. + * + * @param args + * @return AddReservationCommand * @throws ParseException if the user input does not conform the expected format */ @Override diff --git a/src/main/java/seedu/address/logic/parser/AddTransactionCommandParser.java b/src/main/java/seedu/address/logic/parser/AddTransactionCommandParser.java index 5641717bf57..11311aaaea2 100644 --- a/src/main/java/seedu/address/logic/parser/AddTransactionCommandParser.java +++ b/src/main/java/seedu/address/logic/parser/AddTransactionCommandParser.java @@ -60,6 +60,9 @@ private String generateIdStub() { /** * Parses the given {@code String} of arguments in the context of the AddTransactionCommand * and returns an AddTransactionCommand object for execution. + * + * @param args + * @return AddTransactionCommand * @throws ParseException if the user input does not conform the expected format */ @Override diff --git a/src/main/java/seedu/address/logic/parser/CliSyntax.java b/src/main/java/seedu/address/logic/parser/CliSyntax.java index 960391a411a..d41cc81f417 100644 --- a/src/main/java/seedu/address/logic/parser/CliSyntax.java +++ b/src/main/java/seedu/address/logic/parser/CliSyntax.java @@ -6,25 +6,95 @@ public class CliSyntax { /* Prefix definitions */ + /** + * Stands for PREFIX_MEMBER. + */ public static final Prefix PREFIX_MEMBER = new Prefix("-mem"); + + /** + * Stands for PREFIX_ID. + */ public static final Prefix PREFIX_ID = new Prefix("-id"); + + /** + * Stands for PREFIX_INDEX. + */ public static final Prefix PREFIX_INDEX = new Prefix("-row"); + + /** + * Stands for PREFIX_NAME. + */ public static final Prefix PREFIX_NAME = new Prefix("-n"); + + /** + * Stands for PREFIX_PHONE. + */ public static final Prefix PREFIX_PHONE = new Prefix("-p"); + + /** + * Stands for PREFIX_EMAIL. + */ public static final Prefix PREFIX_EMAIL = new Prefix("-e"); + + /** + * Stands for PREFIX_ADDRESS. + */ public static final Prefix PREFIX_ADDRESS = new Prefix("-a"); + + /** + * Stands for PREFIX_DATE. + */ public static final Prefix PREFIX_DATE = new Prefix("-date"); + + /** + * Stands for PREFIX_CREDIT. + */ public static final Prefix PREFIX_CREDIT = new Prefix("-c"); + + /** + * Stands for PREFIX_REDEEM. + */ public static final Prefix PREFIX_REDEEM = new Prefix("-f"); + + /** + * Stands for PREFIX_TRANSACTION. + */ public static final Prefix PREFIX_TRANSACTION = new Prefix("-txn"); + + /** + * Stands for PREFIX_BILLING. + */ public static final Prefix PREFIX_BILLING = new Prefix("-b"); + + /** + * Stands for PREFIX_RESERVATION. + */ public static final Prefix PREFIX_RESERVATION = new Prefix("-rsvn"); + + /** + * Stands for PREFIX_DATE_TIME. + */ public static final Prefix PREFIX_DATE_TIME = new Prefix("-time"); + + /** + * Stands for PREFIX_REMARK. + */ public static final Prefix PREFIX_REMARK = new Prefix("-rm"); + + /** + * Stands for PREFIX_TAG. + */ public static final Prefix PREFIX_TAG = new Prefix("-tag"); /* Only used in sort command */ + /** + * Stands for PREFIX_ASC. + */ public static final Prefix PREFIX_ASC = new Prefix("-a"); + + /** + * Stands for PREFIX_DESC. + */ public static final Prefix PREFIX_DESC = new Prefix("-d"); } diff --git a/src/main/java/seedu/address/logic/parser/DeleteMemberCommandParser.java b/src/main/java/seedu/address/logic/parser/DeleteMemberCommandParser.java index 711f4c29f8d..6100c65232c 100644 --- a/src/main/java/seedu/address/logic/parser/DeleteMemberCommandParser.java +++ b/src/main/java/seedu/address/logic/parser/DeleteMemberCommandParser.java @@ -21,6 +21,9 @@ public class DeleteMemberCommandParser extends DeleteCommandParser implements Pa /** * Parses the given {@code String} of arguments in the context of the DeleteMemberCommand * and returns a DeleteMemberCommand object for execution. + * + * @param args + * @return DeleteMemberCommand * @throws ParseException if the user input does not conform the expected format */ public DeleteMemberCommand parse(String args) throws ParseException { diff --git a/src/main/java/seedu/address/logic/parser/DeleteReservationCommandParser.java b/src/main/java/seedu/address/logic/parser/DeleteReservationCommandParser.java index b47fe19c779..b378013f7ce 100644 --- a/src/main/java/seedu/address/logic/parser/DeleteReservationCommandParser.java +++ b/src/main/java/seedu/address/logic/parser/DeleteReservationCommandParser.java @@ -15,10 +15,12 @@ * Parses input arguments and creates a new DeleteReservationCommand object */ public class DeleteReservationCommandParser extends DeleteCommandParser implements Parser { - /** * Parses the given {@code String} of arguments in the context of the DeleteReservationCommand * and returns a DeleteReservationCommand object for execution. + * + * @param args + * @return DeleteReservationCommand * @throws ParseException if the user input does not conform the expected format */ public DeleteReservationCommand parse(String args) throws ParseException { diff --git a/src/main/java/seedu/address/logic/parser/DeleteTransactionCommandParser.java b/src/main/java/seedu/address/logic/parser/DeleteTransactionCommandParser.java index 5a59e86f80b..200e1214269 100644 --- a/src/main/java/seedu/address/logic/parser/DeleteTransactionCommandParser.java +++ b/src/main/java/seedu/address/logic/parser/DeleteTransactionCommandParser.java @@ -18,6 +18,9 @@ public class DeleteTransactionCommandParser extends DeleteCommandParser implemen /** * Parses the given {@code String} of arguments in the context of the DeleteTransactionCommand * and returns a DeleteTransactionCommand object for execution. + * + * @param args + * @return DeleteTransactionCommand * @throws ParseException if the user input does not conform the expected format */ public DeleteTransactionCommand parse(String args) throws ParseException { diff --git a/src/main/java/seedu/address/logic/parser/EditCommandParser.java b/src/main/java/seedu/address/logic/parser/EditCommandParser.java index 078b99ea6fb..d34644cf73f 100644 --- a/src/main/java/seedu/address/logic/parser/EditCommandParser.java +++ b/src/main/java/seedu/address/logic/parser/EditCommandParser.java @@ -11,6 +11,9 @@ public abstract class EditCommandParser { /** * Parses the given {@code String} of arguments in the context of the EditCommand * and returns an EditCommand object for execution. + * + * @param args + * @return EditCommand * @throws ParseException if the user input does not conform the expected format */ public abstract EditCommand parse(String args) throws ParseException; diff --git a/src/main/java/seedu/address/logic/parser/EditMemberCommandParser.java b/src/main/java/seedu/address/logic/parser/EditMemberCommandParser.java index 9f5397219b6..f783512135d 100644 --- a/src/main/java/seedu/address/logic/parser/EditMemberCommandParser.java +++ b/src/main/java/seedu/address/logic/parser/EditMemberCommandParser.java @@ -33,6 +33,9 @@ public class EditMemberCommandParser extends EditCommandParser implements Parser /** * Parses the given {@code String} of arguments in the context of the EditMemberCommand * and returns an EditMemberCommand object for execution. + * + * @param args + * @return EditMemberCommand * @throws ParseException if the user input does not conform the expected format */ public EditMemberCommand parse(String args) throws ParseException { diff --git a/src/main/java/seedu/address/logic/parser/EditReservationCommandParser.java b/src/main/java/seedu/address/logic/parser/EditReservationCommandParser.java index 595b9626c45..5a6fa313783 100644 --- a/src/main/java/seedu/address/logic/parser/EditReservationCommandParser.java +++ b/src/main/java/seedu/address/logic/parser/EditReservationCommandParser.java @@ -31,6 +31,9 @@ public EditReservationCommandParser(ExecutionStatus executionStatus) { /** * Parses the given {@code String} of arguments in the context of the EditCommand * and returns an EditCommand object for execution. + * + * @param args + * @return EditReservationCommand * @throws ParseException if the user input does not conform the expected format */ public EditReservationCommand parse(String args) throws ParseException { diff --git a/src/main/java/seedu/address/logic/parser/EditTransactionCommandParser.java b/src/main/java/seedu/address/logic/parser/EditTransactionCommandParser.java index aa2123b48cf..89bf3f72a6a 100644 --- a/src/main/java/seedu/address/logic/parser/EditTransactionCommandParser.java +++ b/src/main/java/seedu/address/logic/parser/EditTransactionCommandParser.java @@ -30,8 +30,11 @@ public EditTransactionCommandParser(ExecutionStatus executionStatus) { } /** - * Parses the given {@code String} of arguments in the context of the EditCommand - * and returns an EditCommand object for execution. + * Parses the given {@code String} of arguments in the context of the EditTransactionCommand + * and returns an EditTransactionCommand object for execution. + * + * @param args + * @return EditTransactionCommand * @throws ParseException if the user input does not conform the expected format */ public EditTransactionCommand parse(String args) throws ParseException { diff --git a/src/main/java/seedu/address/logic/parser/FindCommandParser.java b/src/main/java/seedu/address/logic/parser/FindCommandParser.java index 497091a78ce..6c7d8dc7ab4 100644 --- a/src/main/java/seedu/address/logic/parser/FindCommandParser.java +++ b/src/main/java/seedu/address/logic/parser/FindCommandParser.java @@ -29,6 +29,9 @@ public class FindCommandParser implements Parser { /** * Parses the given {@code String} of arguments in the context of the FindCommand * and returns a FindCommand object for execution. + * + * @param args + * @return FindCommand * @throws ParseException if the user input does not conform the expected format */ public FindCommand parse(String args) throws ParseException { diff --git a/src/main/java/seedu/address/logic/parser/ListCommandParser.java b/src/main/java/seedu/address/logic/parser/ListCommandParser.java index 56d6306c548..e624338bfce 100644 --- a/src/main/java/seedu/address/logic/parser/ListCommandParser.java +++ b/src/main/java/seedu/address/logic/parser/ListCommandParser.java @@ -17,6 +17,9 @@ public class ListCommandParser implements Parser { /** * Parses the given {@code String} of arguments in the context of the ListCommand * and returns a ListCommand object for execution. + * + * @param args + * @return ListCommand * @throws ParseException if the user input does not conform the expected format */ public ListCommand parse(String args) throws ParseException { diff --git a/src/main/java/seedu/address/logic/parser/LoginCommandParser.java b/src/main/java/seedu/address/logic/parser/LoginCommandParser.java index 8d3a44a1477..a1808b2af94 100644 --- a/src/main/java/seedu/address/logic/parser/LoginCommandParser.java +++ b/src/main/java/seedu/address/logic/parser/LoginCommandParser.java @@ -14,6 +14,9 @@ public class LoginCommandParser implements Parser { /** * Parses the given {@code String} of arguments in the context of the LoginCommand * and returns a LoginCommand object for execution. + * + * @param args + * @return LoginCommand * @throws ParseException if the user input does not conform the expected format */ public LoginCommand parse(String args) throws ParseException { diff --git a/src/main/java/seedu/address/logic/parser/Prefix.java b/src/main/java/seedu/address/logic/parser/Prefix.java index 067610481ab..23f06148835 100644 --- a/src/main/java/seedu/address/logic/parser/Prefix.java +++ b/src/main/java/seedu/address/logic/parser/Prefix.java @@ -7,23 +7,45 @@ public class Prefix { private final String prefix; + /** + * Constructs a {@code Prefix} with the given {@code String}. + * + * @param prefix + */ public Prefix(String prefix) { this.prefix = prefix; } + /** + * Gets prefix. + * + * @return + */ public String getPrefix() { return prefix; } + public String toString() { return getPrefix(); } + /** + * Overrides the method hashCode. + * + * @return + */ @Override public int hashCode() { return prefix == null ? 0 : prefix.hashCode(); } + /** + * Overrides equals method. + * + * @param obj + * @return boolean + */ @Override public boolean equals(Object obj) { if (!(obj instanceof Prefix)) { diff --git a/src/main/java/seedu/address/logic/parser/RedeemCommandParser.java b/src/main/java/seedu/address/logic/parser/RedeemCommandParser.java index c4682393a03..e0fe5e1c202 100644 --- a/src/main/java/seedu/address/logic/parser/RedeemCommandParser.java +++ b/src/main/java/seedu/address/logic/parser/RedeemCommandParser.java @@ -25,7 +25,7 @@ public class RedeemCommandParser implements Parser { private final ExecutionStatus executionStatus; /** - * Constructs a {@code AddTransactionCommandParser} with the given {@code ExecutionStatus}. + * Constructs a {@code RedeemCommandParser} with the given {@code Model} and {@code ExecutionStatus}. */ public RedeemCommandParser(Model model, ExecutionStatus executionStatus) { this.model = model; @@ -33,8 +33,12 @@ public RedeemCommandParser(Model model, ExecutionStatus executionStatus) { } /** - * Parses the given {@code String} of arguments in the context of the RedeemPointCommand - * and returns an RedeemPointCommand object for execution. + * Parses the given {@code String} of arguments in the context of the RedeemCommand + * and returns an RedeemCommand object for execution. + * + * @param args + * @return RedeemCommand + * @throws ParseException if the user input does not conform the expected format */ @Override public RedeemCommand parse(String args) throws ParseException { diff --git a/src/main/java/seedu/address/logic/parser/SortCommandParser.java b/src/main/java/seedu/address/logic/parser/SortCommandParser.java index aeb7cf1ccc5..f5def3980ba 100644 --- a/src/main/java/seedu/address/logic/parser/SortCommandParser.java +++ b/src/main/java/seedu/address/logic/parser/SortCommandParser.java @@ -21,6 +21,9 @@ public class SortCommandParser implements Parser { /** * Parses the given {@code String} of arguments in the context of the SortCommand * and returns a SortCommand object for execution. + * + * @param args + * @return SortCommand * @throws ParseException if the user input does not conform the expected format */ public SortCommand parse(String args) throws ParseException { diff --git a/src/main/java/seedu/address/logic/parser/ViewCommandParser.java b/src/main/java/seedu/address/logic/parser/ViewCommandParser.java index 39d266320cd..7344f2823d0 100644 --- a/src/main/java/seedu/address/logic/parser/ViewCommandParser.java +++ b/src/main/java/seedu/address/logic/parser/ViewCommandParser.java @@ -20,6 +20,8 @@ public class ViewCommandParser implements Parser { * Parses the given {@code String} of arguments in the context of the ViewCommand * and returns a ViewCommand object for execution. * + * @param args + * @return ViewCommand * @throws ParseException if the user input does not conform the expected format */ public ViewCommand parse(String args) throws ParseException { diff --git a/src/main/java/seedu/address/logic/parser/exceptions/ParseException.java b/src/main/java/seedu/address/logic/parser/exceptions/ParseException.java index 158a1a54c1c..fa850c7617c 100644 --- a/src/main/java/seedu/address/logic/parser/exceptions/ParseException.java +++ b/src/main/java/seedu/address/logic/parser/exceptions/ParseException.java @@ -6,11 +6,21 @@ * Represents a parse error encountered by a parser. */ public class ParseException extends IllegalValueException { - + /** + * Parses the exception with string message. + * + * @param message + */ public ParseException(String message) { super(message); } + /** + * Parses the exception with string message amd throwable cause. + * + * @param message + * @param cause + */ public ParseException(String message, Throwable cause) { super(message, cause); } diff --git a/src/main/java/seedu/address/model/account/Password.java b/src/main/java/seedu/address/model/account/Password.java index 2af7015e8b9..828ec5d3d90 100644 --- a/src/main/java/seedu/address/model/account/Password.java +++ b/src/main/java/seedu/address/model/account/Password.java @@ -9,10 +9,23 @@ */ public class Password { + /** + * Stands for default password. + */ public static final String DEFAULT_PLAINTEXT_PASSWORD = "123456"; + /** + * Stands for password message constraints. + */ public static final String MESSAGE_CONSTRAINTS = "Passwords should only contain 32 alphanumeric characters or empty, and it should not be blank"; + /** + * Stands for validation regex. + */ public static final String VALIDATION_REGEX = "[\\p{Alnum}]*"; + + /** + * Stands for password length. + */ public static final int LENGTH = 32; public final String value; @@ -31,15 +44,29 @@ public Password(String password) { /** * Returns true if a given string is a valid password. */ + /** + * Returns true if a given string is a valid password. + * + * @param test + * @return boolean + */ public static boolean isValidPassword(String test) { return test.isEmpty() || (test.matches(VALIDATION_REGEX) && test.length() == LENGTH); } + /** + * Overrides toString method. + * @return String + */ @Override public String toString() { return value; } + /** + * Overrides equals method. + * @return boolean + */ @Override public boolean equals(Object other) { return other == this // short circuit if same object @@ -47,6 +74,10 @@ public boolean equals(Object other) { && value.equals(((Password) other).value)); // state check } + /** + * Overrides hashCode method. + * @return int + */ @Override public int hashCode() { return value.hashCode(); diff --git a/src/main/java/seedu/address/model/member/Address.java b/src/main/java/seedu/address/model/member/Address.java index 7d362ee0e70..c646bb86384 100644 --- a/src/main/java/seedu/address/model/member/Address.java +++ b/src/main/java/seedu/address/model/member/Address.java @@ -9,10 +9,13 @@ */ public class Address { + /** + * Stands for address message constraints. + */ public static final String MESSAGE_CONSTRAINTS = "Addresses can take any values, and it should not be blank"; - /* - * The first character of the address must not be a whitespace, + /** + * Stands for the first character of the address must not be a whitespace, * otherwise " " (a blank string) becomes a valid input. */ public static final String VALIDATION_REGEX = "[^\\s].*"; @@ -22,7 +25,7 @@ public class Address { /** * Constructs an {@code Address}. * - * @param address A valid address. + * @param address a valid address. */ public Address(String address) { requireNonNull(address); @@ -37,11 +40,21 @@ public static boolean isValidAddress(String test) { return test.matches(VALIDATION_REGEX); } + /** + * Overrides toString method. + * + * @return String + */ @Override public String toString() { return value; } + /** + * Overrides equals method. + * + * @return boolean + */ @Override public boolean equals(Object other) { return other == this // short circuit if same object @@ -49,6 +62,11 @@ public boolean equals(Object other) { && value.equals(((Address) other).value)); // state check } + /** + * Overrides hashCode method. + * + * @return int + */ @Override public int hashCode() { return value.hashCode(); diff --git a/src/main/java/seedu/address/model/member/Credit.java b/src/main/java/seedu/address/model/member/Credit.java index dbe2a664c42..0b9eedece8b 100644 --- a/src/main/java/seedu/address/model/member/Credit.java +++ b/src/main/java/seedu/address/model/member/Credit.java @@ -9,18 +9,36 @@ */ public class Credit { + /** + * Stands for credits message constraints. + */ public static final String MESSAGE_CONSTRAINTS = "Credits should only contain digits, and it should not be blank"; + + /** + * Stands for validation regex. + */ public static final String VALIDATION_REGEX = "[\\p{Digit}]*"; + + /** + * Stands for the max credit number. + */ public static final int MAX = 99999999; + + /** + * Stands for the length of credit. + */ public static final int LENGTH = 8; // Max credit is 99999999 + /** + * Stands for the credit value. + */ public final String value; /** * Constructs a {@code Credit}. * - * @param credit A valid credit. + * @param credit a valid credit. */ public Credit(String credit) { requireNonNull(credit); @@ -31,29 +49,45 @@ public Credit(String credit) { /** * Returns true if a given string is a valid credit. */ + /** + * Returns true if a given string is a valid credit. + * + * @param test + * @return boolean + */ public static boolean isValidCredit(String test) { return test.matches(VALIDATION_REGEX) && test.length() <= LENGTH; } /** - * Returns int value of credit. + * Gets int value of credit. */ public int getIntValue() { return Integer.parseInt(value); } /** - * Returns String value of credit for Point use. + * Gets String value of credit for Point use. */ public String getStringValue() { return value; } + /** + * Overrides toString method. + * + * @return String + */ @Override public String toString() { return value; } + /** + * Overrides equals method. + * + * @return boolean + */ @Override public boolean equals(Object other) { return other == this // short circuit if same object @@ -61,6 +95,11 @@ public boolean equals(Object other) { && value.equals(((Credit) other).value)); // state check } + /** + * Overrides hashCode method. + * + * @return int + */ @Override public int hashCode() { return value.hashCode(); diff --git a/src/main/java/seedu/address/model/member/CreditSortComparator.java b/src/main/java/seedu/address/model/member/CreditSortComparator.java index 17bc96ec86a..06c6edd9f79 100644 --- a/src/main/java/seedu/address/model/member/CreditSortComparator.java +++ b/src/main/java/seedu/address/model/member/CreditSortComparator.java @@ -11,14 +11,31 @@ public class CreditSortComparator implements Comparator { private final SortStatus sortStatus; + /** + * Constructs a {@code CreditSortComparator} with input {@code SortStatus}. + * + * @param sortStatus + */ public CreditSortComparator(SortStatus sortStatus) { this.sortStatus = sortStatus; } + /** + * Gets sort status. + * + * @return SortStatus + */ public SortStatus getSortStatus() { return sortStatus; } + /** + * Overrides comapre method. + * + * @param m1 + * @param m2 + * @return int + */ @Override public int compare(Member m1, Member m2) { if (sortStatus == SortStatus.DESC) { @@ -28,6 +45,11 @@ public int compare(Member m1, Member m2) { } } + /** + * Overrides equals method. + * + * @return boolean + */ @Override public boolean equals(Object other) { return other == this // short circuit if same object diff --git a/src/main/java/seedu/address/model/member/Email.java b/src/main/java/seedu/address/model/member/Email.java index 703e818cad3..08332704ab0 100644 --- a/src/main/java/seedu/address/model/member/Email.java +++ b/src/main/java/seedu/address/model/member/Email.java @@ -10,6 +10,10 @@ public class Email { private static final String SPECIAL_CHARACTERS = "+_.-"; + + /** + * Stands for message constraints for email. + */ public static final String MESSAGE_CONSTRAINTS = "Emails should be of the format local-part@domain " + "and adhere to the following constraints:\n" + "1. The local-part should only contain alphanumeric characters and these special characters, excluding " @@ -29,14 +33,21 @@ public class Email { + "(-" + ALPHANUMERIC_NO_UNDERSCORE + ")*"; private static final String DOMAIN_LAST_PART_REGEX = "(" + DOMAIN_PART_REGEX + "){2,}$"; // At least two chars private static final String DOMAIN_REGEX = "(" + DOMAIN_PART_REGEX + "\\.)*" + DOMAIN_LAST_PART_REGEX; + + /** + * Stands for validation regex should includes @ in between. + */ public static final String VALIDATION_REGEX = LOCAL_PART_REGEX + "@" + DOMAIN_REGEX; + /** + * Stands for email string. + */ public final String value; /** * Constructs an {@code Email}. * - * @param email A valid email address. + * @param email a valid email address. */ public Email(String email) { requireNonNull(email); @@ -51,11 +62,21 @@ public static boolean isValidEmail(String test) { return test.matches(VALIDATION_REGEX); } + /** + * Overrides toString method. + * + * @return String + */ @Override public String toString() { return value; } + /** + * Overrides equals method. + * + * @return boolean + */ @Override public boolean equals(Object other) { return other == this // short circuit if same object @@ -63,6 +84,11 @@ public boolean equals(Object other) { && value.equals(((Email) other).value)); // state check } + /** + * Overrides hashCode method. + * + * @return int + */ @Override public int hashCode() { return value.hashCode(); diff --git a/src/main/java/seedu/address/model/member/EmailContainsKeywordsPredicate.java b/src/main/java/seedu/address/model/member/EmailContainsKeywordsPredicate.java index b43164a31e3..764caf3efdf 100644 --- a/src/main/java/seedu/address/model/member/EmailContainsKeywordsPredicate.java +++ b/src/main/java/seedu/address/model/member/EmailContainsKeywordsPredicate.java @@ -11,16 +11,32 @@ public class EmailContainsKeywordsPredicate implements Predicate { private final List keywords; + /** + * Constructs {@code EmailContainsKeywordsPredicate} with input {@code List}. + * + * @param keywords + */ public EmailContainsKeywordsPredicate(List keywords) { this.keywords = keywords; } + /** + * Overrides test method. + * + * @param member + * @return boolean + */ @Override public boolean test(Member member) { return keywords.stream() .anyMatch(keyword -> StringUtil.containsWordIgnoreCase(member.getEmail().value, keyword)); } + /** + * Overrides equals method. + * + * @return boolean + */ @Override public boolean equals(Object other) { return other == this // short circuit if same object diff --git a/src/main/java/seedu/address/model/member/Id.java b/src/main/java/seedu/address/model/member/Id.java index 78a41b9708a..2529c6e71f5 100644 --- a/src/main/java/seedu/address/model/member/Id.java +++ b/src/main/java/seedu/address/model/member/Id.java @@ -9,12 +9,30 @@ */ public class Id { + /** + * Stands for Id message constraints. + */ public static final String MESSAGE_CONSTRAINTS = "Ids should only contain 5 digits, and it should not be blank"; + + /** + * Stands for validation regex of Id. + */ public static final String VALIDATION_REGEX = "[\\p{Digit}]*"; + + /** + * Stands for pattern of Id. + */ public static final String PATTERN = "%05d"; + + /** + * Stands for length of Id is five. + */ public static final int LENGTH = 5; + /** + * Stands Id value. + */ public final String value; /** @@ -30,16 +48,29 @@ public Id(String id) { /** * Returns true if a given string is a valid id. + * + * @param test + * @return boolean */ public static boolean isValidId(String test) { return test.matches(VALIDATION_REGEX) && test.length() == LENGTH; } + /** + * Overrides toString method. + * + * @return String + */ @Override public String toString() { return value; } + /** + * Overrides equals method. + * + * @return boolean + */ @Override public boolean equals(Object other) { return other == this // short circuit if same object @@ -47,6 +78,11 @@ public boolean equals(Object other) { && value.equals(((Id) other).value)); // state check } + /** + * Overrides hashCode method. + * + * @return int + */ @Override public int hashCode() { return value.hashCode(); diff --git a/src/main/java/seedu/address/model/member/IdContainsKeywordsPredicate.java b/src/main/java/seedu/address/model/member/IdContainsKeywordsPredicate.java index 4b6dfa5e5cd..ec0a8a418b6 100644 --- a/src/main/java/seedu/address/model/member/IdContainsKeywordsPredicate.java +++ b/src/main/java/seedu/address/model/member/IdContainsKeywordsPredicate.java @@ -11,16 +11,32 @@ public class IdContainsKeywordsPredicate implements Predicate { private final List keywords; + /** + * Constructs a {@code IdContainsKeywordsPredicate} with input {List}. + * + * @param keywords + */ public IdContainsKeywordsPredicate(List keywords) { this.keywords = keywords; } + /** + * Overrides test method. + * + * @param member + * @return boolean + */ @Override public boolean test(Member member) { return keywords.stream() .anyMatch(keyword -> StringUtil.containsWordIgnoreCase(member.getId().value, keyword)); } + /** + * Overrides equals method. + * + * @return boolean + */ @Override public boolean equals(Object other) { return other == this // short circuit if same object diff --git a/src/main/java/seedu/address/model/member/Member.java b/src/main/java/seedu/address/model/member/Member.java index dae5abb13f4..b2b4cf2e38f 100644 --- a/src/main/java/seedu/address/model/member/Member.java +++ b/src/main/java/seedu/address/model/member/Member.java @@ -38,8 +38,25 @@ public class Member { private final List reservations = new ArrayList<>(); /** + * + */ + /** + * Constructs {code Member} with follow param. * Every field must be present and not null. + * + * @param id + * @param name + * @param phone + * @param email + * @param address + * @param timestamp + * @param credit + * @param point + * @param transactions + * @param reservations + * @param tags */ + public Member(Id id, Name name, Phone phone, Email email, Address address, Timestamp timestamp, Credit credit, Point point, List transactions, List reservations, Set tags) { @@ -57,34 +74,74 @@ public Member(Id id, Name name, Phone phone, Email email, Address address, this.reservations.addAll(reservations); } + /** + * Gets Id. + * + * @return Id + */ public Id getId() { return id; } + /** + * Gets name. + * + * @return name + */ public Name getName() { return name; } + /** + * Gets phone. + * + * @return Phone + */ public Phone getPhone() { return phone; } + /** + * Gets email. + * + * @return Email + */ public Email getEmail() { return email; } + /** + * Gets address. + * + * @return Address + */ public Address getAddress() { return address; } + /** + * Gets timestamp. + * + * @return Timestamp + */ public Timestamp getTimestamp() { return timestamp; } + /** + * Gets credit. + * + * @return Credit + */ public Credit getCredit() { return credit; } + /** + * Gets point. + * + * @return Point + */ public Point getPoint() { return this.point; } @@ -92,6 +149,8 @@ public Point getPoint() { /** * Returns an immutable tag set, which throws {@code UnsupportedOperationException} * if modification is attempted. + * + * @return Set */ public Set getTags() { return Collections.unmodifiableSet(tags); diff --git a/src/main/java/seedu/address/model/member/Name.java b/src/main/java/seedu/address/model/member/Name.java index 349ea3854c1..a30d07596bc 100644 --- a/src/main/java/seedu/address/model/member/Name.java +++ b/src/main/java/seedu/address/model/member/Name.java @@ -9,15 +9,21 @@ */ public class Name { + /** + * Stands for message constraints of name. + */ public static final String MESSAGE_CONSTRAINTS = "Names should only contain alphanumeric characters and spaces, and it should not be blank"; - /* - * The first character of the name must not be a whitespace, + /** + * Stands for the first character of the name must not be a whitespace, * otherwise " " (a blank string) becomes a valid input. */ public static final String VALIDATION_REGEX = "[\\p{Alnum}][\\p{Alnum} ]*"; + /** + * Stands for full name value + */ public final String fullName; /** @@ -38,11 +44,21 @@ public static boolean isValidName(String test) { return test.matches(VALIDATION_REGEX); } + /** + * Overrides toString method. + * + * @return String + */ @Override public String toString() { return fullName; } + /** + * Overrides equals method. + * + * @return boolean + */ @Override public boolean equals(Object other) { return other == this // short circuit if same object @@ -50,6 +66,11 @@ public boolean equals(Object other) { && fullName.equals(((Name) other).fullName)); // state check } + /** + * Overrides hashCode method. + * + * @return int + */ @Override public int hashCode() { return fullName.hashCode(); diff --git a/src/main/java/seedu/address/model/member/NameContainsKeywordsPredicate.java b/src/main/java/seedu/address/model/member/NameContainsKeywordsPredicate.java index 41763403cd1..7de43eb5aa8 100644 --- a/src/main/java/seedu/address/model/member/NameContainsKeywordsPredicate.java +++ b/src/main/java/seedu/address/model/member/NameContainsKeywordsPredicate.java @@ -11,16 +11,32 @@ public class NameContainsKeywordsPredicate implements Predicate { private final List keywords; + /** + * Constructs {@code NameContainsKeywordsPredicate} with input {@code List}. + * + * @param keywords + */ public NameContainsKeywordsPredicate(List keywords) { this.keywords = keywords; } + /** + * Overrides test method. + * + * @param member + * @return boolean + */ @Override public boolean test(Member member) { return keywords.stream() .anyMatch(keyword -> StringUtil.containsWordIgnoreCase(member.getName().fullName, keyword)); } + /** + * Overrides equals method. + * + * @return boolean + */ @Override public boolean equals(Object other) { return other == this // short circuit if same object diff --git a/src/main/java/seedu/address/model/member/Phone.java b/src/main/java/seedu/address/model/member/Phone.java index 0c496f1f57b..04228dca562 100644 --- a/src/main/java/seedu/address/model/member/Phone.java +++ b/src/main/java/seedu/address/model/member/Phone.java @@ -18,7 +18,7 @@ public class Phone { /** * Constructs a {@code Phone}. * - * @param phone A valid phone number. + * @param phone a valid phone number. */ public Phone(String phone) { requireNonNull(phone); @@ -28,16 +28,29 @@ public Phone(String phone) { /** * Returns true if a given string is a valid phone number. + * + * @param test + * @return boolean */ public static boolean isValidPhone(String test) { return test.matches(VALIDATION_REGEX); } + /** + * Overrides toString method. + * + * @return String + */ @Override public String toString() { return value; } + /** + * Overrides equals method. + * + * @return boolean + */ @Override public boolean equals(Object other) { return other == this // short circuit if same object @@ -45,6 +58,11 @@ public boolean equals(Object other) { && value.equals(((Phone) other).value)); // state check } + /** + * Overrides hashCode method. + * + * @return int + */ @Override public int hashCode() { return value.hashCode(); diff --git a/src/main/java/seedu/address/model/member/PhoneContainsKeywordsPredicate.java b/src/main/java/seedu/address/model/member/PhoneContainsKeywordsPredicate.java index 0d262b54180..ca35aa07d76 100644 --- a/src/main/java/seedu/address/model/member/PhoneContainsKeywordsPredicate.java +++ b/src/main/java/seedu/address/model/member/PhoneContainsKeywordsPredicate.java @@ -11,16 +11,32 @@ public class PhoneContainsKeywordsPredicate implements Predicate { private final List keywords; + /** + * Constructs a {@code PhoneContainsKeywordsPredicate} with input {@code List}. + * + * @param keywords + */ public PhoneContainsKeywordsPredicate(List keywords) { this.keywords = keywords; } + /** + * Overrides test method. + * + * @param member + * @return boolean + */ @Override public boolean test(Member member) { return keywords.stream() .anyMatch(keyword -> StringUtil.containsWordIgnoreCase(member.getPhone().value, keyword)); } + /** + * Overrides equals method. + * + * @return boolean + */ @Override public boolean equals(Object other) { return other == this // short circuit if same object diff --git a/src/main/java/seedu/address/model/member/Point.java b/src/main/java/seedu/address/model/member/Point.java index e8ce0f944d2..da438d7eb11 100644 --- a/src/main/java/seedu/address/model/member/Point.java +++ b/src/main/java/seedu/address/model/member/Point.java @@ -8,19 +8,36 @@ * and it can be redeem from a redemption process */ public class Point { + /** + * Stands for message constraints for point. + */ public static final String MESSAGE_CONSTRAINTS = "Points should only contain digits, and it should not be blank"; + + /** + * Stands for validation regex. + */ public static final String VALIDATION_REGEX = "[\\p{Digit}]*"; + /** + * Stands for point max value. + */ public static final int MAX = 99999999; + + /** + * Stands for point max length + */ public static final int LENGTH = 8; // Max point is 99999999 + /** + * Stands for point value + */ public final String value; /** * Constructs a {@code Point}. * - * @param point A valid point. + * @param point a valid point */ public Point(String point) { requireNonNull(point); @@ -30,6 +47,9 @@ public Point(String point) { /** * Returns true if a given string is a valid point. + * + * @param test + * @return boolean */ public static boolean isValidPoint(String test) { return test.matches(VALIDATION_REGEX) && test.length() <= LENGTH; @@ -37,16 +57,28 @@ public static boolean isValidPoint(String test) { /** * Returns int value of point. + * + * @return int */ public int getIntValue() { return Integer.parseInt(value); } + /** + * Overrides toString method. + * + * @return String + */ @Override public String toString() { return value; } + /** + * Overrides equals method. + * + * @return boolean + */ @Override public boolean equals(Object other) { return other == this // short circuit if same object @@ -54,6 +86,11 @@ public boolean equals(Object other) { && value.equals(((Point) other).value)); // state check } + /** + * Overrides hashCode method. + * + * @return int + */ @Override public int hashCode() { return value.hashCode(); @@ -61,6 +98,8 @@ public int hashCode() { /** * Returns double value of transaction amount. + * + * @return double */ public double getDoubleValue() { return Double.parseDouble(value); diff --git a/src/main/java/seedu/address/model/member/RegistrationDateContainsKeywordsPredicate.java b/src/main/java/seedu/address/model/member/RegistrationDateContainsKeywordsPredicate.java index 3aa27d95db7..a3763282037 100644 --- a/src/main/java/seedu/address/model/member/RegistrationDateContainsKeywordsPredicate.java +++ b/src/main/java/seedu/address/model/member/RegistrationDateContainsKeywordsPredicate.java @@ -17,10 +17,21 @@ public class RegistrationDateContainsKeywordsPredicate implements Predicate keywords; + /** + * Constructs a {@code RegistrationDateContainsKeywordsPredicate} with input {@code List}. + * + * @param keywords + */ public RegistrationDateContainsKeywordsPredicate(List keywords) { this.keywords = keywords; } + /** + * Overrides test method. + * + * @param member + * @return boolean + */ @Override public boolean test(Member member) { return keywords.stream().anyMatch(keyword -> { @@ -34,6 +45,11 @@ public boolean test(Member member) { }); } + /** + * Overrides equals method. + * + * @return boolean + */ @Override public boolean equals(Object other) { return other == this // short circuit if same object diff --git a/src/main/java/seedu/address/model/member/UniqueMemberList.java b/src/main/java/seedu/address/model/member/UniqueMemberList.java index 4242ecaa907..c988eb6dc08 100644 --- a/src/main/java/seedu/address/model/member/UniqueMemberList.java +++ b/src/main/java/seedu/address/model/member/UniqueMemberList.java @@ -33,6 +33,7 @@ public class UniqueMemberList implements Iterable { * Returns a member identified by id. * @param id * @return member + * @throws MemberNotFoundException */ public Member getMemberById(Id id) throws MemberNotFoundException { for (Member entry : internalList) { @@ -45,6 +46,9 @@ public Member getMemberById(Id id) throws MemberNotFoundException { /** * Returns true if the list contains an equivalent member as the given argument. + * + * @param toCheck + * @return boolean */ public boolean contains(Member toCheck) { requireNonNull(toCheck); @@ -54,6 +58,10 @@ public boolean contains(Member toCheck) { /** * Returns true if the filtered list contains an equivalent member as the given argument. * {@code predicate} is the filter condition for the filtered list. + * + * @param toCheck + * @param predicate + * @return boolean */ public boolean contains(Member toCheck, Predicate predicate) { requireNonNull(toCheck); @@ -63,6 +71,8 @@ public boolean contains(Member toCheck, Predicate predicate) { /** * Adds a member to the list. * The member must not already exist in the list. + * + * @param toAdd */ public void add(Member toAdd) { requireNonNull(toAdd); @@ -76,6 +86,9 @@ public void add(Member toAdd) { * Replaces the member {@code target} in the list with {@code editedMember}. * {@code target} must exist in the list. * The member identity of {@code editedMember} must not be the same as another existing member in the list. + * + * @param target + * @param editedMember */ public void setMember(Member target, Member editedMember) { requireAllNonNull(target, editedMember); @@ -95,6 +108,8 @@ public void setMember(Member target, Member editedMember) { /** * Removes the equivalent member from the list. * The member must exist in the list. + * + * @param toRemove */ public void remove(Member toRemove) { requireNonNull(toRemove); @@ -103,6 +118,11 @@ public void remove(Member toRemove) { } } + /** + * Sets Members by input {@code UniqueMemberList } + * + * @param replacement + */ public void setMembers(UniqueMemberList replacement) { requireNonNull(replacement); internalList.setAll(replacement.internalList); @@ -111,6 +131,8 @@ public void setMembers(UniqueMemberList replacement) { /** * Replaces the contents of this list with {@code members}. * {@code members} must not contain duplicate members. + * + * @param members */ public void setMembers(List members) { requireAllNonNull(members); @@ -123,16 +145,28 @@ public void setMembers(List members) { /** * Returns the backing list as an unmodifiable {@code ObservableList}. + * + * @return ObservableList */ public ObservableList asUnmodifiableObservableList() { return internalUnmodifiableList; } + /** + * Overrides Iterator method. + * + * @return Iterator + */ @Override public Iterator iterator() { return internalList.iterator(); } + /** + * Overrides equals method. + * + * @return boolean + */ @Override public boolean equals(Object other) { return other == this // short circuit if same object @@ -140,6 +174,11 @@ public boolean equals(Object other) { && internalList.equals(((UniqueMemberList) other).internalList)); } + /** + * Overrides hashCode method. + * + * @return int + */ @Override public int hashCode() { return internalList.hashCode(); @@ -147,6 +186,9 @@ public int hashCode() { /** * Returns true if {@code members} contains only unique members. + * + * @param members + * @return boolean */ private boolean membersAreUnique(List members) { for (int i = 0; i < members.size() - 1; i++) { diff --git a/src/main/java/seedu/address/model/member/exceptions/DuplicateMemberException.java b/src/main/java/seedu/address/model/member/exceptions/DuplicateMemberException.java index 45d03f64358..50985b5e1c0 100644 --- a/src/main/java/seedu/address/model/member/exceptions/DuplicateMemberException.java +++ b/src/main/java/seedu/address/model/member/exceptions/DuplicateMemberException.java @@ -5,6 +5,9 @@ * identity). */ public class DuplicateMemberException extends RuntimeException { + /** + * Constructs a {@code DuplicateMemberException} without input. + */ public DuplicateMemberException() { super("Operation would result in duplicate members"); } diff --git a/src/main/java/seedu/address/model/reservation/DateTime.java b/src/main/java/seedu/address/model/reservation/DateTime.java index 1ca2d247fab..dea58c8471c 100644 --- a/src/main/java/seedu/address/model/reservation/DateTime.java +++ b/src/main/java/seedu/address/model/reservation/DateTime.java @@ -7,17 +7,20 @@ import seedu.address.commons.util.DateTimeUtil; - - /** * Represents a Reservation's dateTime in the ezFoodie. * Guarantees: immutable; is valid as declared in {@link #isValidDateTime(String)} */ public class DateTime { + /** + * Stands for message constraints of reservation date time. + */ public static final String MESSAGE_CONSTRAINTS = "Reservations should be valid date time " + DateTimeUtil.DATE_TIME_PATTERN; - + /** + * Stands for reservation value. + */ public final String value; /** @@ -34,6 +37,12 @@ public DateTime(String dateTime) { /** * Returns true if a given string is a valid date time. */ + /** + * Returns true if a given string is a valid date time. + * + * @param test + * @return boolean + */ public static boolean isValidDateTime(String test) { try { DateTimeUtil.parseDateTime(test); @@ -43,11 +52,21 @@ public static boolean isValidDateTime(String test) { } } + /** + * Overrides toString method. + * + * @return String + */ @Override public String toString() { return value; } + /** + * Overrides equals method. + * + * @return boolean + */ @Override public boolean equals(Object other) { return other == this // short circuit if same object @@ -55,6 +74,11 @@ public boolean equals(Object other) { && value.equals(((DateTime) other).value)); // state check } + /** + * Overrides hashCode method. + * + * @return int + */ @Override public int hashCode() { return value.hashCode(); diff --git a/src/main/java/seedu/address/model/reservation/Id.java b/src/main/java/seedu/address/model/reservation/Id.java index fd93568e1e4..ffb79f7d671 100644 --- a/src/main/java/seedu/address/model/reservation/Id.java +++ b/src/main/java/seedu/address/model/reservation/Id.java @@ -9,12 +9,30 @@ */ public class Id { + /** + * Stands for message constraints of reservation member id. + */ public static final String MESSAGE_CONSTRAINTS = "Reservation IDs should only contain 6 digits, and it should not be blank"; + + /** + * Stands for validation regex of reservation id. + */ public static final String VALIDATION_REGEX = "[\\p{Digit}]*"; + + /** + * Stands for reservation Id pattern + */ public static final String PATTERN = "%06d"; + + /** + * Stands for reservation id max length + */ public static final int LENGTH = 6; + /** + * Stands for reservation id value + */ public final String value; /** @@ -30,16 +48,29 @@ public Id(String id) { /** * Returns true if a given string is a valid id. + * + * @param test + * @return */ public static boolean isValidId(String test) { return test.matches(VALIDATION_REGEX) && test.length() == LENGTH; } + /** + * Overrides toString method. + * + * @return String + */ @Override public String toString() { return value; } + /** + * Overrides equals method. + * + * @return boolean + */ @Override public boolean equals(Object other) { return other == this // short circuit if same object @@ -47,6 +78,11 @@ public boolean equals(Object other) { && value.equals(((Id) other).value)); // state check } + /** + * Overrides hashCode method. + * + * @return int + */ @Override public int hashCode() { return value.hashCode(); From 01096b057a73c71900595b250370a6239ac8cea3 Mon Sep 17 00:00:00 2001 From: Zhang Zhiyao Date: Thu, 4 Nov 2021 21:37:49 +0800 Subject: [PATCH 3/5] java doc update --- .../java/seedu/address/AppParameters.java | 6 + src/main/java/seedu/address/Main.java | 3 + .../java/seedu/address/model/Account.java | 9 +- .../java/seedu/address/model/EzFoodie.java | 21 ++- src/main/java/seedu/address/model/Model.java | 30 ++-- .../seedu/address/model/ModelManager.java | 134 +++++++++++++++++- .../java/seedu/address/model/Timestamp.java | 28 +++- .../java/seedu/address/model/UserPrefs.java | 37 ++++- .../seedu/address/model/member/Credit.java | 17 +-- .../address/model/reservation/DateTime.java | 17 +-- .../seedu/address/model/reservation/Id.java | 20 ++- .../address/model/reservation/Remark.java | 29 +++- .../model/reservation/Reservation.java | 31 +++- .../java/seedu/address/model/tag/Tag.java | 7 + .../address/model/transaction/Billing.java | 32 ++++- .../seedu/address/model/transaction/Id.java | 34 ++++- .../model/transaction/Transaction.java | 35 ++++- .../address/model/util/SampleDataUtil.java | 6 + .../seedu/address/storage/AccountStorage.java | 4 +- .../address/storage/EzFoodieStorage.java | 4 +- .../address/storage/JsonAccountStorage.java | 23 ++- .../storage/JsonAdaptedReservation.java | 2 +- .../seedu/address/storage/JsonAdaptedTag.java | 2 +- .../storage/JsonAdaptedTransaction.java | 2 +- .../address/storage/JsonEzFoodieStorage.java | 21 +++ .../storage/JsonSerializableEzFoodie.java | 4 +- .../address/storage/JsonUserPrefsStorage.java | 20 +++ .../java/seedu/address/storage/Storage.java | 42 ++++++ .../seedu/address/storage/StorageManager.java | 62 +++++++- .../address/storage/UserPrefsStorage.java | 4 +- .../java/seedu/address/ui/CommandBox.java | 7 +- .../java/seedu/address/ui/HelpWindow.java | 13 +- .../java/seedu/address/ui/MainWindow.java | 7 +- .../java/seedu/address/ui/MemberCard.java | 6 +- .../seedu/address/ui/MemberListPanel.java | 2 +- .../seedu/address/ui/MemberViewWindow.java | 3 + .../java/seedu/address/ui/ResultDisplay.java | 5 + .../java/seedu/address/ui/SummaryWindow.java | 5 +- src/main/java/seedu/address/ui/UiManager.java | 7 +- 39 files changed, 650 insertions(+), 91 deletions(-) diff --git a/src/main/java/seedu/address/AppParameters.java b/src/main/java/seedu/address/AppParameters.java index a7f6c5fa181..773bc406c8c 100644 --- a/src/main/java/seedu/address/AppParameters.java +++ b/src/main/java/seedu/address/AppParameters.java @@ -59,6 +59,9 @@ public static AppParameters parse(Application.Parameters parameters) { return appParameters; } + /** + * Overrides equals method. + */ @Override public boolean equals(Object other) { if (other == this) { @@ -74,6 +77,9 @@ public boolean equals(Object other) { && Objects.equals(getAccountPath(), otherAppParameters.getAccountPath()); } + /** + * Overrides hashCode. + */ @Override public int hashCode() { return Objects.hash(configPath, accountPath); diff --git a/src/main/java/seedu/address/Main.java b/src/main/java/seedu/address/Main.java index 052a5068631..4c05610a5d0 100644 --- a/src/main/java/seedu/address/Main.java +++ b/src/main/java/seedu/address/Main.java @@ -19,6 +19,9 @@ * to be the entry point of the application, we avoid this issue. */ public class Main { + /** + * Starts main application. + */ public static void main(String[] args) { Application.launch(MainApp.class, args); } diff --git a/src/main/java/seedu/address/model/Account.java b/src/main/java/seedu/address/model/Account.java index 61bdece76fd..f1078176a93 100644 --- a/src/main/java/seedu/address/model/Account.java +++ b/src/main/java/seedu/address/model/Account.java @@ -88,12 +88,19 @@ public boolean equals(Object other) { return otherAccount.getPassword().equals(getPassword()); } + /** + * Overrides the hashcode method. + * Use this method for custom fields hashing instead of implementing your own + */ @Override public int hashCode() { - // use this method for custom fields hashing instead of implementing your own return Objects.hash(password); } + /** + * Overrides toString method. + * @return String with password value. + */ @Override public String toString() { final StringBuilder builder = new StringBuilder(); diff --git a/src/main/java/seedu/address/model/EzFoodie.java b/src/main/java/seedu/address/model/EzFoodie.java index c0e60246971..75ee5ca373a 100644 --- a/src/main/java/seedu/address/model/EzFoodie.java +++ b/src/main/java/seedu/address/model/EzFoodie.java @@ -28,10 +28,15 @@ public class EzFoodie implements ReadOnlyEzFoodie { members = new UniqueMemberList(); } + /** + * Constructs {@code EzFoodie} without input value. + */ public EzFoodie() {} /** - * Creates an ezFoodie using the Members in the {@code toBeCopied} + * Constructs an {@code ezFoodie} using the Members in the {@code toBeCopied} + * + * @param toBeCopied the data is going to creates ezFoodie. */ public EzFoodie(ReadOnlyEzFoodie toBeCopied) { this(); @@ -104,17 +109,28 @@ public void removeMember(Member key) { //// util methods + /** + * Overrides toString method + */ @Override public String toString() { return members.asUnmodifiableObservableList().size() + " members"; // TODO: refine later } + /** + * Overrides and gets member list. + * + * @return ObservableList a series list data of members. + */ @Override public ObservableList getMemberList() { return members.asUnmodifiableObservableList(); } + /** + * Overrides equals method. + */ @Override public boolean equals(Object other) { return other == this // short circuit if same object @@ -122,6 +138,9 @@ public boolean equals(Object other) { && members.equals(((EzFoodie) other).members)); } + /** + * Overrides hashCode method. + */ @Override public int hashCode() { return members.hashCode(); diff --git a/src/main/java/seedu/address/model/Model.java b/src/main/java/seedu/address/model/Model.java index 09e68f87f00..592dd26439e 100644 --- a/src/main/java/seedu/address/model/Model.java +++ b/src/main/java/seedu/address/model/Model.java @@ -142,61 +142,71 @@ public interface Model { void updateSortedMemberList(Comparator comparator); /** - * Gets the number of all members in ezFoodie + * Gets the number of all members in ezFoodie. + * * @return total count */ int getNumberOfMembers(); /** - * Gets the number of members in each tier in ezFoodie + * Gets the number of members in each tier in ezFoodie. + * * @return hashmap of (tier name, count) pairs. */ HashMap getNumberOfMembersByTiers(); /** - * Gets the number of transactions made in all time in ezFoodie + * Gets the number of transactions made in all time in ezFoodie. + * * @return total count all time */ int getNumberOfTransactions(); /** - * Gets the number of transactions made in the past month in ezFoodie + * Gets the number of transactions made in the past month in ezFoodie. + * * @return total count in last 1 month */ int getNumberOfTransactionsPastMonth(); /** - * Gets the number of transactions made in the past 3 months in ezFoodie + * Gets the number of transactions made in the past 3 months in ezFoodie. + * * @return total count in last 3 months */ int getNumberOfTransactionsPastThreeMonth(); /** - * Gets the number of transactions made in the past 6 months in ezFoodie + * Gets the number of transactions made in the past 6 months in ezFoodie. + * * @return total count in last 6 months */ int getNumberOfTransactionsPastSixMonth(); /** - * Gets the total amount of transactions made all time in ezFoodie + * Gets the total amount of transactions made all time in ezFoodie. + * * @return total amount all time */ double getTotalAmountOfTransactions(); /** - * Gets the total amount of transactions made in the past month in ezFoodie + * Gets the total amount of transactions made in the past month in ezFoodie. + * * @return total amount in past 1 month */ double getTotalAmountOfTransactionsPastMonth(); /** - * Gets the total amount of transactions made in the past 3 months in ezFoodie + * Gets the total amount of transactions made in the past 3 months in ezFoodie. + * * @return total amount in past 3 months */ double getTotalAmountOfTransactionsPastThreeMonth(); /** - * Gets the total amount of transactions made in the past 6 months in ezFoodie + * Gets the total amount of transactions made in the past 6 months in ezFoodie. + * * @return total amount in past 6 months */ double getTotalAmountOfTransactionsPastSixMonth(); diff --git a/src/main/java/seedu/address/model/ModelManager.java b/src/main/java/seedu/address/model/ModelManager.java index dd2d30eaada..a3ca389b87b 100644 --- a/src/main/java/seedu/address/model/ModelManager.java +++ b/src/main/java/seedu/address/model/ModelManager.java @@ -34,6 +34,8 @@ public class ModelManager implements Model { /** * Initializes a ModelManager with the given account, ezFoodie and userPrefs. + * Constructs a {@code ModelManager} with input variables {@code ReadOnlyAccount}, + * {@code ReadOnlyEzFoodie} and {@code ReadOnlyUserPrefs}. */ public ModelManager(ReadOnlyAccount account, ReadOnlyEzFoodie ezFoodie, ReadOnlyUserPrefs userPrefs) { super(); @@ -50,50 +52,77 @@ public ModelManager(ReadOnlyAccount account, ReadOnlyEzFoodie ezFoodie, ReadOnly sortedMembers = new SortedList<>(filteredMembers); // Wrap the FilteredList in a SortedList } + /** + * Constructs a {@code ModelManager} without any input. + */ public ModelManager() { this(new Account(), new EzFoodie(), new UserPrefs()); } //=========== UserPrefs ================================================================================== + /** + * Replaces user prefs data with the data in {@code userPrefs}. + */ @Override public void setUserPrefs(ReadOnlyUserPrefs userPrefs) { requireNonNull(userPrefs); this.userPrefs.resetData(userPrefs); } + /** + * Returns the user prefs. + */ @Override public ReadOnlyUserPrefs getUserPrefs() { return userPrefs; } + /** + * Returns the user prefs' GUI settings. + */ @Override public GuiSettings getGuiSettings() { return userPrefs.getGuiSettings(); } + /** + * Sets the user prefs' GUI settings. + */ @Override public void setGuiSettings(GuiSettings guiSettings) { requireNonNull(guiSettings); userPrefs.setGuiSettings(guiSettings); } + /** + * Returns the user prefs' account path. + */ @Override public Path getAccountFilePath() { return userPrefs.getAccountFilePath(); } + /** + * Sets the user prefs' account path. + */ @Override public void setAccountFilePath(Path accountFilePath) { requireNonNull(accountFilePath); userPrefs.setAccountFilePath(accountFilePath); } + /** + * Returns the user prefs' ezFoodie file path. + */ @Override public Path getEzFoodieFilePath() { return userPrefs.getEzFoodieFilePath(); } + /** + * Sets the user prefs' ezFoodie file path. + */ @Override public void setEzFoodieFilePath(Path ezFoodieFilePath) { requireNonNull(ezFoodieFilePath); @@ -102,12 +131,18 @@ public void setEzFoodieFilePath(Path ezFoodieFilePath) { //=========== Account ==================================================================================== + /** + * Replaces account with the data in {@code account}. + */ @Override public void setAccount(ReadOnlyAccount account) { requireNonNull(account); this.account.resetData(account); } + /** + * Returns the Account. + */ @Override public ReadOnlyAccount getAccount() { return account; @@ -115,39 +150,65 @@ public ReadOnlyAccount getAccount() { //=========== EzFoodie =================================================================================== + /** + * Replaces ezFoodie data with the data in {@code ezFoodie}. + */ @Override public void setEzFoodie(ReadOnlyEzFoodie ezFoodie) { this.ezFoodie.resetData(ezFoodie); } + /** + * Returns the EzFoodie. + */ @Override public ReadOnlyEzFoodie getEzFoodie() { return ezFoodie; } + /** + * Returns true if a member with the same identity as {@code member} exists in the ezFoodie. + */ @Override public boolean hasMember(Member member) { requireNonNull(member); return ezFoodie.hasMember(member); } + /** + * Returns true if a member with the same identity as {@code member} exists in the filtered ezFoodie. + * {@code predicate} is the filter condition for the filtered ezFoodie. + */ @Override public boolean hasMember(Member member, Predicate predicate) { requireNonNull(member); return ezFoodie.hasMember(member, predicate); } + /** + * Deletes the given member. + * The member must exist in the ezFoodie. + */ @Override public void deleteMember(Member target) { ezFoodie.removeMember(target); } + /** + * Adds the given member. + * {@code member} must not already exist in the ezFoodie. + */ @Override public void addMember(Member member) { ezFoodie.addMember(member); updateFilteredMemberList(PREDICATE_SHOW_ALL_MEMBERS); } + /** + * Replaces the given member {@code target} with {@code editedMember}. + * {@code target} must exist in the ezFoodie. + * The member identity of {@code editedMember} must not be the same as another existing member in the ezFoodie. + */ @Override public void setMember(Member target, Member editedMember) { requireAllNonNull(target, editedMember); @@ -160,7 +221,7 @@ public void setMember(Member target, Member editedMember) { /** * Returns an unmodifiable view of the list of {@code Member} backed by the internal list of - * {@code versionedEzFoodie} + * {@code versionedEzFoodie}. */ @Override public ObservableList getUpdatedMemberList() { @@ -169,8 +230,7 @@ public ObservableList getUpdatedMemberList() { /** * Returns an unmodifiable view of the list of {@code Member} backed by the internal list of - * {@code versionedEzFoodie} - * for viewCommand to use only + * {@code versionedEzFoodie} for viewCommand to use only. */ @Override public ObservableList getUpdatedMemberListForView() { @@ -179,11 +239,21 @@ public ObservableList getUpdatedMemberListForView() { //=========== Summary display ============================================================= + /** + * Gets the number of all members in ezFoodie. + * + * @return total count. + */ @Override public int getNumberOfMembers() { return ezFoodie.getMemberList().size(); } + /** + * Gets the number of members in each tier in ezFoodie. + * + * @return hashmap of (tier name, count) pairs. + */ @Override public HashMap getNumberOfMembersByTiers() { HashMap tierCounts = new HashMap<>(); @@ -203,6 +273,11 @@ public HashMap getNumberOfMembersByTiers() { return tierCounts; } + /** + * Gets the number of transactions made in all time in ezFoodie. + * + * @return total count all time. + */ @Override public int getNumberOfTransactions() { int count = 0; @@ -214,24 +289,44 @@ public int getNumberOfTransactions() { return count; } + /** + * Gets the number of transactions made in the past month in ezFoodie. + * + * @return total count in last 1 month. + */ @Override public int getNumberOfTransactionsPastMonth() { // todo return (int) Math.random() + 32; } + /** + * Gets the number of transactions made in the past 3 months in ezFoodie. + * + * @return total count in last 3 months. + */ @Override public int getNumberOfTransactionsPastThreeMonth() { // todo return (int) Math.random() + 77; } + /** + * Gets the number of transactions made in the past 6 months in ezFoodie. + * + * @return total count in last 6 months. + */ @Override public int getNumberOfTransactionsPastSixMonth() { // todo return (int) Math.random() + 100; } + /** + * Gets the total amount of transactions made all time in ezFoodie. + * + * @return total amount all time. + */ @Override public double getTotalAmountOfTransactions() { double count = 0; @@ -245,18 +340,33 @@ public double getTotalAmountOfTransactions() { return count; } + /** + * Gets the total amount of transactions made in the past month in ezFoodie. + * + * @return total amount in past 1 month. + */ @Override public double getTotalAmountOfTransactionsPastMonth() { // todo return Math.random() + 2000; } + /** + * Gets the total amount of transactions made in the past 3 months in ezFoodie. + * + * @return total amount in past 3 months. + */ @Override public double getTotalAmountOfTransactionsPastThreeMonth() { // todo return Math.random() + 3000; } + /** + * Gets the total amount of transactions made in the past 6 months in ezFoodie. + * + * @return total amount in past 6 months. + */ @Override public double getTotalAmountOfTransactionsPastSixMonth() { // todo @@ -265,12 +375,22 @@ public double getTotalAmountOfTransactionsPastSixMonth() { //=========== Filtered Member List Accessors ============================================================= + /** + * Updates the filter of the filtered member list to filter by the given {@code predicate}. + * + * @throws NullPointerException if {@code predicate} is null. + */ @Override public void updateFilteredMemberList(Predicate predicate) { requireNonNull(predicate); filteredMembers.setPredicate(predicate); } + /** + * Updates the filter of the filtered member list to filter by the given {@code predicate}. + * + * @throws NullPointerException if {@code predicate} is null. + */ @Override public void updateFilteredMemberListForView(Predicate predicate) { requireNonNull(predicate); @@ -279,12 +399,20 @@ public void updateFilteredMemberListForView(Predicate predicate) { //=========== Sorted Member List Accessors =============================================================== + /** + * Updates the sort of the sorted member list to sort by the given {@code comparator}. + * + * @throws NullPointerException if {@code comparator} is null. + */ @Override public void updateSortedMemberList(Comparator comparator) { requireNonNull(comparator); sortedMembers.setComparator(comparator); } + /** + * Override equals method. + */ @Override public boolean equals(Object obj) { // short circuit if same object diff --git a/src/main/java/seedu/address/model/Timestamp.java b/src/main/java/seedu/address/model/Timestamp.java index 998ba094e2a..23f2e74c5e6 100644 --- a/src/main/java/seedu/address/model/Timestamp.java +++ b/src/main/java/seedu/address/model/Timestamp.java @@ -9,14 +9,24 @@ */ public class Timestamp { + /** + * Stands for timestamp message constraints. + */ public static final String MESSAGE_CONSTRAINTS = "Timestamps should only contain digits and can be parsed to long, and it should not be blank"; + + /** + * Stands for validation regex of timestamp. + */ public static final String VALIDATION_REGEX = "[\\p{Digit}]*"; + /** + * Stands for the timestamp value. + */ public final String value; /** - * Constructs a {@code Timestamp}. + * Constructs a {@code Timestamp} with input {@code timestamp}. */ public Timestamp(String timestamp) { requireNonNull(timestamp); @@ -25,7 +35,10 @@ public Timestamp(String timestamp) { } /** - * Returns true if a given string is a valid timestamp. + * Returns whether is valid timestamp. + * + * @param test input string test. + * @return boolean true if a given string is a valid timestamp. */ public static boolean isValidTimestamp(String test) { try { @@ -36,11 +49,19 @@ public static boolean isValidTimestamp(String test) { } } + /** + * Overrides toString method. + * + * @return String of the timestamp value + */ @Override public String toString() { return value; } + /** + * Overrides equals method. + */ @Override public boolean equals(Object other) { return other == this // short circuit if same object @@ -48,6 +69,9 @@ public boolean equals(Object other) { && value.equals(((Timestamp) other).value)); // state check } + /** + * Overrides hashCode method. + */ @Override public int hashCode() { return value.hashCode(); diff --git a/src/main/java/seedu/address/model/UserPrefs.java b/src/main/java/seedu/address/model/UserPrefs.java index bb24ff67afe..22015e05bb8 100644 --- a/src/main/java/seedu/address/model/UserPrefs.java +++ b/src/main/java/seedu/address/model/UserPrefs.java @@ -18,12 +18,12 @@ public class UserPrefs implements ReadOnlyUserPrefs { private Path ezFoodieFilePath = Paths.get("data" , "ezfoodie.json"); /** - * Creates a {@code UserPrefs} with default values. + * Constructs a {@code UserPrefs} with default values. */ public UserPrefs() {} /** - * Creates a {@code UserPrefs} with the prefs in {@code userPrefs}. + * Constructs a {@code UserPrefs} with the prefs in {@code userPrefs}. */ public UserPrefs(ReadOnlyUserPrefs userPrefs) { this(); @@ -39,33 +39,58 @@ public void resetData(ReadOnlyUserPrefs newUserPrefs) { setEzFoodieFilePath(newUserPrefs.getEzFoodieFilePath()); } + /** + * Gets Gui Settings. + */ public GuiSettings getGuiSettings() { return guiSettings; } + /** + * Sets the Gui Settings by this input {@code guiSettings}. + */ public void setGuiSettings(GuiSettings guiSettings) { requireNonNull(guiSettings); this.guiSettings = guiSettings; } + /** + * Gets account file path. + * + * @return Path of account file. + */ public Path getAccountFilePath() { return accountFilePath; } + /** + * Sets the account file path by this input {@code accountFilePath}. + */ public void setAccountFilePath(Path accountFilePath) { requireNonNull(accountFilePath); this.accountFilePath = accountFilePath; } + /** + * Gets EzFoodie file path. + * + * @return Path of EzFoodie file. + */ public Path getEzFoodieFilePath() { return ezFoodieFilePath; } + /** + * Sets the EzFoodie file path by this input {@code ezFoodieFilePath}. + */ public void setEzFoodieFilePath(Path ezFoodieFilePath) { requireNonNull(ezFoodieFilePath); this.ezFoodieFilePath = ezFoodieFilePath; } + /** + * Overrides equals method. + */ @Override public boolean equals(Object other) { if (other == this) { @@ -82,11 +107,19 @@ public boolean equals(Object other) { && ezFoodieFilePath.equals(o.ezFoodieFilePath); } + /** + * Overrides hashCode method. + */ @Override public int hashCode() { return Objects.hash(guiSettings, accountFilePath, ezFoodieFilePath); } + /** + * Overrides toString method. + * + * @return String with gui Setting and file path and location. + */ @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/src/main/java/seedu/address/model/member/Credit.java b/src/main/java/seedu/address/model/member/Credit.java index 0b9eedece8b..932ad000cd9 100644 --- a/src/main/java/seedu/address/model/member/Credit.java +++ b/src/main/java/seedu/address/model/member/Credit.java @@ -47,13 +47,10 @@ public Credit(String credit) { } /** - * Returns true if a given string is a valid credit. - */ - /** - * Returns true if a given string is a valid credit. + * Returns whether is a valid credit. * - * @param test - * @return boolean + * @param test input String test + * @return boolean true if a given string is a valid credit. */ public static boolean isValidCredit(String test) { return test.matches(VALIDATION_REGEX) && test.length() <= LENGTH; @@ -68,6 +65,8 @@ public int getIntValue() { /** * Gets String value of credit for Point use. + * + * @return String of credit value. */ public String getStringValue() { return value; @@ -75,8 +74,6 @@ public String getStringValue() { /** * Overrides toString method. - * - * @return String */ @Override public String toString() { @@ -85,8 +82,6 @@ public String toString() { /** * Overrides equals method. - * - * @return boolean */ @Override public boolean equals(Object other) { @@ -97,8 +92,6 @@ public boolean equals(Object other) { /** * Overrides hashCode method. - * - * @return int */ @Override public int hashCode() { diff --git a/src/main/java/seedu/address/model/reservation/DateTime.java b/src/main/java/seedu/address/model/reservation/DateTime.java index dea58c8471c..b9265bfe42e 100644 --- a/src/main/java/seedu/address/model/reservation/DateTime.java +++ b/src/main/java/seedu/address/model/reservation/DateTime.java @@ -26,7 +26,7 @@ public class DateTime { /** * Constructs a {@code Reservation}. * - * @param dateTime A valid date time. + * @param dateTime a valid date time. */ public DateTime(String dateTime) { requireNonNull(dateTime); @@ -35,13 +35,10 @@ public DateTime(String dateTime) { } /** - * Returns true if a given string is a valid date time. - */ - /** - * Returns true if a given string is a valid date time. + * Returns whether is valid date time * - * @param test - * @return boolean + * @param test input string test + * @return boolean true if a given string is a valid date time. */ public static boolean isValidDateTime(String test) { try { @@ -54,8 +51,6 @@ public static boolean isValidDateTime(String test) { /** * Overrides toString method. - * - * @return String */ @Override public String toString() { @@ -64,8 +59,6 @@ public String toString() { /** * Overrides equals method. - * - * @return boolean */ @Override public boolean equals(Object other) { @@ -76,8 +69,6 @@ public boolean equals(Object other) { /** * Overrides hashCode method. - * - * @return int */ @Override public int hashCode() { diff --git a/src/main/java/seedu/address/model/reservation/Id.java b/src/main/java/seedu/address/model/reservation/Id.java index ffb79f7d671..dff028d3d36 100644 --- a/src/main/java/seedu/address/model/reservation/Id.java +++ b/src/main/java/seedu/address/model/reservation/Id.java @@ -5,7 +5,7 @@ /** * Represents a Reservation's id in the ezFoodie. - * Guarantees: ummutable, is valid as declared in {@link #isValidId(String)} + * Guarantees: immutable, is valid as declared in {@link #isValidId(String)} */ public class Id { @@ -21,7 +21,7 @@ public class Id { public static final String VALIDATION_REGEX = "[\\p{Digit}]*"; /** - * Stands for reservation Id pattern + * Stands for reservation Id pattern. */ public static final String PATTERN = "%06d"; @@ -31,14 +31,14 @@ public class Id { public static final int LENGTH = 6; /** - * Stands for reservation id value + * Stands for reservation id value. */ public final String value; /** * Constructs a {@code Id}. * - * @param id A valid id. + * @param id a valid id. */ public Id(String id) { requireNonNull(id); @@ -47,10 +47,10 @@ public Id(String id) { } /** - * Returns true if a given string is a valid id. + * Returns whether is valid id. * - * @param test - * @return + * @param test input string test. + * @return boolean true if a given string is a valid id. */ public static boolean isValidId(String test) { return test.matches(VALIDATION_REGEX) && test.length() == LENGTH; @@ -59,7 +59,7 @@ public static boolean isValidId(String test) { /** * Overrides toString method. * - * @return String + * @return String print reservation id value. */ @Override public String toString() { @@ -68,8 +68,6 @@ public String toString() { /** * Overrides equals method. - * - * @return boolean */ @Override public boolean equals(Object other) { @@ -80,8 +78,6 @@ public boolean equals(Object other) { /** * Overrides hashCode method. - * - * @return int */ @Override public int hashCode() { diff --git a/src/main/java/seedu/address/model/reservation/Remark.java b/src/main/java/seedu/address/model/reservation/Remark.java index 852fb446246..92c25f21c7e 100644 --- a/src/main/java/seedu/address/model/reservation/Remark.java +++ b/src/main/java/seedu/address/model/reservation/Remark.java @@ -11,18 +11,21 @@ public class Remark { public static final String MESSAGE_CONSTRAINTS = "Remarks can take any values, and it should not be blank"; - /* - * The first character of the address must not be a whitespace, + /** + * Stands for the first character of the address must not be a whitespace, * otherwise " " (a blank string) becomes a valid input. */ public static final String VALIDATION_REGEX = "[^\\s].*"; + /** + * Stands for reservation remark value. + */ public final String value; /** * Constructs a {@code Remark}. * - * @param remark A valid remark. + * @param remark a valid remark. */ public Remark(String remark) { requireNonNull(remark); @@ -31,24 +34,37 @@ public Remark(String remark) { } /** - * Returns true if a given string is a valid remark. + * Returns whether is valid remark. + * + * @param test the string input test. + * @return boolean true if a given string is a valid remark. */ public static boolean isValidRemark(String test) { return test.matches(VALIDATION_REGEX); } /** - * Returns double value of remark. + * Gets double class from a string. + * + * @return double value of remark. */ public double getDoubleValue() { return Double.parseDouble(value); } + /** + * Overrides the toString method. + * + * @return String reservation remark value。 + */ @Override public String toString() { return value; } + /** + * Overrides the equal method. + */ @Override public boolean equals(Object other) { return other == this // short circuit if same object @@ -56,6 +72,9 @@ public boolean equals(Object other) { && value.equals(((Remark) other).value)); // state check } + /** + * Overrides the hashCode method. + */ @Override public int hashCode() { return value.hashCode(); diff --git a/src/main/java/seedu/address/model/reservation/Reservation.java b/src/main/java/seedu/address/model/reservation/Reservation.java index 767d79f9521..7a9b14d6cb4 100644 --- a/src/main/java/seedu/address/model/reservation/Reservation.java +++ b/src/main/java/seedu/address/model/reservation/Reservation.java @@ -18,7 +18,12 @@ public class Reservation { private final Remark remark; /** - * Every field must be present and not null. + * Constructs a {@code Reservation}, + * and every field must be present and not null. + * + * @param id member Id + * @param dateTime Reservation date time + * @param remark reservation remark */ public Reservation(Id id, DateTime dateTime, Remark remark) { requireAllNonNull(id, dateTime, remark); @@ -27,14 +32,29 @@ public Reservation(Id id, DateTime dateTime, Remark remark) { this.remark = remark; } + /** + * Gets reservation id. + * + * @return id the reservation member id + */ public Id getId() { return id; } + /** + * Gets reservation's date time. + * + * @return DateTime of reservation. + */ public DateTime getDateTime() { return dateTime; } + /** + * Gets reservation's remark. + * + * @return Remark of reservation. + */ public Remark getRemark() { return remark; } @@ -59,12 +79,19 @@ public boolean equals(Object other) { return otherDate.isEqual(date); } + /** + * Overrides hashCode for custom fields hashing instead of implementing your own. + */ @Override public int hashCode() { - // use this method for custom fields hashing instead of implementing your own return Objects.hash(dateTime, remark); } + /** + * Overrides toString method. + * + * @return String of reservation's information including Id, DateTime and remark. + */ @Override public String toString() { final StringBuilder builder = new StringBuilder(); diff --git a/src/main/java/seedu/address/model/tag/Tag.java b/src/main/java/seedu/address/model/tag/Tag.java index 0f66ea672f3..a2aa87d9d78 100644 --- a/src/main/java/seedu/address/model/tag/Tag.java +++ b/src/main/java/seedu/address/model/tag/Tag.java @@ -9,7 +9,14 @@ */ public class Tag { + /** + * Stands for tag message constraints. + */ public static final String MESSAGE_CONSTRAINTS = "Tags names should be alphanumeric"; + + /** + * Stands for tag validation regex. + */ public static final String VALIDATION_REGEX = "\\p{Alnum}+"; public final String tagName; diff --git a/src/main/java/seedu/address/model/transaction/Billing.java b/src/main/java/seedu/address/model/transaction/Billing.java index 864c55bf918..7d130153ec5 100644 --- a/src/main/java/seedu/address/model/transaction/Billing.java +++ b/src/main/java/seedu/address/model/transaction/Billing.java @@ -9,17 +9,31 @@ */ public class Billing { + /** + * Stands for message constraints of transaction billing. + */ public static final String MESSAGE_CONSTRAINTS = "Billings should be numeric with 2 decimal places"; + + /** + * Stands for validation regex of transaction billing. + */ public static final String VALIDATION_REGEX = "\\d*\\.\\d{2}$"; + + /** + * Stands for transaction billing max amount length + */ public static final int LENGTH = 7; // Max amount is 9999.99 + /** + * Stands for transaction billing value. + */ public final String value; /** * Constructs a {@code Billing}. * - * @param billing A valid billing amount. + * @param billing a valid billing amount. */ public Billing(String billing) { requireNonNull(billing); @@ -28,7 +42,10 @@ public Billing(String billing) { } /** - * Returns true if a given string is a valid billing amount. + * Returns whether is valid billing. + * + * @param test input string test. + * @return boolean true if a given string is a valid billing amount. */ public static boolean isValidBilling(String test) { return test.matches(VALIDATION_REGEX) && test.length() <= LENGTH; @@ -41,11 +58,19 @@ public double getDoubleValue() { return Double.parseDouble(value); } + /** + * Overrides toString method. + * + * @return transaction billing value. + */ @Override public String toString() { return value; } + /** + * Overrides the equals method. + */ @Override public boolean equals(Object other) { return other == this // short circuit if same object @@ -53,6 +78,9 @@ public boolean equals(Object other) { && value.equals(((Billing) other).value)); // state check } + /** + * Overrides the hashcode method. + */ @Override public int hashCode() { return value.hashCode(); diff --git a/src/main/java/seedu/address/model/transaction/Id.java b/src/main/java/seedu/address/model/transaction/Id.java index 4bc2a1813c0..ce7cbc8e0e4 100644 --- a/src/main/java/seedu/address/model/transaction/Id.java +++ b/src/main/java/seedu/address/model/transaction/Id.java @@ -9,18 +9,31 @@ */ public class Id { + /** + * Stands for message constraints of transaction Id. + */ public static final String MESSAGE_CONSTRAINTS = "Transactions should only contain 6 digits, and it should not be blank"; + + /** + * Stands for validation regex of transaction Id. + */ public static final String VALIDATION_REGEX = "[\\p{Digit}]*"; - public static final String PATTERN = "%06d"; + + /** + * Stands for transaction Id max length + */ public static final int LENGTH = 6; + /** + * Stands for transaction Id value. + */ public final String value; /** * Constructs a {@code Id}. * - * @param id A valid id. + * @param id a valid id. */ public Id(String id) { requireNonNull(id); @@ -29,17 +42,29 @@ public Id(String id) { } /** - * Returns true if a given string is a valid id. + * Returns whether is valid id. + * + * @param test input string test + * @return boolean true if a given string is a valid id. */ + public static boolean isValidId(String test) { return test.matches(VALIDATION_REGEX) && test.length() == LENGTH; } + /** + * Overrides the toString method. + * + * @return transaction billing value. + */ @Override public String toString() { return value; } + /** + * Overrides equals method. + */ @Override public boolean equals(Object other) { return other == this // short circuit if same object @@ -47,6 +72,9 @@ public boolean equals(Object other) { && value.equals(((Id) other).value)); // state check } + /** + * Overrides hashCode method. + */ @Override public int hashCode() { return value.hashCode(); diff --git a/src/main/java/seedu/address/model/transaction/Transaction.java b/src/main/java/seedu/address/model/transaction/Transaction.java index 6319d1d054e..fe42032695f 100644 --- a/src/main/java/seedu/address/model/transaction/Transaction.java +++ b/src/main/java/seedu/address/model/transaction/Transaction.java @@ -17,7 +17,12 @@ public class Transaction { private final Billing billing; /** - * Every field must be present and not null. + * Constructs a {@code Transaction}, + * every field must be present and not null. + * + * @param id member Id + * @param timestamp transaction timestamp + * @param billing billing details */ public Transaction(Id id, Timestamp timestamp, Billing billing) { requireAllNonNull(id, timestamp, billing); @@ -26,21 +31,39 @@ public Transaction(Id id, Timestamp timestamp, Billing billing) { this.billing = billing; } + /** + * Gets transaction id. + * + * @return id the transaction member id. + */ public Id getId() { return id; } + /** + * Gets transaction timestamp. + * + * @return id the transaction timestamp. + */ public Timestamp getTimestamp() { return timestamp; } + /** + * Gets transaction billing. + * + * @return id the transaction billing. + */ public Billing getBilling() { return billing; } /** - * Returns true if both transactions have the same id. + * Returns whether is same id between other transactions. * This defines a weaker notion of equality between two transactions. + * + * @param otherTransaction + * @return boolean true if both transactions have the same id. */ public boolean isSameId(Transaction otherTransaction) { if (otherTransaction == this) { @@ -71,12 +94,20 @@ public boolean equals(Object other) { && otherTransaction.getBilling().equals(getBilling()); } + /** + * Overrides hashCode method. + */ @Override public int hashCode() { // use this method for custom fields hashing instead of implementing your own return Objects.hash(timestamp, billing); } + /** + * Overrides toString method. + * + * @return String of transaction's information including Id, timestamp and billing. + */ @Override public String toString() { final StringBuilder builder = new StringBuilder(); diff --git a/src/main/java/seedu/address/model/util/SampleDataUtil.java b/src/main/java/seedu/address/model/util/SampleDataUtil.java index 706d94a2b2f..698711bad94 100644 --- a/src/main/java/seedu/address/model/util/SampleDataUtil.java +++ b/src/main/java/seedu/address/model/util/SampleDataUtil.java @@ -118,6 +118,9 @@ public static Member[] getSampleMembers() { }; } + /** + * Gets default password. + */ public static ReadOnlyAccount getDefaultPassword() { Password password; try { @@ -128,6 +131,9 @@ public static ReadOnlyAccount getDefaultPassword() { return new Account(password); } + /** + * Gets Sample Ezfoodie + */ public static ReadOnlyEzFoodie getSampleEzFoodie() { EzFoodie sampleEf = new EzFoodie(); for (Member sampleMember : getSampleMembers()) { diff --git a/src/main/java/seedu/address/storage/AccountStorage.java b/src/main/java/seedu/address/storage/AccountStorage.java index a8862275ce3..8d129af1c0d 100644 --- a/src/main/java/seedu/address/storage/AccountStorage.java +++ b/src/main/java/seedu/address/storage/AccountStorage.java @@ -19,7 +19,8 @@ public interface AccountStorage { /** * Returns Account as a {@link ReadOnlyAccount}. - * Returns {@code Optional.empty()} if storage file is not found. + * Returns {@code Optional.empty()} if storage file is not found. + * * @throws DataConversionException if the data in storage is not in the expected format. * @throws IOException if there was any problem when reading from the storage. */ @@ -32,6 +33,7 @@ public interface AccountStorage { /** * Saves the given {@link ReadOnlyAccount} to the storage. + * * @param account cannot be null. * @throws IOException if there was any problem writing to the file. */ diff --git a/src/main/java/seedu/address/storage/EzFoodieStorage.java b/src/main/java/seedu/address/storage/EzFoodieStorage.java index 004f9e37e3e..793bcb1b1cb 100644 --- a/src/main/java/seedu/address/storage/EzFoodieStorage.java +++ b/src/main/java/seedu/address/storage/EzFoodieStorage.java @@ -19,7 +19,8 @@ public interface EzFoodieStorage { /** * Returns ezFoodie data as a {@link ReadOnlyEzFoodie}. - * Returns {@code Optional.empty()} if storage file is not found. + * Returns {@code Optional.empty()} if storage file is not found. + * * @throws DataConversionException if the data in storage is not in the expected format. * @throws IOException if there was any problem when reading from the storage. */ @@ -32,6 +33,7 @@ public interface EzFoodieStorage { /** * Saves the given {@link ReadOnlyEzFoodie} to the storage. + * * @param ezFoodie cannot be null. * @throws IOException if there was any problem writing to the file. */ diff --git a/src/main/java/seedu/address/storage/JsonAccountStorage.java b/src/main/java/seedu/address/storage/JsonAccountStorage.java index b5193a96e84..7c355e4fac8 100644 --- a/src/main/java/seedu/address/storage/JsonAccountStorage.java +++ b/src/main/java/seedu/address/storage/JsonAccountStorage.java @@ -23,16 +23,31 @@ public class JsonAccountStorage implements AccountStorage { private Path filePath; + /** + * Constructs {@code JsonAccountStorage} with {@code filePath}. + */ public JsonAccountStorage(Path filePath) { this.filePath = filePath; } + /** + * gets account file path. + * + * @return Path of account file. + */ public Path getAccountFilePath() { return filePath; } + /** + * Returns Account as a {@link ReadOnlyAccount}. + * Returns {@code Optional.empty()} if storage file is not found. + * + * @throws DataConversionException if the data in storage is not in the expected format. + * @throws IOException if there was any problem when reading from the storage. + */ @Override - public Optional readAccount() throws DataConversionException, IOException { + public Optional readAccount() throws DataConversionException { return readAccount(filePath); } @@ -59,6 +74,12 @@ public Optional readAccount(Path filePath) throws DataConversio } } + /** + * Saves the given {@link ReadOnlyAccount} to the storage. + * + * @param account cannot be null. + * @throws IOException if there was any problem writing to the file. + */ @Override public void saveAccount(ReadOnlyAccount account) throws IOException { saveAccount(account, filePath); diff --git a/src/main/java/seedu/address/storage/JsonAdaptedReservation.java b/src/main/java/seedu/address/storage/JsonAdaptedReservation.java index 0c5ec9f5fa7..0d41eebc15f 100644 --- a/src/main/java/seedu/address/storage/JsonAdaptedReservation.java +++ b/src/main/java/seedu/address/storage/JsonAdaptedReservation.java @@ -32,7 +32,7 @@ public JsonAdaptedReservation(@JsonProperty("id") String id, @JsonProperty("date } /** - * Converts a given {@code Reservation} into this class for Jackson use. + * Constructs a given {@code Reservation} into this class for Jackson use. */ public JsonAdaptedReservation(Reservation source) { id = source.getId().value; diff --git a/src/main/java/seedu/address/storage/JsonAdaptedTag.java b/src/main/java/seedu/address/storage/JsonAdaptedTag.java index 0df22bdb754..bd90bfcbf67 100644 --- a/src/main/java/seedu/address/storage/JsonAdaptedTag.java +++ b/src/main/java/seedu/address/storage/JsonAdaptedTag.java @@ -22,7 +22,7 @@ public JsonAdaptedTag(String tagName) { } /** - * Converts a given {@code Tag} into this class for Jackson use. + * Constructs a given {@code Tag} into this class for Jackson use. */ public JsonAdaptedTag(Tag source) { tagName = source.tagName; diff --git a/src/main/java/seedu/address/storage/JsonAdaptedTransaction.java b/src/main/java/seedu/address/storage/JsonAdaptedTransaction.java index 88112851294..92f06828e54 100644 --- a/src/main/java/seedu/address/storage/JsonAdaptedTransaction.java +++ b/src/main/java/seedu/address/storage/JsonAdaptedTransaction.java @@ -34,7 +34,7 @@ public JsonAdaptedTransaction(@JsonProperty("id") String id, } /** - * Converts a given {@code Transaction} into this class for Jackson use. + * Constructs a given {@code Transaction} into this class for Jackson use. */ public JsonAdaptedTransaction(Transaction source) { id = source.getId().value; diff --git a/src/main/java/seedu/address/storage/JsonEzFoodieStorage.java b/src/main/java/seedu/address/storage/JsonEzFoodieStorage.java index d7ed0179528..8711fee8899 100644 --- a/src/main/java/seedu/address/storage/JsonEzFoodieStorage.java +++ b/src/main/java/seedu/address/storage/JsonEzFoodieStorage.java @@ -23,14 +23,29 @@ public class JsonEzFoodieStorage implements EzFoodieStorage { private Path filePath; + /** + * Constructs a {@code JsonEzFoodieStorage} with the given ezFoodie file path details. + */ public JsonEzFoodieStorage(Path filePath) { this.filePath = filePath; } + /** + * Gets EzFoodie file path. + * + * @return Path of EzFoodie file + */ public Path getEzFoodieFilePath() { return filePath; } + /** + * Returns ezFoodie data as a {@link ReadOnlyEzFoodie}. + * Returns {@code Optional.empty()} if storage file is not found. + * + * @throws DataConversionException if the data in storage is not in the expected format. + * @throws IOException if there was any problem when reading from the storage. + */ @Override public Optional readEzFoodie() throws DataConversionException { return readEzFoodie(filePath); @@ -59,6 +74,12 @@ public Optional readEzFoodie(Path filePath) throws DataConvers } } + /** + * Saves the given {@link ReadOnlyEzFoodie} to the storage. + * + * @param ezFoodie cannot be null. + * @throws IOException if there was any problem writing to the file. + */ @Override public void saveEzFoodie(ReadOnlyEzFoodie ezFoodie) throws IOException { saveEzFoodie(ezFoodie, filePath); diff --git a/src/main/java/seedu/address/storage/JsonSerializableEzFoodie.java b/src/main/java/seedu/address/storage/JsonSerializableEzFoodie.java index 7ee24f8e20f..2baa9a9c0c0 100644 --- a/src/main/java/seedu/address/storage/JsonSerializableEzFoodie.java +++ b/src/main/java/seedu/address/storage/JsonSerializableEzFoodie.java @@ -18,7 +18,9 @@ */ @JsonRootName(value = "ezfoodie") class JsonSerializableEzFoodie { - + /** + * Stands for message od duplicated members. + */ public static final String MESSAGE_DUPLICATE_MEMBER = "Members list contains duplicate member(s)."; private final List members = new ArrayList<>(); diff --git a/src/main/java/seedu/address/storage/JsonUserPrefsStorage.java b/src/main/java/seedu/address/storage/JsonUserPrefsStorage.java index bc2bbad84aa..c81da3de4ef 100644 --- a/src/main/java/seedu/address/storage/JsonUserPrefsStorage.java +++ b/src/main/java/seedu/address/storage/JsonUserPrefsStorage.java @@ -16,15 +16,28 @@ public class JsonUserPrefsStorage implements UserPrefsStorage { private Path filePath; + /** + * Constructs a {@code JsonUserPrefsStorage} with input {code filePath}. + */ public JsonUserPrefsStorage(Path filePath) { this.filePath = filePath; } + /** + * Returns the file path of the UserPrefs data file. + */ @Override public Path getUserPrefsFilePath() { return filePath; } + /** + * Returns UserPrefs data from storage. + * Returns {@code Optional.empty()} if storage file is not found. + * + * @throws DataConversionException if the data in storage is not in the expected format. + * @throws IOException if there was any problem when reading from the storage. + */ @Override public Optional readUserPrefs() throws DataConversionException { return readUserPrefs(filePath); @@ -32,6 +45,7 @@ public Optional readUserPrefs() throws DataConversionException { /** * Similar to {@link #readUserPrefs()} + * * @param prefsFilePath location of the data. Cannot be null. * @throws DataConversionException if the file format is not as expected. */ @@ -39,6 +53,12 @@ public Optional readUserPrefs(Path prefsFilePath) throws DataConversi return JsonUtil.readJsonFile(prefsFilePath, UserPrefs.class); } + /** + * Saves the given {@link seedu.address.model.ReadOnlyUserPrefs} to the storage. + * + * @param userPrefs cannot be null. + * @throws IOException if there was any problem writing to the file. + */ @Override public void saveUserPrefs(ReadOnlyUserPrefs userPrefs) throws IOException { JsonUtil.saveJsonFile(userPrefs, filePath); diff --git a/src/main/java/seedu/address/storage/Storage.java b/src/main/java/seedu/address/storage/Storage.java index 719c48044ed..64bf7ee2933 100644 --- a/src/main/java/seedu/address/storage/Storage.java +++ b/src/main/java/seedu/address/storage/Storage.java @@ -15,24 +15,66 @@ */ public interface Storage extends EzFoodieStorage, AccountStorage, UserPrefsStorage { + /** + * Returns UserPrefs data from storage. + * Returns {@code Optional.empty()} if storage file is not found. + * + * @throws DataConversionException if the data in storage is not in the expected format. + * @throws IOException if there was any problem when reading from the storage. + */ @Override Optional readUserPrefs() throws DataConversionException, IOException; + /** + * Saves the given {@link seedu.address.model.ReadOnlyUserPrefs} to the storage. + * + * @param userPrefs cannot be null. + * @throws IOException if there was any problem writing to the file. + */ @Override void saveUserPrefs(ReadOnlyUserPrefs userPrefs) throws IOException; + /** + * Returns Account as a {@link ReadOnlyAccount}. + * Returns {@code Optional.empty()} if storage file is not found. + * + * @throws DataConversionException if the data in storage is not in the expected format. + * @throws IOException if there was any problem when reading from the storage. + */ @Override Optional readAccount() throws DataConversionException, IOException; + /** + * Saves the given {@link ReadOnlyAccount} to the storage. + * + * @param account cannot be null. + * @throws IOException if there was any problem writing to the file. + */ @Override void saveAccount(ReadOnlyAccount account) throws IOException; + /** + * Returns the file path of the data file. + */ @Override Path getEzFoodieFilePath(); + /** + * Returns ezFoodie data as a {@link ReadOnlyEzFoodie}. + * Returns {@code Optional.empty()} if storage file is not found. + * + * @throws DataConversionException if the data in storage is not in the expected format. + * @throws IOException if there was any problem when reading from the storage. + */ @Override Optional readEzFoodie() throws DataConversionException, IOException; + /** + * Saves the given {@link ReadOnlyEzFoodie} to the storage. + * + * @param ezFoodie cannot be null. + * @throws IOException if there was any problem writing to the file. + */ @Override void saveEzFoodie(ReadOnlyEzFoodie ezFoodie) throws IOException; diff --git a/src/main/java/seedu/address/storage/StorageManager.java b/src/main/java/seedu/address/storage/StorageManager.java index 4a4b49e38a3..81ee2e29037 100644 --- a/src/main/java/seedu/address/storage/StorageManager.java +++ b/src/main/java/seedu/address/storage/StorageManager.java @@ -23,7 +23,7 @@ public class StorageManager implements Storage { private UserPrefsStorage userPrefsStorage; /** - * Creates a {@code StorageManager} with the given {@code AccountStorage}, {@code ezFoodieStorage} + * Constructs a {@code StorageManager} with the given {@code AccountStorage}, {@code ezFoodieStorage} * and {@code UserPrefStorage}. */ public StorageManager(AccountStorage accountStorage, EzFoodieStorage ezFoodieStorage, @@ -36,16 +36,32 @@ public StorageManager(AccountStorage accountStorage, EzFoodieStorage ezFoodieSto // ================ UserPrefs methods ============================== + /** + * Returns the file path of the UserPrefs data file. + */ @Override public Path getUserPrefsFilePath() { return userPrefsStorage.getUserPrefsFilePath(); } + /** + * Returns UserPrefs data from storage. + * Returns {@code Optional.empty()} if storage file is not found. + * + * @throws DataConversionException if the data in storage is not in the expected format. + * @throws IOException if there was any problem when reading from the storage. + */ @Override public Optional readUserPrefs() throws DataConversionException, IOException { return userPrefsStorage.readUserPrefs(); } + /** + * Saves the given {@link seedu.address.model.ReadOnlyUserPrefs} to the storage. + * + * @param userPrefs cannot be null. + * @throws IOException if there was any problem writing to the file. + */ @Override public void saveUserPrefs(ReadOnlyUserPrefs userPrefs) throws IOException { userPrefsStorage.saveUserPrefs(userPrefs); @@ -53,27 +69,49 @@ public void saveUserPrefs(ReadOnlyUserPrefs userPrefs) throws IOException { // ================== Account methods =============================== + /** + * Returns the file path of the account file. + */ @Override public Path getAccountFilePath() { return accountStorage.getAccountFilePath(); } + /** + * Returns Account as a {@link ReadOnlyAccount}. + * Returns {@code Optional.empty()} if storage file is not found. + * + * @throws DataConversionException if the data in storage is not in the expected format. + * @throws IOException if there was any problem when reading from the storage. + */ @Override public Optional readAccount() throws DataConversionException, IOException { return accountStorage.readAccount(); } + /** + * @see #getAccountFilePath() + */ @Override public Optional readAccount(Path filePath) throws DataConversionException, IOException { logger.fine("Attempting to read account from file: " + filePath); return accountStorage.readAccount(filePath); } + /** + * Saves the given {@link ReadOnlyAccount} to the storage. + * + * @param account cannot be null. + * @throws IOException if there was any problem writing to the file. + */ @Override public void saveAccount(ReadOnlyAccount account) throws IOException { accountStorage.saveAccount(account); } + /** + * @see #saveAccount(ReadOnlyAccount) + */ @Override public void saveAccount(ReadOnlyAccount account, Path filePath) throws IOException { logger.fine("Attempting to write to account file: " + filePath); @@ -82,27 +120,49 @@ public void saveAccount(ReadOnlyAccount account, Path filePath) throws IOExcepti // ================== EzFoodie methods =============================== + /** + * Returns the file path of the data file. + */ @Override public Path getEzFoodieFilePath() { return ezFoodieStorage.getEzFoodieFilePath(); } + /** + * Returns ezFoodie data as a {@link ReadOnlyEzFoodie}. + * Returns {@code Optional.empty()} if storage file is not found. + * + * @throws DataConversionException if the data in storage is not in the expected format. + * @throws IOException if there was any problem when reading from the storage. + */ @Override public Optional readEzFoodie() throws DataConversionException, IOException { return readEzFoodie(ezFoodieStorage.getEzFoodieFilePath()); } + /** + * @see #getEzFoodieFilePath() + */ @Override public Optional readEzFoodie(Path filePath) throws DataConversionException, IOException { logger.fine("Attempting to read data from file: " + filePath); return ezFoodieStorage.readEzFoodie(filePath); } + /** + * Saves the given {@link ReadOnlyEzFoodie} to the storage. + * + * @param ezFoodie cannot be null. + * @throws IOException if there was any problem writing to the file. + */ @Override public void saveEzFoodie(ReadOnlyEzFoodie ezFoodie) throws IOException { saveEzFoodie(ezFoodie, ezFoodieStorage.getEzFoodieFilePath()); } + /** + * @see #saveEzFoodie(ReadOnlyEzFoodie) + */ @Override public void saveEzFoodie(ReadOnlyEzFoodie ezFoodie, Path filePath) throws IOException { logger.fine("Attempting to write to data file: " + filePath); diff --git a/src/main/java/seedu/address/storage/UserPrefsStorage.java b/src/main/java/seedu/address/storage/UserPrefsStorage.java index 29eef178dbc..1eb07ff2880 100644 --- a/src/main/java/seedu/address/storage/UserPrefsStorage.java +++ b/src/main/java/seedu/address/storage/UserPrefsStorage.java @@ -20,7 +20,8 @@ public interface UserPrefsStorage { /** * Returns UserPrefs data from storage. - * Returns {@code Optional.empty()} if storage file is not found. + * Returns {@code Optional.empty()} if storage file is not found. + * * @throws DataConversionException if the data in storage is not in the expected format. * @throws IOException if there was any problem when reading from the storage. */ @@ -28,6 +29,7 @@ public interface UserPrefsStorage { /** * Saves the given {@link seedu.address.model.ReadOnlyUserPrefs} to the storage. + * * @param userPrefs cannot be null. * @throws IOException if there was any problem writing to the file. */ diff --git a/src/main/java/seedu/address/ui/CommandBox.java b/src/main/java/seedu/address/ui/CommandBox.java index 08210116ac1..1833a67cf47 100644 --- a/src/main/java/seedu/address/ui/CommandBox.java +++ b/src/main/java/seedu/address/ui/CommandBox.java @@ -13,10 +13,13 @@ import seedu.address.logic.parser.exceptions.ParseException; /** - * The UI component that is responsible for receiving user command inputs. + * Represents for the UI component that is responsible for receiving user command inputs. */ public class CommandBox extends UiPart { + /** + * Stands for command box error style. + */ public static final String ERROR_STYLE_CLASS = "error"; private static final String FXML = "CommandBox.fxml"; @@ -26,7 +29,7 @@ public class CommandBox extends UiPart { private TextField commandTextField; /** - * Creates a {@code CommandBox} with the given {@code CommandExecutor}. + * Constructs a {@code CommandBox} with the given {@code CommandExecutor}. */ public CommandBox(CommandExecutor commandExecutor) { super(FXML); diff --git a/src/main/java/seedu/address/ui/HelpWindow.java b/src/main/java/seedu/address/ui/HelpWindow.java index 8eaac33644d..08ed5b5437d 100644 --- a/src/main/java/seedu/address/ui/HelpWindow.java +++ b/src/main/java/seedu/address/ui/HelpWindow.java @@ -11,11 +11,18 @@ import seedu.address.commons.core.LogsCenter; /** - * Controller for a help page + * Represents for Controlling a help page */ public class HelpWindow extends UiPart { + /** + * Stands for help window URL to tP web page. + */ public static final String OFFICIAL_URL = "https://ay2122s1-cs2103t-f12-4.github.io/tp/"; + + /** + * Stands for help command message. + */ public static final String HELP_MESSAGE = "Features:\n" + "Add member: add -mem -n -p -e -a
\n" + "Search by name: find -mem -n \n" @@ -42,7 +49,7 @@ public class HelpWindow extends UiPart { private Label helpMessage; /** - * Creates a new HelpWindow. + * Constructs a new {@code HelpWindow}. * * @param root Stage to use as the root of the HelpWindow. */ @@ -52,7 +59,7 @@ public HelpWindow(Stage root) { } /** - * Creates a new HelpWindow. + * Constructs a new {@code HelpWindow}. */ public HelpWindow() { this(new Stage()); diff --git a/src/main/java/seedu/address/ui/MainWindow.java b/src/main/java/seedu/address/ui/MainWindow.java index 97d46ff9ffb..4a6cabcc4d6 100644 --- a/src/main/java/seedu/address/ui/MainWindow.java +++ b/src/main/java/seedu/address/ui/MainWindow.java @@ -54,7 +54,7 @@ public class MainWindow extends UiPart { private StackPane statusbarPlaceholder; /** - * Creates a {@code MainWindow} with the given {@code Stage} and {@code Logic}. + * Constructs a {@code MainWindow} with the given {@code Stage} and {@code Logic}. */ public MainWindow(Stage primaryStage, Logic logic) { super(FXML, primaryStage); @@ -73,6 +73,11 @@ public MainWindow(Stage primaryStage, Logic logic) { summaryWindow = new SummaryWindow(logic); } + /** + * Gets primary stage. + * + * @return Stage for the primary stage + */ public Stage getPrimaryStage() { return primaryStage; } diff --git a/src/main/java/seedu/address/ui/MemberCard.java b/src/main/java/seedu/address/ui/MemberCard.java index f615fc765f8..fd0246bf66a 100644 --- a/src/main/java/seedu/address/ui/MemberCard.java +++ b/src/main/java/seedu/address/ui/MemberCard.java @@ -25,7 +25,6 @@ public class MemberCard extends UiPart { * * @see The issue on AddressBook level 4 */ - public final Member member; @FXML @@ -58,7 +57,7 @@ public class MemberCard extends UiPart { private FlowPane reservations; /** - * Creates a {@code MemberCode} with the given {@code Member} and index to display. + * Constructs a {@code MemberCode} with the given {@code Member} and index to display. */ public MemberCard(Member member, int displayedIndex) { super(FXML); @@ -91,6 +90,9 @@ public MemberCard(Member member, int displayedIndex) { .forEach(tag -> tags.getChildren().add(new Label(tag.tagName))); } + /** + * Overrides the equals method. + */ @Override public boolean equals(Object other) { // short circuit if same object diff --git a/src/main/java/seedu/address/ui/MemberListPanel.java b/src/main/java/seedu/address/ui/MemberListPanel.java index 7609f688fe6..d9b447e8b9a 100644 --- a/src/main/java/seedu/address/ui/MemberListPanel.java +++ b/src/main/java/seedu/address/ui/MemberListPanel.java @@ -11,7 +11,7 @@ import seedu.address.model.member.Member; /** - * Panel containing the list of members. + * Represents for Panel containing the list of members. */ public class MemberListPanel extends UiPart { private static final String FXML = "MemberListPanel.fxml"; diff --git a/src/main/java/seedu/address/ui/MemberViewWindow.java b/src/main/java/seedu/address/ui/MemberViewWindow.java index 16aff3b3cc7..2c5ca47e177 100644 --- a/src/main/java/seedu/address/ui/MemberViewWindow.java +++ b/src/main/java/seedu/address/ui/MemberViewWindow.java @@ -31,6 +31,9 @@ public MemberViewWindow(Logic logic) { memberDetailsView.setCellFactory(listView -> new MemberViewListCell()); } + /** + * Represents a inner class for MemberViewListCell + */ class MemberViewListCell extends ListCell { @Override protected void updateItem(Member member, boolean empty) { diff --git a/src/main/java/seedu/address/ui/ResultDisplay.java b/src/main/java/seedu/address/ui/ResultDisplay.java index 7d98e84eedf..1b8c96b4e87 100644 --- a/src/main/java/seedu/address/ui/ResultDisplay.java +++ b/src/main/java/seedu/address/ui/ResultDisplay.java @@ -20,6 +20,11 @@ public ResultDisplay() { super(FXML); } + /** + * Sets feedback to User with given message to display {@code feedbackToUser}. + * + * @param feedbackToUser message to display + */ public void setFeedbackToUser(String feedbackToUser) { requireNonNull(feedbackToUser); resultDisplay.setText(feedbackToUser); diff --git a/src/main/java/seedu/address/ui/SummaryWindow.java b/src/main/java/seedu/address/ui/SummaryWindow.java index 16b06bc6979..c2ef93037eb 100644 --- a/src/main/java/seedu/address/ui/SummaryWindow.java +++ b/src/main/java/seedu/address/ui/SummaryWindow.java @@ -23,9 +23,10 @@ public class SummaryWindow extends UiPart { private Label summaryMessage; /** - * Creates a new SummaryWindow. + * Constructs a new {@code SummaryWindow} . * * @param root Stage to use as the root of the SummaryWindow. + * @param logic summary of logic. */ public SummaryWindow(Stage root, Logic logic) { super(FXML, root); @@ -34,7 +35,7 @@ public SummaryWindow(Stage root, Logic logic) { } /** - * Creates a new SummaryWindow. + * Constructs a new {@code SummaryWindow} with input {@code logic}. */ public SummaryWindow(Logic logic) { this(new Stage(), logic); diff --git a/src/main/java/seedu/address/ui/UiManager.java b/src/main/java/seedu/address/ui/UiManager.java index 882027e4537..df66bc301d7 100644 --- a/src/main/java/seedu/address/ui/UiManager.java +++ b/src/main/java/seedu/address/ui/UiManager.java @@ -16,7 +16,9 @@ * The manager of the UI component. */ public class UiManager implements Ui { - + /** + * Stands for alert dialog pane filed id. + */ public static final String ALERT_DIALOG_PANE_FIELD_ID = "alertDialogPane"; private static final Logger logger = LogsCenter.getLogger(UiManager.class); @@ -33,6 +35,9 @@ public UiManager(Logic logic) { this.logic = logic; } + /** + * Starts the UI (and the App). + */ @Override public void start(Stage primaryStage) { logger.info("Starting UI..."); From 9ad3741bf0af8ef7b760aad55d6ff1f250efd422 Mon Sep 17 00:00:00 2001 From: Zhang Zhiyao Date: Thu, 4 Nov 2021 22:48:50 +0800 Subject: [PATCH 4/5] javadoc update --- .../seedu/address/commons/core/Config.java | 19 +++--------- .../address/commons/core/GuiSettings.java | 3 -- .../address/commons/core/LogsCenter.java | 3 +- .../seedu/address/commons/core/Version.java | 26 ++++++---------- .../address/commons/core/index/Index.java | 3 -- .../address/logic/commands/AddCommand.java | 2 +- .../logic/commands/AddMemberCommand.java | 7 ++--- .../logic/commands/AddReservationCommand.java | 11 +++---- .../logic/commands/AddTransactionCommand.java | 16 +++++----- .../address/logic/commands/ClearCommand.java | 5 ++- .../address/logic/commands/CommandResult.java | 29 ++++++----------- .../address/logic/commands/DeleteCommand.java | 2 +- .../logic/commands/DeleteMemberCommand.java | 13 +++----- .../commands/DeleteReservationCommand.java | 20 ++++++------ .../commands/DeleteTransactionCommand.java | 18 ++++------- .../address/logic/commands/EditCommand.java | 1 - .../logic/commands/EditMemberCommand.java | 31 ++----------------- .../commands/EditReservationCommand.java | 28 +++++------------ .../commands/EditTransactionCommand.java | 30 ++++++------------ .../address/logic/commands/ExitCommand.java | 2 +- .../address/logic/commands/FindCommand.java | 25 ++++++--------- .../address/logic/commands/HelpCommand.java | 2 +- .../address/logic/commands/ListCommand.java | 5 +-- .../address/logic/commands/LoginCommand.java | 4 +-- .../address/logic/commands/LogoutCommand.java | 2 +- .../address/logic/commands/RedeemCommand.java | 14 ++++----- .../address/logic/commands/SortCommand.java | 9 ++---- .../logic/commands/SummaryCommand.java | 5 +-- .../address/logic/commands/ViewCommand.java | 7 ++--- .../commands/exceptions/CommandException.java | 5 --- 30 files changed, 110 insertions(+), 237 deletions(-) diff --git a/src/main/java/seedu/address/commons/core/Config.java b/src/main/java/seedu/address/commons/core/Config.java index a88bc3c50de..92eda01f430 100644 --- a/src/main/java/seedu/address/commons/core/Config.java +++ b/src/main/java/seedu/address/commons/core/Config.java @@ -19,36 +19,30 @@ public class Config { private Path userPrefsFilePath = Paths.get("preferences.json"); /** - * Gets Log Level. - * - * @return Level + * Gets Log Level from {@code logLevel}. */ public Level getLogLevel() { return logLevel; } /** - * Sets Log Level. - * - * @param logLevel + * Sets Log Level from {@code logLevel}. */ public void setLogLevel(Level logLevel) { this.logLevel = logLevel; } /** - * Gets User Prefs File Path. + * Gets User Prefs File Path from {@code userPrefsFilePath}. * - * @return Path + * @return Path of tge user prefs file path */ public Path getUserPrefsFilePath() { return userPrefsFilePath; } /** - * Sets User Prefs File Path. - * - * @param userPrefsFilePath + * Sets User Prefs File Path from {@code userPrefsFilePath}. */ public void setUserPrefsFilePath(Path userPrefsFilePath) { this.userPrefsFilePath = userPrefsFilePath; @@ -56,9 +50,6 @@ public void setUserPrefsFilePath(Path userPrefsFilePath) { /** * Overrides the equal method for Config class. - * - * @param other - * @return boolean */ @Override public boolean equals(Object other) { diff --git a/src/main/java/seedu/address/commons/core/GuiSettings.java b/src/main/java/seedu/address/commons/core/GuiSettings.java index 3c900ef379a..4015ab38c2e 100644 --- a/src/main/java/seedu/address/commons/core/GuiSettings.java +++ b/src/main/java/seedu/address/commons/core/GuiSettings.java @@ -64,9 +64,6 @@ public Point getWindowCoordinates() { /** * Overrides the equal method for GuiSettings. - * - * @param other - * @return boolean */ @Override public boolean equals(Object other) { diff --git a/src/main/java/seedu/address/commons/core/LogsCenter.java b/src/main/java/seedu/address/commons/core/LogsCenter.java index f3640d59ae4..75aebef9dba 100644 --- a/src/main/java/seedu/address/commons/core/LogsCenter.java +++ b/src/main/java/seedu/address/commons/core/LogsCenter.java @@ -71,7 +71,7 @@ private static void addConsoleHandler(Logger logger) { } /** - * Remove all the handlers from {@code logger}. + * Removes all the handlers from {@code logger}. */ private static void removeHandlers(Logger logger) { Arrays.stream(logger.getHandlers()) @@ -95,6 +95,7 @@ private static void addFileHandler(Logger logger) { /** * Creates a {@code FileHandler} for the log file. + * * @throws IOException if there are problems opening the file. */ private static FileHandler createFileHandler() throws IOException { diff --git a/src/main/java/seedu/address/commons/core/Version.java b/src/main/java/seedu/address/commons/core/Version.java index 595c2696d51..f8aa0981042 100644 --- a/src/main/java/seedu/address/commons/core/Version.java +++ b/src/main/java/seedu/address/commons/core/Version.java @@ -12,7 +12,7 @@ public class Version implements Comparable { /** - * Sets the VERSION_REGEX. + * Sets the version regex. */ public static final String VERSION_REGEX = "V(\\d+)\\.(\\d+)\\.(\\d+)(ea)?"; @@ -36,36 +36,36 @@ public Version(int major, int minor, int patch, boolean isEarlyAccess) { } /** - * Gets the major. + * Gets the major from {@code major}. * - * @return int + * @return int of the major */ public int getMajor() { return major; } /** - * Gets the minor. + * Gets the minor from {@code minor}. * - * @return int + * @return int of the minor. */ public int getMinor() { return minor; } /** - * Gets the patch. + * Gets the patch from {@code patch}. * - * @return int + * @return int of the patch */ public int getPatch() { return patch; } /** - * Judges the isEarlyAccess. + * Returns whether is early access. * - * @return int + * @return boolean ture is early access. */ public boolean isEarlyAccess() { return isEarlyAccess; @@ -103,9 +103,6 @@ public String toString() { /** * Overrides the compareTo method for Version class. - * - * @param other - * @return int */ @Override public int compareTo(Version other) { @@ -129,9 +126,6 @@ public int compareTo(Version other) { /** * Overrides the equal method for Version class. - * - * @param obj - * @return boolean */ @Override public boolean equals(Object obj) { @@ -148,8 +142,6 @@ public boolean equals(Object obj) { /** * Overrides the hashCode for Version class. - * - * @return int */ @Override public int hashCode() { diff --git a/src/main/java/seedu/address/commons/core/index/Index.java b/src/main/java/seedu/address/commons/core/index/Index.java index 48c3458bfe5..2696a20c775 100644 --- a/src/main/java/seedu/address/commons/core/index/Index.java +++ b/src/main/java/seedu/address/commons/core/index/Index.java @@ -64,9 +64,6 @@ public static Index fromOneBased(int oneBasedIndex) { /** * Overrides the equal method - * - * @param other - * @return Boolean */ @Override public boolean equals(Object other) { diff --git a/src/main/java/seedu/address/logic/commands/AddCommand.java b/src/main/java/seedu/address/logic/commands/AddCommand.java index 8dabbf2f2cf..9e3cab3ad0d 100644 --- a/src/main/java/seedu/address/logic/commands/AddCommand.java +++ b/src/main/java/seedu/address/logic/commands/AddCommand.java @@ -25,7 +25,7 @@ public abstract class AddCommand extends Command { + PREFIX_TRANSACTION + " (transaction details)"; /** - * Overrides the execute method for addCommand class to execute model. + * Executes method for addCommand class to execute model. * * @param model {@code Model} which the command should operate on. * @return CommandResult for execute addCommand diff --git a/src/main/java/seedu/address/logic/commands/AddMemberCommand.java b/src/main/java/seedu/address/logic/commands/AddMemberCommand.java index 8e3196246d8..b9a9534174f 100644 --- a/src/main/java/seedu/address/logic/commands/AddMemberCommand.java +++ b/src/main/java/seedu/address/logic/commands/AddMemberCommand.java @@ -43,7 +43,7 @@ public class AddMemberCommand extends AddCommand { private final Member toAdd; /** - * Creates an AddMemberCommand to add the specified {@code Member}. + * Constructs an {@codeAddMemberCommand} to add the specified {@code Member}. */ public AddMemberCommand(Member member) { requireNonNull(member); @@ -51,7 +51,7 @@ public AddMemberCommand(Member member) { } /** - * Overrides and executes model. + * Executes model. * * @param model {@code Model} which the command should operate on. * @return CommandResult with toAdd member @@ -71,9 +71,6 @@ public CommandResult execute(Model model) throws CommandException { /** * Overrides the equals method. - * - * @param other - * @return boolean */ @Override public boolean equals(Object other) { diff --git a/src/main/java/seedu/address/logic/commands/AddReservationCommand.java b/src/main/java/seedu/address/logic/commands/AddReservationCommand.java index 6597db45130..1700d33140f 100644 --- a/src/main/java/seedu/address/logic/commands/AddReservationCommand.java +++ b/src/main/java/seedu/address/logic/commands/AddReservationCommand.java @@ -58,7 +58,7 @@ public class AddReservationCommand extends AddCommand { private final Id idToAdd; /** - * Constructs an AddReservationCommand to add the specified {@code Member}. + * Constructs an {@code AddReservationCommand} to add the specified {@code Member}. */ public AddReservationCommand(Reservation reservation, Id id) { requireNonNull(id); @@ -67,7 +67,7 @@ public AddReservationCommand(Reservation reservation, Id id) { } /** - * Overrides and executes the model. + * Executes the model in AddReservationCommand. * * @param model {@code Model} which the command should operate on. * @return CommandResult with edited member @@ -92,8 +92,8 @@ public CommandResult execute(Model model) throws CommandException { /** * Creates and returns a {@code Member} with the details of {@code memberToEdit}. * - * @param memberToEdit - * @param reservation + * @param memberToEdit {@code memberToEdit} which the command should operate on. + * @param reservation {@code reservation} which the command should operate on. * @return member with updated reservations */ private static Member createUpdatedReservations(Member memberToEdit, Reservation reservation) { @@ -120,9 +120,6 @@ private static Member createUpdatedReservations(Member memberToEdit, Reservation /** * Overrides the equal method. - * - * @param other - * @return boolean */ @Override public boolean equals(Object other) { diff --git a/src/main/java/seedu/address/logic/commands/AddTransactionCommand.java b/src/main/java/seedu/address/logic/commands/AddTransactionCommand.java index a2876d3c260..f949268c01f 100644 --- a/src/main/java/seedu/address/logic/commands/AddTransactionCommand.java +++ b/src/main/java/seedu/address/logic/commands/AddTransactionCommand.java @@ -45,6 +45,9 @@ public class AddTransactionCommand extends AddCommand { + PREFIX_BILLING + " " + "23.00 " + PREFIX_ID + " " + "10001"; + /** + * Stands for the success message of new transaction added. + */ public static final String MESSAGE_SUCCESS = "New transaction added: %1$s"; private final Transaction transactionToAdd; @@ -60,10 +63,10 @@ public AddTransactionCommand(Transaction transaction, Id id) { } /** - * Overrides and executes the model. + * Executes the model in add transaction command. * * @param model {@code Model} which the command should operate on. - * @return CommandResult with edited member + * @return CommandResult with edited member. * @throws CommandException */ @Override @@ -85,9 +88,9 @@ public CommandResult execute(Model model) throws CommandException { /** * Creates and returns a {@code Member} with the details of {@code memberToEdit}. * - * @param memberToEdit - * @param transaction - * @return member with updated transactions and points + * @param memberToEdit {@code memberToEdit} which the command should operate on. + * @param transaction {@code transaction} which the command should operate on. + * @return member with updated transactions and points. */ private static Member createUpdatedCreditAndPointsMember(Member memberToEdit, Transaction transaction) { assert memberToEdit != null; @@ -114,9 +117,6 @@ private static Member createUpdatedCreditAndPointsMember(Member memberToEdit, Tr /** * Overrides the equal method. - * - * @param other - * @return boolean */ @Override public boolean equals(Object other) { diff --git a/src/main/java/seedu/address/logic/commands/ClearCommand.java b/src/main/java/seedu/address/logic/commands/ClearCommand.java index b9b77dbf8d4..bfbd2138059 100644 --- a/src/main/java/seedu/address/logic/commands/ClearCommand.java +++ b/src/main/java/seedu/address/logic/commands/ClearCommand.java @@ -22,10 +22,9 @@ public class ClearCommand extends Command { /** - * Overrides and Executes the model. + * Executes the model in the clear command. * - * @param model {@code Model} which the command should operate on - * @return CommandResult + * @param model {@code Model} which the command should operate on. */ @Override public CommandResult execute(Model model) { diff --git a/src/main/java/seedu/address/logic/commands/CommandResult.java b/src/main/java/seedu/address/logic/commands/CommandResult.java index 73d36ab17ed..923e8aaa9be 100644 --- a/src/main/java/seedu/address/logic/commands/CommandResult.java +++ b/src/main/java/seedu/address/logic/commands/CommandResult.java @@ -32,13 +32,9 @@ public class CommandResult { private final boolean exit; /** - * Constructs a {@code CommandResult} with the specified fields. - * - * @param feedbackToUser - * @param showHelp - * @param exit - * @param showMemberView - * @param showSummary + * Constructs a {@code CommandResult} with the specified fields from {@code feedbackToUser}, + * {@code showHelp}. {@code exit} {@code showMemberView} and + * {@codeshowSummary} */ public CommandResult(String feedbackToUser, boolean showHelp, boolean exit, boolean showMemberView, boolean showSummary) { @@ -52,17 +48,15 @@ public CommandResult(String feedbackToUser, boolean showHelp, boolean exit, bool /** * Constructs a {@code CommandResult} with the specified {@code feedbackToUser}, * and other fields set to their default value. - * - * @param feedbackToUser */ public CommandResult(String feedbackToUser) { this(feedbackToUser, false, false, false, false); } /** - * Gets feedback to user + * Gets feedback to user. * - * @return string for feedback to user + * @return string for feedback to user. */ public String getFeedbackToUser() { return feedbackToUser; @@ -71,7 +65,7 @@ public String getFeedbackToUser() { /** * Determines whether the app should show help window. * - * @return boolean + * @return boolean if true is showHelp command. */ public boolean isShowHelp() { return showHelp; @@ -80,7 +74,7 @@ public boolean isShowHelp() { /** * Determines whether the app should show member window. * - * @return boolean + * @return boolean if true is shown member view command. */ public boolean isShowMemberView() { return showMemberView; @@ -89,7 +83,7 @@ public boolean isShowMemberView() { /** * Determines whether the app should show summary window. * - * @return boolean + * @return boolean if true is shown summary command. */ public boolean isShowSummary() { return showSummary; @@ -98,7 +92,7 @@ public boolean isShowSummary() { /** * Determines whether the app should exit. * - * @return boolean + * @return boolean if ture is exit command */ public boolean isExit() { return exit; @@ -106,9 +100,6 @@ public boolean isExit() { /** * Overrides the equal method. - * - * @param other - * @return boolean */ @Override public boolean equals(Object other) { @@ -131,8 +122,6 @@ public boolean equals(Object other) { /** * Overrides the hashCode method. - * - * @return int for hashed value */ @Override public int hashCode() { diff --git a/src/main/java/seedu/address/logic/commands/DeleteCommand.java b/src/main/java/seedu/address/logic/commands/DeleteCommand.java index 3f3364e11a1..fffd69cfd2e 100644 --- a/src/main/java/seedu/address/logic/commands/DeleteCommand.java +++ b/src/main/java/seedu/address/logic/commands/DeleteCommand.java @@ -28,7 +28,7 @@ public abstract class DeleteCommand extends Command { * Overrides and executes model. * * @param model {@code Model} which the command should operate on. - * @return CommandResult + * @return CommandResult of related commands. * @throws CommandException */ @Override diff --git a/src/main/java/seedu/address/logic/commands/DeleteMemberCommand.java b/src/main/java/seedu/address/logic/commands/DeleteMemberCommand.java index 13762ffb86e..f0284de563c 100644 --- a/src/main/java/seedu/address/logic/commands/DeleteMemberCommand.java +++ b/src/main/java/seedu/address/logic/commands/DeleteMemberCommand.java @@ -46,9 +46,9 @@ public class DeleteMemberCommand extends DeleteCommand { private final Id id; /** - * Creates an DeleteCommand to delete the specified {@code Member} by index number. + * Creates an DeleteCommand to delete the specified {@code Member} by {@code index} number * - * @param index + * @param index the index shown in the page. */ public DeleteMemberCommand(Index index) { requireNonNull(index); @@ -59,7 +59,7 @@ public DeleteMemberCommand(Index index) { /** * Creates an DeleteCommand to delete the specified {@code Member} by member ID. * - * @param id + * @param id the member ID. */ public DeleteMemberCommand(Id id) { requireNonNull(id); @@ -68,10 +68,10 @@ public DeleteMemberCommand(Id id) { } /** - * Overrides and executes model. + * Executes the model. * * @param model {@code Model} which the command should operate on. - * @return CommandResult + * @return CommandResult related delete member command. * @throws CommandException */ @Override @@ -102,9 +102,6 @@ public CommandResult execute(Model model) throws CommandException { /** * Overrides equals method. - * - * @param other - * @return */ @Override public boolean equals(Object other) { diff --git a/src/main/java/seedu/address/logic/commands/DeleteReservationCommand.java b/src/main/java/seedu/address/logic/commands/DeleteReservationCommand.java index b9e20721fde..1fb30a78053 100644 --- a/src/main/java/seedu/address/logic/commands/DeleteReservationCommand.java +++ b/src/main/java/seedu/address/logic/commands/DeleteReservationCommand.java @@ -57,10 +57,11 @@ public class DeleteReservationCommand extends DeleteCommand { private final Id reservationId; /** - * Constructs DeleteReservationCommand to delete the specified {@code Member} by member ID and transaction ID. + * Constructs DeleteReservationCommand to delete the specified {@code Member} + * by {@code memberID} and {@code reservationId}. * - * @param memberId - * @param reservationId + * @param memberId the member Id + * @param reservationId the reservation id */ public DeleteReservationCommand(seedu.address.model.member.Id memberId, Id reservationId) { requireAllNonNull(memberId, reservationId); @@ -69,10 +70,10 @@ public DeleteReservationCommand(seedu.address.model.member.Id memberId, Id reser } /** - * Creates and returns a {@code Member} with the details of {@code memberToEdit}. + * Creates and returns a {@code Member} with the details of {@code memberToEdit} and {@code reservation}. * - * @param memberToEdit - * @param reservation + * @param memberToEdit the member to edit. + * @param reservation the reservation will to remove * @return Member with updated reservation */ private static Member createUpdatedReservation(Member memberToEdit, Reservation reservation) { @@ -98,10 +99,10 @@ private static Member createUpdatedReservation(Member memberToEdit, Reservation } /** - * Overrides and executes the model. + * Executes the model. * * @param model {@code Model} which the command should operate on. - * @return CommandResult + * @return CommandResult related delete reservation command. * @throws CommandException */ @Override @@ -128,9 +129,6 @@ public CommandResult execute(Model model) throws CommandException { /** * Overrides the equals method. - * - * @param other - * @return boolean */ @Override public boolean equals(Object other) { diff --git a/src/main/java/seedu/address/logic/commands/DeleteTransactionCommand.java b/src/main/java/seedu/address/logic/commands/DeleteTransactionCommand.java index 29a54cec980..148b26828bb 100644 --- a/src/main/java/seedu/address/logic/commands/DeleteTransactionCommand.java +++ b/src/main/java/seedu/address/logic/commands/DeleteTransactionCommand.java @@ -57,10 +57,7 @@ public class DeleteTransactionCommand extends DeleteCommand { private final seedu.address.model.transaction.Id transactionId; /** - * Constructs an DeleteCommand to delete the specified {@code Member} by member ID and transaction ID. - * - * @param memberId - * @param transactionId + * Constructs an DeleteCommand to delete the specified {@code Member} by {@code memberId} and {@code transactionId}. */ public DeleteTransactionCommand( seedu.address.model.member.Id memberId, seedu.address.model.transaction.Id transactionId) { @@ -72,8 +69,8 @@ public DeleteTransactionCommand( /** * Creates and returns a {@code Member} with the details of {@code memberToEdit}. * - * @param memberToEdit - * @param transaction + * @param memberToEdit create a new member to edit and update. + * @param transaction the transaction will be deleted. * @return Member with added transactions and updated credits */ private static Member createUpdatedCredits(Member memberToEdit, Transaction transaction) { @@ -102,10 +99,10 @@ private static Member createUpdatedCredits(Member memberToEdit, Transaction tran } /** - * Overrides and executes the model. + * Executes the model. * * @param model {@code Model} which the command should operate on. - * @return CommandResult + * @return CommandResult delete transaction command. * @throws CommandException */ @Override @@ -131,10 +128,7 @@ public CommandResult execute(Model model) throws CommandException { } /** - * Overrides the equals method - * - * @param other - * @return boolean + * Overrides the equals method. */ @Override public boolean equals(Object other) { diff --git a/src/main/java/seedu/address/logic/commands/EditCommand.java b/src/main/java/seedu/address/logic/commands/EditCommand.java index 4cf5e982de5..124c8c47449 100644 --- a/src/main/java/seedu/address/logic/commands/EditCommand.java +++ b/src/main/java/seedu/address/logic/commands/EditCommand.java @@ -28,7 +28,6 @@ public abstract class EditCommand extends Command { * Overrides the executes command. * * @param model {@code Model} which the command should operate on. - * @return * @throws CommandException */ @Override diff --git a/src/main/java/seedu/address/logic/commands/EditMemberCommand.java b/src/main/java/seedu/address/logic/commands/EditMemberCommand.java index c3e21ded799..36f6589aafc 100644 --- a/src/main/java/seedu/address/logic/commands/EditMemberCommand.java +++ b/src/main/java/seedu/address/logic/commands/EditMemberCommand.java @@ -95,8 +95,8 @@ public class EditMemberCommand extends EditCommand { /** * Constructs EditMemberCommand to edit member by index. * - * @param index of the member in the updated member list to edit - * @param editMemberDescriptor details to edit the member with + * @param index of the member in the updated member list to edit. + * @param editMemberDescriptor details to edit the member with. */ public EditMemberCommand(Index index, EditMemberDescriptor editMemberDescriptor) { requireNonNull(index); @@ -126,7 +126,7 @@ public EditMemberCommand(Id id, EditMemberDescriptor editMemberDescriptor) { * Overrides and executes model. * * @param model {@code Model} which the command should operate on. - * @return CommandResult + * @return CommandResult related edit member command. * @throws CommandException */ @Override @@ -162,9 +162,6 @@ public CommandResult execute(Model model) throws CommandException { /** * Creates and returns a {@code Member} with the details of {@code memberToEdit} * edited with {@code editMemberDescriptor}. - * - * @param memberToEdit - * @param editMemberDescriptor * @return Member with edited member */ private static Member createEditedMember(Member memberToEdit, EditMemberDescriptor editMemberDescriptor) { @@ -188,9 +185,6 @@ private static Member createEditedMember(Member memberToEdit, EditMemberDescript /** * Overrides the equals method. - * - * @param other - * @return boolean */ @Override public boolean equals(Object other) { @@ -235,8 +229,6 @@ public boolean isAnyFieldEdited() { /** * Sets name. - * - * @param name */ public void setName(Name name) { this.name = name; @@ -244,8 +236,6 @@ public void setName(Name name) { /** * Gets name. - * - * @return Optional */ public Optional getName() { return Optional.ofNullable(name); @@ -253,8 +243,6 @@ public Optional getName() { /** * Sets phone. - * - * @param phone */ public void setPhone(Phone phone) { this.phone = phone; @@ -262,8 +250,6 @@ public void setPhone(Phone phone) { /** * Gets phone. - * - * @return Optional */ public Optional getPhone() { return Optional.ofNullable(phone); @@ -271,8 +257,6 @@ public Optional getPhone() { /** * Sets email. - * - * @param email */ public void setEmail(Email email) { this.email = email; @@ -280,8 +264,6 @@ public void setEmail(Email email) { /** * Gets email. - * - * @return Optional */ public Optional getEmail() { return Optional.ofNullable(email); @@ -289,8 +271,6 @@ public Optional getEmail() { /** * Sets address. - * - * @param address */ public void setAddress(Address address) { this.address = address; @@ -298,8 +278,6 @@ public void setAddress(Address address) { /** * Gets address. - * - * @return Optional
*/ public Optional
getAddress() { return Optional.ofNullable(address); @@ -326,9 +304,6 @@ public Optional> getTags() { /** * Overrides the equal method. - * - * @param other - * @return boolean */ @Override public boolean equals(Object other) { diff --git a/src/main/java/seedu/address/logic/commands/EditReservationCommand.java b/src/main/java/seedu/address/logic/commands/EditReservationCommand.java index 542eafa2209..d235a831eb2 100644 --- a/src/main/java/seedu/address/logic/commands/EditReservationCommand.java +++ b/src/main/java/seedu/address/logic/commands/EditReservationCommand.java @@ -59,7 +59,7 @@ public class EditReservationCommand extends EditCommand { + PREFIX_REMARK + " 3 people"; /** - * Stands for succeed message of edit member + * Stands for succeed message of edit member. */ public static final String MESSAGE_SUCCESS = "Edited Member: %1$s"; @@ -89,11 +89,9 @@ public EditReservationCommand( } /** - * Creates and returns a {@code Member} with the details of {@code memberToEdit} + * Creates and returns a {@code Member} with the details of {@code memberToEdit}, + * {@code reservationToEdit}, {@code editReservationDescriptor} * - * @param memberToEdit - * @param reservationToEdit - * @param editReservationDescriptor * @return member with updated credits */ private static Member createUpdatedCredits( @@ -130,7 +128,7 @@ private static Member createUpdatedCredits( * Overrides and executes the model. * * @param model {@code Model} which the command should operate on. - * @return CommandResult + * @return CommandResult related to edit reservation command. * @throws CommandException */ @Override @@ -157,9 +155,6 @@ public CommandResult execute(Model model) throws CommandException { /** * Overrides the equal method. - * - * @param other - * @return boolean */ @Override public boolean equals(Object other) { @@ -196,7 +191,7 @@ public EditReservationDescriptor(EditReservationDescriptor toCopy) { /** * Returns true if at least one field is edited. * - * @return boolean + * @return boolean if true some filed is edited. */ public boolean isAnyFieldEdited() { return CollectionUtil.isAnyNonNull(dateTime, remark); @@ -205,7 +200,7 @@ public boolean isAnyFieldEdited() { /** * Sets DateTime. * - * @param dateTime + * @param dateTime the date time for editing. */ public void setDateTime(DateTime dateTime) { this.dateTime = dateTime; @@ -213,17 +208,13 @@ public void setDateTime(DateTime dateTime) { /** * Gets dateTime. - * - * @return dateTime */ public Optional getDateTime() { return Optional.ofNullable(dateTime); } /** - * Sets remark. - * - * @param remark + * Sets remark from {@code remark}. */ public void setRemark(Remark remark) { this.remark = remark; @@ -231,8 +222,6 @@ public void setRemark(Remark remark) { /** * Gets remark. - * - * @return Optional */ public Optional getRemark() { return Optional.ofNullable(remark); @@ -240,9 +229,6 @@ public Optional getRemark() { /** * Override the equal method. - * - * @param other - * @return boolean */ @Override public boolean equals(Object other) { diff --git a/src/main/java/seedu/address/logic/commands/EditTransactionCommand.java b/src/main/java/seedu/address/logic/commands/EditTransactionCommand.java index 12a9d687d48..60079486093 100644 --- a/src/main/java/seedu/address/logic/commands/EditTransactionCommand.java +++ b/src/main/java/seedu/address/logic/commands/EditTransactionCommand.java @@ -86,11 +86,9 @@ public EditTransactionCommand( } /** - * Creates and returns a {@code Member} with the details of {@code memberToEdit}. + * Creates and returns a {@code Member} with the details of {@code memberToEdit}, + * {@code transactionToEdit} and {@code editTransactionDescriptor}. * - * @param memberToEdit - * @param transactionToEdit - * @param editTransactionDescriptor * @return member with updated credits */ private static Member createUpdatedCredits( @@ -133,7 +131,7 @@ private static Member createUpdatedCredits( * Overrides and executes model * * @param model {@code Model} which the command should operate on. - * @return CommandResult + * @return CommandResult related to edir transaction command. * @throws CommandException */ @Override @@ -160,9 +158,6 @@ public CommandResult execute(Model model) throws CommandException { /** * Overrides the equals method. - * - * @param other - * @return boolean */ @Override public boolean equals(Object other) { @@ -201,36 +196,32 @@ public boolean isAnyFieldEdited() { } /** - * Sets time stamp. + * Sets time stamp from input {@code timestamp}. * - * @param timestamp + * @param timestamp transaction's timestamp. */ public void setTimestamp(Timestamp timestamp) { this.timestamp = timestamp; } /** - * Gets time stamp - * - * @return Optional + * Gets time stamp. */ public Optional getTimestamp() { return Optional.ofNullable(timestamp); } /** - * Sets Billing + * Sets Billing from {@code billing}. * - * @param billing + * @param billing transaction's billing. */ public void setBilling(Billing billing) { this.billing = billing; } /** - * Gets billing - * - * @return Optional + * Gets billing. */ public Optional getBilling() { return Optional.ofNullable(billing); @@ -238,9 +229,6 @@ public Optional getBilling() { /** * Overrides the equals method. - * - * @param other - * @return boolean */ @Override public boolean equals(Object other) { diff --git a/src/main/java/seedu/address/logic/commands/ExitCommand.java b/src/main/java/seedu/address/logic/commands/ExitCommand.java index 4f8c7653f14..9ff7e532242 100644 --- a/src/main/java/seedu/address/logic/commands/ExitCommand.java +++ b/src/main/java/seedu/address/logic/commands/ExitCommand.java @@ -21,7 +21,7 @@ public class ExitCommand extends Command { * Overrides and executes the model * * @param model {@code Model} which the command should operate on. - * @return CommandResult + * @return CommandResult related to edit command. */ @Override public CommandResult execute(Model model) { diff --git a/src/main/java/seedu/address/logic/commands/FindCommand.java b/src/main/java/seedu/address/logic/commands/FindCommand.java index bc9bab515d8..3da58f7cb8e 100644 --- a/src/main/java/seedu/address/logic/commands/FindCommand.java +++ b/src/main/java/seedu/address/logic/commands/FindCommand.java @@ -54,18 +54,16 @@ public class FindCommand extends Command { private final Predicate predicate; /** - * Constructs FindCommand through Id. - * - * @param predicate + * Constructs FindCommand through Id from input {@code predicate}. */ public FindCommand(IdContainsKeywordsPredicate predicate) { this.predicate = predicate; } /** - * Constructs FindCommand through Name. + * Constructs FindCommand through Name {@code predicate}. * - * @param predicate + * @param predicate the details of contain key words for name. */ public FindCommand(NameContainsKeywordsPredicate predicate) { this.predicate = predicate; @@ -74,35 +72,35 @@ public FindCommand(NameContainsKeywordsPredicate predicate) { /** * Constructs FindCommand through Phone. * - * @param predicate + * @param predicate the details of contain key words for phone. */ public FindCommand(PhoneContainsKeywordsPredicate predicate) { this.predicate = predicate; } /** - * Constructs FindCommand through Email. + * Constructs FindCommand through Email {@code predicate}. * - * @param predicate + * @param predicate the details of contain key words for email. */ public FindCommand(EmailContainsKeywordsPredicate predicate) { this.predicate = predicate; } /** - * Constructs FindCommand through RegistrationDate. + * Constructs FindCommand through RegistrationDate {@code predicate}. * - * @param predicate + * @param predicate the details of contain key words for registration date. */ public FindCommand(RegistrationDateContainsKeywordsPredicate predicate) { this.predicate = predicate; } /** - * Overrides and executes model. + * Executes the model. * * @param model {@code Model} which the command should operate on. - * @return CommandResult + * @return CommandResult related to find command. */ @Override public CommandResult execute(Model model) { @@ -114,9 +112,6 @@ public CommandResult execute(Model model) { /** * Overrides the equals method. - * - * @param other - * @return boolean */ @Override public boolean equals(Object other) { diff --git a/src/main/java/seedu/address/logic/commands/HelpCommand.java b/src/main/java/seedu/address/logic/commands/HelpCommand.java index b6b0d261df9..75fe5e43016 100644 --- a/src/main/java/seedu/address/logic/commands/HelpCommand.java +++ b/src/main/java/seedu/address/logic/commands/HelpCommand.java @@ -27,7 +27,7 @@ public class HelpCommand extends Command { * Overrides and executes the model. * * @param model {@code Model} which the command should operate on. - * @return CommandResult + * @return CommandResult related to help command. */ @Override public CommandResult execute(Model model) { diff --git a/src/main/java/seedu/address/logic/commands/ListCommand.java b/src/main/java/seedu/address/logic/commands/ListCommand.java index 7f9ddb640ec..6f2c7a9f70c 100644 --- a/src/main/java/seedu/address/logic/commands/ListCommand.java +++ b/src/main/java/seedu/address/logic/commands/ListCommand.java @@ -33,7 +33,7 @@ public class ListCommand extends Command { * Overrides and Executes the model. * * @param model {@code Model} which the command should operate on. - * @return CommandResult + * @return CommandResult related to list command. */ @Override public CommandResult execute(Model model) { @@ -44,9 +44,6 @@ public CommandResult execute(Model model) { /** * Overrides the equals method. - * - * @param other - * @return boolean */ @Override public boolean equals(Object other) { diff --git a/src/main/java/seedu/address/logic/commands/LoginCommand.java b/src/main/java/seedu/address/logic/commands/LoginCommand.java index 6199a7faef2..8788398521e 100644 --- a/src/main/java/seedu/address/logic/commands/LoginCommand.java +++ b/src/main/java/seedu/address/logic/commands/LoginCommand.java @@ -43,7 +43,7 @@ public class LoginCommand extends Command { /** * Constructs LoginCommand * - * @param password + * @param password the login password. */ public LoginCommand(Password password) { this.password = password; @@ -53,7 +53,7 @@ public LoginCommand(Password password) { * Overrides and executes the model * * @param model {@code Model} which the command should operate on. - * @return CommandResult + * @return CommandResult related to login command. */ @Override public CommandResult execute(Model model) { diff --git a/src/main/java/seedu/address/logic/commands/LogoutCommand.java b/src/main/java/seedu/address/logic/commands/LogoutCommand.java index 21e5e465e5a..8fb6c08f4a9 100644 --- a/src/main/java/seedu/address/logic/commands/LogoutCommand.java +++ b/src/main/java/seedu/address/logic/commands/LogoutCommand.java @@ -30,7 +30,7 @@ public class LogoutCommand extends Command { * Overrides and executes the model. * * @param model {@code Model} which the command should operate on. - * @return CommandResult + * @return CommandResult related to logout command. */ @Override public CommandResult execute(Model model) { diff --git a/src/main/java/seedu/address/logic/commands/RedeemCommand.java b/src/main/java/seedu/address/logic/commands/RedeemCommand.java index ffa6c945629..499fb5fb223 100644 --- a/src/main/java/seedu/address/logic/commands/RedeemCommand.java +++ b/src/main/java/seedu/address/logic/commands/RedeemCommand.java @@ -79,8 +79,8 @@ public class RedeemCommand extends Command { /** * Constructs an RedeemCommand to add the specified {@code Member} by id. * - * @param pointsToRedeemList - * @param id + * @param pointsToRedeemList the points of to redeemed list. + * @param id the member id that needs to redeem point. */ public RedeemCommand(List pointsToRedeemList, Id id) { requireAllNonNull(pointsToRedeemList, id); @@ -92,8 +92,8 @@ public RedeemCommand(List pointsToRedeemList, Id id) { /** * Constructs an RedeemCommand to add the specified {@code Member} by index. * - * @param pointsToRedeemList - * @param index + * @param pointsToRedeemList the points of to redeemed list. + * @param index the member index that needs to redeem point. */ public RedeemCommand(List pointsToRedeemList, Index index) { requireAllNonNull(pointsToRedeemList, index); @@ -106,7 +106,7 @@ public RedeemCommand(List pointsToRedeemList, Index index) { * Overrides and executes the model. * * @param model {@code Model} which the command should operate on. - * @return CommandResult + * @return CommandResult related to redeem command. * @throws CommandException */ @Override @@ -143,8 +143,8 @@ public CommandResult execute(Model model) throws CommandException { * Creates and returns a {@code Member} with the details of {@code memberToEdit} * edited with {@code editMemberDescriptor}. * - * @param memberToRedeemPoints - * @param toRedeemPointsList + * @param memberToRedeemPoints creates the member who need to be redeemed points. + * @param toRedeemPointsList the list of points need to redeem all. * @return Member with redeemed Points * @throws CommandException */ diff --git a/src/main/java/seedu/address/logic/commands/SortCommand.java b/src/main/java/seedu/address/logic/commands/SortCommand.java index d917e713bf4..5d27a8c6d16 100644 --- a/src/main/java/seedu/address/logic/commands/SortCommand.java +++ b/src/main/java/seedu/address/logic/commands/SortCommand.java @@ -48,9 +48,7 @@ public class SortCommand extends Command { private final CreditSortComparator comparator; /** - * Constructs SortCommand。 - * - * @param comparator + * Constructs SortCommand by {@code comparator}. */ public SortCommand(CreditSortComparator comparator) { this.comparator = comparator; @@ -60,7 +58,7 @@ public SortCommand(CreditSortComparator comparator) { * Overrides and executes the model. * * @param model {@code Model} which the command should operate on. - * @return CommandResult + * @return CommandResult related to sort command. */ @Override public CommandResult execute(Model model) { @@ -75,9 +73,6 @@ public CommandResult execute(Model model) { /** * Overrides the equals method. - * - * @param other - * @return */ @Override public boolean equals(Object other) { diff --git a/src/main/java/seedu/address/logic/commands/SummaryCommand.java b/src/main/java/seedu/address/logic/commands/SummaryCommand.java index 1a567f3a2a4..52744c0f481 100644 --- a/src/main/java/seedu/address/logic/commands/SummaryCommand.java +++ b/src/main/java/seedu/address/logic/commands/SummaryCommand.java @@ -32,7 +32,7 @@ public class SummaryCommand extends Command { * Overrides and executes model. * * @param model {@code Model} which the command should operate on. - * @return CommandResult + * @return CommandResult related to summary command. */ @Override public CommandResult execute(Model model) { @@ -43,9 +43,6 @@ public CommandResult execute(Model model) { /** * Overrides the equals method. - * - * @param other - * @return boolean */ @Override public boolean equals(Object other) { diff --git a/src/main/java/seedu/address/logic/commands/ViewCommand.java b/src/main/java/seedu/address/logic/commands/ViewCommand.java index 9ec7508d25b..20419b831e6 100644 --- a/src/main/java/seedu/address/logic/commands/ViewCommand.java +++ b/src/main/java/seedu/address/logic/commands/ViewCommand.java @@ -41,7 +41,7 @@ public class ViewCommand extends Command { /** * Construct the view command based on member id predicate. * - * @param predicate + * @param predicate the details keyword by id. */ public ViewCommand(IdContainsKeywordsPredicate predicate) { this.predicate = predicate; @@ -51,7 +51,7 @@ public ViewCommand(IdContainsKeywordsPredicate predicate) { * Overrides and executes the model. * * @param model {@code Model} which the command should operate on. - * @return CommandResult + * @return CommandResult related to View command. */ @Override public CommandResult execute(Model model) { @@ -62,9 +62,6 @@ public CommandResult execute(Model model) { /** * Override the equals method - * - * @param other - * @return boolean */ @Override public boolean equals(Object other) { diff --git a/src/main/java/seedu/address/logic/commands/exceptions/CommandException.java b/src/main/java/seedu/address/logic/commands/exceptions/CommandException.java index c99e6a64bf0..ca1decfb4d8 100644 --- a/src/main/java/seedu/address/logic/commands/exceptions/CommandException.java +++ b/src/main/java/seedu/address/logic/commands/exceptions/CommandException.java @@ -9,8 +9,6 @@ public class CommandException extends Exception { /** * Constructs a new {@code CommandException} with the specified detail {@code message}. - * - * @param message */ public CommandException(String message) { super(message); @@ -18,9 +16,6 @@ public CommandException(String message) { /** * Constructs a new {@code CommandException} with the specified detail {@code message} and {@code cause}. - * - * @param message - * @param cause */ public CommandException(String message, Throwable cause) { super(message, cause); From 6307c3179f122e5def8f6a4faebc7c0dff853bd2 Mon Sep 17 00:00:00 2001 From: Zhang Zhiyao Date: Thu, 4 Nov 2021 23:40:52 +0800 Subject: [PATCH 5/5] javadoc update --- .../java/seedu/address/model/EzFoodie.java | 2 +- .../seedu/address/model/account/Password.java | 3 -- .../member/IdContainsKeywordsPredicate.java | 4 +-- .../seedu/address/model/member/Member.java | 28 +++++++++---------- ...strationDateContainsKeywordsPredicate.java | 10 ++----- .../model/member/UniqueMemberList.java | 4 +-- 6 files changed, 19 insertions(+), 32 deletions(-) diff --git a/src/main/java/seedu/address/model/EzFoodie.java b/src/main/java/seedu/address/model/EzFoodie.java index 75ee5ca373a..3d727bba66d 100644 --- a/src/main/java/seedu/address/model/EzFoodie.java +++ b/src/main/java/seedu/address/model/EzFoodie.java @@ -121,7 +121,7 @@ public String toString() { /** * Overrides and gets member list. * - * @return ObservableList a series list data of members. + * @return ObservableList a series list data of members. */ @Override public ObservableList getMemberList() { diff --git a/src/main/java/seedu/address/model/account/Password.java b/src/main/java/seedu/address/model/account/Password.java index 828ec5d3d90..4b5c2001c46 100644 --- a/src/main/java/seedu/address/model/account/Password.java +++ b/src/main/java/seedu/address/model/account/Password.java @@ -41,9 +41,6 @@ public Password(String password) { value = password; } - /** - * Returns true if a given string is a valid password. - */ /** * Returns true if a given string is a valid password. * diff --git a/src/main/java/seedu/address/model/member/IdContainsKeywordsPredicate.java b/src/main/java/seedu/address/model/member/IdContainsKeywordsPredicate.java index ec0a8a418b6..43b407b04a2 100644 --- a/src/main/java/seedu/address/model/member/IdContainsKeywordsPredicate.java +++ b/src/main/java/seedu/address/model/member/IdContainsKeywordsPredicate.java @@ -12,9 +12,7 @@ public class IdContainsKeywordsPredicate implements Predicate { private final List keywords; /** - * Constructs a {@code IdContainsKeywordsPredicate} with input {List}. - * - * @param keywords + * Constructs a {@code IdContainsKeywordsPredicate} with input {@code List}. */ public IdContainsKeywordsPredicate(List keywords) { this.keywords = keywords; diff --git a/src/main/java/seedu/address/model/member/Member.java b/src/main/java/seedu/address/model/member/Member.java index 7c580d479a6..f5f5f093b5c 100644 --- a/src/main/java/seedu/address/model/member/Member.java +++ b/src/main/java/seedu/address/model/member/Member.java @@ -36,24 +36,22 @@ public class Member { private final List transactions = new ArrayList<>(); private final List reservations = new ArrayList<>(); - /** - * - */ + /** * Constructs {code Member} with follow param. * Every field must be present and not null. * - * @param id - * @param name - * @param phone - * @param email - * @param address - * @param timestamp - * @param credit - * @param point - * @param transactions - * @param reservations - * @param tags + * @param id the member id + * @param name the member name + * @param phone the member phone + * @param email the member email + * @param address the member address + * @param timestamp the member timestamp + * @param credit the member credits + * @param point the member point + * @param transactions the member transactions + * @param reservations the member reservations + * @param tags the member tag */ public Member(Id id, Name name, Phone phone, Email email, Address address, @@ -149,7 +147,7 @@ public Point getPoint() { * Returns an immutable tag set, which throws {@code UnsupportedOperationException} * if modification is attempted. * - * @return Set + * @return Set a series of tags */ public Set getTags() { return Collections.unmodifiableSet(tags); diff --git a/src/main/java/seedu/address/model/member/RegistrationDateContainsKeywordsPredicate.java b/src/main/java/seedu/address/model/member/RegistrationDateContainsKeywordsPredicate.java index a3763282037..ee1b5292bdf 100644 --- a/src/main/java/seedu/address/model/member/RegistrationDateContainsKeywordsPredicate.java +++ b/src/main/java/seedu/address/model/member/RegistrationDateContainsKeywordsPredicate.java @@ -20,7 +20,7 @@ public class RegistrationDateContainsKeywordsPredicate implements Predicate}. * - * @param keywords + * @param keywords a list of string keywords */ public RegistrationDateContainsKeywordsPredicate(List keywords) { this.keywords = keywords; @@ -28,9 +28,6 @@ public RegistrationDateContainsKeywordsPredicate(List keywords) { /** * Overrides test method. - * - * @param member - * @return boolean */ @Override public boolean test(Member member) { @@ -46,9 +43,7 @@ public boolean test(Member member) { } /** - * Overrides equals method. - * - * @return boolean + * Overrides the equals method. */ @Override public boolean equals(Object other) { @@ -56,5 +51,4 @@ public boolean equals(Object other) { || (other instanceof RegistrationDateContainsKeywordsPredicate // instanceof handles nulls && keywords.equals(((RegistrationDateContainsKeywordsPredicate) other).keywords)); // state check } - } diff --git a/src/main/java/seedu/address/model/member/UniqueMemberList.java b/src/main/java/seedu/address/model/member/UniqueMemberList.java index 8376c63bea3..d115f660b4d 100644 --- a/src/main/java/seedu/address/model/member/UniqueMemberList.java +++ b/src/main/java/seedu/address/model/member/UniqueMemberList.java @@ -129,9 +129,9 @@ public void setMembers(List members) { } /** - * Returns the backing list as an unmodifiable {@code ObservableList}. + * Returns the backing list as an unmodifiable {@code ObservableList}. * - * @return ObservableList + * @return ObservableList a series of oberservation list */ public ObservableList asUnmodifiableObservableList() { return internalUnmodifiableList;