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

[W8.6b][W09-B3] Yap Ni #949

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

yellownorthisland
Copy link

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.

Copy link

@goweiwen goweiwen left a 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());

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 = "-";

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).

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