Skip to content

Commit

Permalink
Fix Bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
pjanthony2001 committed Apr 4, 2024
1 parent fe64c88 commit 33411bc
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 13 deletions.
20 changes: 10 additions & 10 deletions src/main/java/seedu/address/logic/commands/FindCommand.java
Original file line number Diff line number Diff line change
Expand Up @@ -54,13 +54,15 @@ public FindCommand(NameContainsKeywordsPredicate namePredicate, PhoneContainsKey
AddressContainsKeywordsPredicate addressPredicate, EmailContainsKeywordsPredicate emailPredicate,
TagContainsKeywordsPredicate tagPredicate, KinContainsKeywordsPredicate kinPredicate,
DescriptionContainsKeywordsPredicate descriptionPredicate) {
assert namePredicate != null;
assert phonePredicate != null;
assert addressPredicate != null;
assert emailPredicate != null;
assert tagPredicate != null;
assert kinPredicate != null;
assert descriptionPredicate != null;
super.setReversible(true);
requireNonNull(namePredicate);
requireNonNull(namePredicate);
requireNonNull(phonePredicate);
requireNonNull(addressPredicate);
requireNonNull(emailPredicate);
requireNonNull(tagPredicate);
requireNonNull(kinPredicate);
requireNonNull(descriptionPredicate);
predicates = Arrays.asList(namePredicate, phonePredicate, addressPredicate,
emailPredicate, tagPredicate, kinPredicate, descriptionPredicate);
}
Expand All @@ -70,9 +72,7 @@ public CommandResult execute(Model model) {
requireNonNull(model);

Optional<Predicate<Person>> combinedPredicate = predicates.stream().reduce(Predicate::or);
if (combinedPredicate.isPresent()) {
model.updateFilteredPersonList(combinedPredicate.get());
}
combinedPredicate.ifPresent(model::updateFilteredPersonList);
return new CommandResult(
String.format(Messages.MESSAGE_PERSONS_LISTED_OVERVIEW, model.getFilteredPersonList().size()));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,6 @@ public String toString() {
*/
@Override
public String getCommandString() {
return COMMAND_WORD;
return "schedule " + COMMAND_WORD;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public class ScheduleDeleteCommand extends ScheduleCommand {
public static final String MESSAGE_USAGE = COMMAND_WORD
+ ": Deletes the event identified by its heading from the schedule.\n"
+ "Parameters: h/HEADING\n"
+ "Example: schedule " + COMMAND_WORD + " " + PREFIX_HEADING + " Meeting with Client";
+ "Example: schedule " + COMMAND_WORD + " " + PREFIX_HEADING + "Meeting with Client";
public static final String MESSAGE_DELETE_EVENT_SUCCESS = "Deleted Event: %1$s";

private final Heading heading;
Expand Down Expand Up @@ -98,6 +98,6 @@ public String toString() {
*/
@Override
public String getCommandString() {
return COMMAND_WORD;
return "schedule " + COMMAND_WORD;
}
}

0 comments on commit 33411bc

Please sign in to comment.