Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update logic in Logic in DG #424

Conversation

delishad21
Copy link

No description provided.

@delishad21 delishad21 added this to the v1.4 milestone Apr 13, 2024
@delishad21 delishad21 self-assigned this Apr 13, 2024
Copy link

@jayllo-c jayllo-c left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes look relevant

* Validation of each extracted argument is done using the methods defined in the `ParserUtil` class. This class contains methods to validate different arguments extracted by the `ArgumentMultimap` class based on the `VALIDATION_REGEX` defined in component classes (`Name.java`, `Score.java`, etc.).
* The parsed arguments are then used to create a `XYZCommand` object to be executed.

**Note:** Some commands do not require any arguments (e.g., `help`, `clear`, `list`, `exit`). In such cases, the `XYZCommand` class is directly instantiated by the `AddressBookParser` class without the parsing of arguments. As such, any arguments passed to these commands are ignored.
<box type="info" seamless>

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good use of formatting


**Mandatory Arguments and Multiple Arguments**

* For some commands, some arguments are mandatory and the `arePrefixesPresent` method is used to check if the arguments (i.e the corresponding prefixes) are present in the user input. If not, an exception is thrown.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good elaboration!

@jayllo-c jayllo-c merged commit 1ce37fc into AY2324S2-CS2103T-T10-1:master Apr 13, 2024
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants