forked from se-edu/addressbook-level25
-
Notifications
You must be signed in to change notification settings - Fork 73
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Many methods in UniqueTagList, such as mergeFrom(UniqueTagList), were previously used by only the AddressBook for the master tag list. Since AddressBook does not use a master tag list anymore, all these methods are no longer necessary. UniqueTagList now only serves to add complexity to the code base. Let's remove the UniqueTagList class, and update Person to use a Set instead for holding its tags instead, since it can only contain unique elements.
- Loading branch information
Showing
8 changed files
with
32 additions
and
196 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,10 @@ | |
|
||
import static org.junit.Assert.assertEquals; | ||
import java.nio.file.Paths; | ||
import java.util.Arrays; | ||
import java.util.Collections; | ||
import java.util.HashSet; | ||
|
||
import org.junit.Rule; | ||
import org.junit.Test; | ||
import org.junit.rules.ExpectedException; | ||
|
@@ -16,7 +19,6 @@ | |
import seedu.addressbook.data.person.Person; | ||
import seedu.addressbook.data.person.Phone; | ||
import seedu.addressbook.data.tag.Tag; | ||
import seedu.addressbook.data.tag.UniqueTagList; | ||
import seedu.addressbook.storage.StorageFile.StorageOperationException; | ||
import static seedu.addressbook.util.TestUtil.assertTextFilesEqual; | ||
|
||
|
@@ -98,12 +100,12 @@ private AddressBook getTestAddressBook() throws Exception { | |
new Phone("98765432", false), | ||
new Email("[email protected]", false), | ||
new Address("John street, block 123, #01-01", false), | ||
new UniqueTagList(Collections.emptySet()))); | ||
Collections.emptySet())); | ||
ab.addPerson(new Person(new Name("Betsy Crowe"), | ||
new Phone("1234567", true), | ||
new Email("[email protected]", false), | ||
new Address("Newgate Prison", true), | ||
new UniqueTagList(new Tag("friend"), new Tag("criminal")))); | ||
new HashSet<>(Arrays.asList(new Tag("friend"), new Tag("criminal"))))); | ||
return ab; | ||
} | ||
} |