-
Notifications
You must be signed in to change notification settings - Fork 153
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
[W8.6b][W09-B3] Yap Ni #949
base: master
Are you sure you want to change the base?
[W8.6b][W09-B3] Yap Ni #949
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good job 👍! I have left some comments. Please close this PR after reading them.
|| obj instanceof Tagging // instanceof handles null | ||
&& ((Tagging) obj).getPerson().equals(this.person) | ||
&& ((Tagging) obj).getTag().equals(this.tag) | ||
&& ((Tagging) obj).getChange().equals(this.getChange()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of using this.getChange()
, we can use this.change
as well.
public class Tagging { | ||
|
||
public static final String SYMBOL_ADD = "+"; | ||
public static final String SYMBOL_REMOVE = "-"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you are already using enums for Change
, you can also use a Map<Enum, String>
to convert from enums to your symbol. This way, the toString
method will not need to care if enums are added or removed (e.g. new enum for renaming tags).
Add Tagging association class. Each Tagging object will represent an adding or deleting of a tag for a specific person that happened during that session.