From eb7994e68871bb1dea39f76fb09e31e1b5037bf3 Mon Sep 17 00:00:00 2001 From: ryanlimdx Date: Wed, 27 Mar 2024 19:37:01 +0800 Subject: [PATCH] Fix more checkstyle errors --- .../seedu/address/logic/parser/ListCommandParser.java | 6 +++--- .../java/seedu/address/logic/parser/ParserUtil.java | 6 +++++- .../address/model/person/ListKeywordsPredicate.java | 11 ++++++++++- 3 files changed, 18 insertions(+), 5 deletions(-) diff --git a/src/main/java/seedu/address/logic/parser/ListCommandParser.java b/src/main/java/seedu/address/logic/parser/ListCommandParser.java index 9c98009e0dd..de7642e560e 100644 --- a/src/main/java/seedu/address/logic/parser/ListCommandParser.java +++ b/src/main/java/seedu/address/logic/parser/ListCommandParser.java @@ -1,11 +1,11 @@ package seedu.address.logic.parser; -import java.util.List; - import static seedu.address.logic.Messages.MESSAGE_INVALID_COMMAND_FORMAT; import static seedu.address.logic.parser.CliSyntax.PREFIX_TAG; import static seedu.address.logic.parser.CliSyntax.PREFIX_WARD; +import java.util.List; + import seedu.address.logic.commands.ListCommand; import seedu.address.logic.parser.exceptions.ParseException; import seedu.address.model.person.ListKeywordsPredicate; @@ -23,7 +23,7 @@ public class ListCommandParser implements Parser { public ListCommand parse(String args) throws ParseException { String trimmedArgs = args.trim(); if (trimmedArgs.isEmpty()) { - return new ListCommand(); // return a ListCommand object with no predicate + return new ListCommand(); // return a ListCommand object with no predicate } ArgumentMultimap argMultimap = diff --git a/src/main/java/seedu/address/logic/parser/ParserUtil.java b/src/main/java/seedu/address/logic/parser/ParserUtil.java index 4c00572c74e..7330ce195d9 100644 --- a/src/main/java/seedu/address/logic/parser/ParserUtil.java +++ b/src/main/java/seedu/address/logic/parser/ParserUtil.java @@ -2,7 +2,11 @@ import static java.util.Objects.requireNonNull; -import java.util.*; +import java.util.ArrayList; +import java.util.Collection; +import java.util.HashSet; +import java.util.List; +import java.util.Set; import seedu.address.commons.core.index.Index; import seedu.address.commons.util.StringUtil; diff --git a/src/main/java/seedu/address/model/person/ListKeywordsPredicate.java b/src/main/java/seedu/address/model/person/ListKeywordsPredicate.java index 9228563d624..6942563edea 100644 --- a/src/main/java/seedu/address/model/person/ListKeywordsPredicate.java +++ b/src/main/java/seedu/address/model/person/ListKeywordsPredicate.java @@ -1,7 +1,7 @@ package seedu.address.model.person; -import java.util.function.Predicate; import java.util.List; +import java.util.function.Predicate; import seedu.address.commons.util.StringUtil; import seedu.address.commons.util.ToStringBuilder; @@ -13,6 +13,11 @@ public class ListKeywordsPredicate implements Predicate { private final List tagKeywords; private final String wardKeyword; + /** + * Constructs a ListKeywordsPredicate object. + * @param tagKeywords List of tag keywords to filter the list of persons. + * @param wardKeyword Ward keyword to filter the list of persons. + */ public ListKeywordsPredicate(List tagKeywords, String wardKeyword) { this.tagKeywords = tagKeywords; this.wardKeyword = wardKeyword; @@ -62,6 +67,10 @@ public String toString() { .toString(); } + /** + * Returns a string representation of the keywords. + * @return String representation of the keywords. + */ public String getKeywordsString() { String tags = "\ntags: " + tagKeywords.toString() .replace("[", "")