Skip to content

[W5.11][F09-2]Pham Quang Minh#178

Open
px1099 wants to merge 7 commits into
nusCS2113-AY1819S1:masterfrom
px1099:master
Open

[W5.11][F09-2]Pham Quang Minh#178
px1099 wants to merge 7 commits into
nusCS2113-AY1819S1:masterfrom
px1099:master

Conversation

@px1099

@px1099 px1099 commented Sep 13, 2018

Copy link
Copy Markdown
  • CommandResult.java: encapsulate member "feedbackToUser"
  • Make "find" command case-insensitive (updated User Guide & Expected Test Results)

CommandResult.java: encapsulate "feedbackToUser"
…arg in "prepareFind" in Parser.java => adding lowercase keywords in "FindCommand" in FindCommand.java

FindCommandTest.java: change to include correct test result for case insensitive
@kianhong95

Copy link
Copy Markdown

Nice feature to have as it enhances the user friendliness of the address book.

@stephlewyh stephlewyh left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Hi Minh, good effort with updating the doc and test cases. Remember if you decide on a private attribute in a public class, you may need to consider if this attribute should be made accessible through getter or setter methods.


/** The feedback message to be shown to the user. Contains a description of the execution result */
public String getFeedbackToUser() {
return feedbackToUser;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

If you assign feedbackToUser as private class attribute, then you will need to have a separate getter function to get the value of feedbackToUser. e.g.
string feedback = getFeedBackToUser();
return feedback;

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Can you phrase the problem in another way?
I think I did create a public getter, but I did choose not to create a setter as I found no other usage of feedbackToUser other than getting it in some Command functions.
Should I always create a pair of setter and getter when encapsulating data?

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.

4 participants