Skip to content

Commit

Permalink
Update Javadocs
Browse files Browse the repository at this point in the history
  • Loading branch information
qinxutan committed Mar 19, 2024
1 parent 1788d75 commit 49e64fd
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 8 deletions.
10 changes: 7 additions & 3 deletions src/main/java/seedu/address/logic/commands/AddClassCommand.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@ public class AddClassCommand extends Command {
private final TutorialClass tutorialString;

/**
* @param module of the tutorial class to be added
* Constructs an AddClassCommand to add the specified {@code TutorialClass} to the specified {@code ModuleCode}.
* @param module The module code of the tutorial class to be added.
* @param tutorialClass The tutorial class to be added.
*/
public AddClassCommand(ModuleCode module, TutorialClass tutorialClass) {
requireAllNonNull(module);
Expand Down Expand Up @@ -56,8 +58,10 @@ public CommandResult execute(Model model) throws CommandException {
}

/**
* Generates a command execution success message based on whether the remark is added to or removed from
* {@code personToEdit}.
* Generates a command execution success message based on whether the tutorial class is added successfully.
* @param module The module code of the tutorial class.
* @param tutorialString The tutorial class.
* @return The success message.
*/
private String generateSuccessMessage(ModuleCode module, TutorialClass tutorialString) {
return String.format(MESSAGE_ADD_CLASS_SUCCESS, module.toString(), tutorialString.toString());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,9 @@ public class DeleteClassCommand extends Command {
private final TutorialClass tutorialString;

/**
* @param module of the tutorial class to be added
* Constructs a DeleteClassCommand to delete the specified {@code TutorialClass} from the specified {@code ModuleCode}.
* @param module The module code of the tutorial class to be deleted.
* @param tutorialClass The tutorial class to be deleted.
*/
public DeleteClassCommand(ModuleCode module, TutorialClass tutorialClass) {
requireAllNonNull(module);
Expand Down Expand Up @@ -60,8 +62,10 @@ public CommandResult execute(Model model) throws CommandException {
}

/**
* Generates a command execution success message based on whether the removed from
* {@code personToEdit}.
* Generates a command execution success message based on whether the tutorial class is successfully deleted.
* @param module The module code of the tutorial class.
* @param tutorialString The tutorial class.
* @return The success message.
*/
private String generateSuccessMessage(ModuleCode module, TutorialClass tutorialString) {
return String.format(MESSAGE_DELETE_CLASS_SUCCESS, module.toString(), tutorialString.toString());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,9 @@ public AddClassCommand parse(String args) throws ParseException {
}
return new AddClassCommand(new ModuleCode(moduleCode), new TutorialClass(tutorialClass));
}

/**
* Returns true if all the prefixes are present in the given {@code ArgumentMultimap}.
*/
private static boolean arePrefixesPresent(ArgumentMultimap argumentMultimap, Prefix... prefixes) {
return Stream.of(prefixes).allMatch(prefix -> argumentMultimap.getValue(prefix).isPresent());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,9 @@ public DeleteClassCommand parse(String args) throws ParseException {
}
return new DeleteClassCommand(new ModuleCode(moduleCode), new TutorialClass(tutorialClass));
}

/**
* Returns true if all the prefixes are present in the given {@code ArgumentMultimap}.
*/
private static boolean arePrefixesPresent(ArgumentMultimap argumentMultimap, Prefix... prefixes) {
return Stream.of(prefixes).allMatch(prefix -> argumentMultimap.getValue(prefix).isPresent());
}
Expand Down

0 comments on commit 49e64fd

Please sign in to comment.