Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Implemented a unique tag set. Now, whenever clients are added, edited, or loaded, their set of tags will contain unique, global objects that are contained inside the UniqueTagSet, instead of every client having their own local Tag objects.
Testing
The junit tests I wrote covers all methods I added.
The application runs fine, and I used the following commands to ensure no regressions happened:
client edit 1 t/friends t/colleagues
client edit 1 t/friends
client add n/Tom p/999 e/a@a.com a/Somewhere c/US tz/GMT+6 t/rivals t/bestfriends
client delete 9
Remarks
Right now, it is not possible to delete tags from the unique tag set when clients are deleted without major refactoring and design changes. I would suggest leaving this part for Ritesh to consider when he transfers this to Notes, since that will most likely require major changes as well. However, this is not a huge problem, as the unique tag set will reload from the current tags in storage when the application restarts.