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

[W5][T12-4]Lau Wei Tang #169

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

[W5][T12-4]Lau Wei Tang #169

wants to merge 2 commits into from

Conversation

WeiTangLau
Copy link

@WeiTangLau WeiTangLau commented Feb 13, 2019

Modified Address class to include attributes of Block, Unit, Street and PostalCode classes
Updated Tests cases for JUnit tests and IO tests
Updated User Guide to reflect the changes
Modified the AddCommand.java file to enforce the new input method of Person Address

…classes. Updated the input.txt and expected.txt files to match the changes to the code. Also updated the JUnit tests to ensure that the tests reflect the correctness of the changes. Added new rule in AddCommand.java to include that the Person Address must be of this format: block, unit, street, postalcode. Updated the UserGuide to reflect the changes.
@nus-se-pr-bot
Copy link

Hi @WeiTangLau, your pull request title is invalid.

For PR sent as submission of learning a topic/graded exercise, the PR name should be in the format of [Week ID][Team ID] Your Name, where [Week ID] has no dashes or spaces (e.g. [W5]) and [Team ID] has one dash only and no spaces (e.g. [W14-2] means Wednesday 2pm (14 hrs), Team 2).
E.g. If you are in tutorial W09 (i.e. Wednesday 9am), team 1, the PR title would be [W5][W09-1] James Yong. Note that your tutorial IDs are different from those shown in CORS/IVLE.

For team PR, the PR name should be in the format of [Team ID] Product Name (e.g. [T09-2] Contact List Pro).

Please follow the above format strictly and edit your title for reprocessing.

Note: this comment is posted by a bot. If you believe this is done in error, please create an issue at nus-se-pr-bot and add a link to this PR.

@WeiTangLau WeiTangLau changed the title [W5][12-4]Lau Wei Tang [W5][T12-4]Lau Wei Tang Feb 13, 2019
@lormee94
Copy link

Nice way of changing it up, seems simple but you had to make changes for the storage and most of the testing. Definitely an enhancement to the addressbook
#LATB

@jetkan-yk
Copy link

Nice clean & neat PR! I also like the way you listed the modifications in the PR message.

However, I think some of the commit messages can be delivered in a more concise manner:
Try to keep the title commit messages in <50 chars, written in present tense (e.g. "Modify...", "Update...") and split the long description into paragraphs/point forms.

Links for more about writing a good commit message:
https://chris.beams.io/posts/git-commit/
https://code.likeagirl.io/useful-tips-for-writing-better-git-commit-messages-808770609503

Overall, greatest of job!

#LATB

Copy link

@nhs-work nhs-work left a comment

Choose a reason for hiding this comment

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

Great job on your first PR! Please close the PR after you have read my comments.

public final String value;

private boolean isPrivate;

Choose a reason for hiding this comment

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

Use blank lines sparingly. It's good to have blank lines to separate logical code blocks, but too many blank lines will increase the height of the code, which increases the amount of scrolling.

private String postalCodeNumber;

public PostalCode(String postalCodeNumber) {
this.postalCodeNumber = postalCodeNumber;

Choose a reason for hiding this comment

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

A possible improvement is to utilize regex so that the postal code must be of the form "Sxxxxxx", where x must be a digit from 0 to 9.

}

@Override
public boolean equals(Object other) {
return other == this // short circuit if same object
|| (other instanceof Address // instanceof handles nulls
&& this.value.equals(((Address) other).value)); // state check
&& this.value.equals(((Address) other).value));

Choose a reason for hiding this comment

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

Good catch! However, the indentation for wrapped lines should be 8 spaces.

*
* @param trimmedAddress the String to be operated on
*/
public Block assignBlock(String trimmedAddress) {

Choose a reason for hiding this comment

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

Consider using a different name for this method, as the block is not in fact assigned, but rather extracted out from the trimmed address.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants