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][F09-B1] Ellery Chia #970

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 45 additions & 0 deletions src/seedu/addressbook/data/tag/Tagging.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
package seedu.addressbook.data.tag;

import seedu.addressbook.data.person.Person;

/**
* Represents a Tagging in the address book.
* Each tagging is an addition or removal of a Person's tag.
*/
public class Tagging {

private static final String ADDED_SYMBOL = "+";
private static final String REMOVED_SYMBOL = "-";

public enum Status {
ADD, REMOVE
}

private Person person;
private Tag tag;
private Status status;

/**
* Creates a tagging based on the tag being added/removed from a Person
*
*/
public Tagging(Person person, Tag tag, Status status) {
this.person = person;
this.tag = tag;
this.status = status;
}

@Override
public String toString() {
String change = "";
switch (status) {
case ADD:
change = ADDED_SYMBOL;
break;
case REMOVE:
change = REMOVED_SYMBOL;
}
return change + " " + person.getName() + " " + tag.toString();
}

}