forked from AY2425S1-CS2103T-T12-4/tp
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request AY2425S1-CS2103T-T12-4#118
Add PreferredTime to Person and Update Storage
- Loading branch information
Showing
14 changed files
with
253 additions
and
52 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 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 |
---|---|---|
|
@@ -17,6 +17,7 @@ | |
import seedu.address.model.person.Name; | ||
import seedu.address.model.person.Person; | ||
import seedu.address.model.person.Phone; | ||
import seedu.address.model.preferredtime.PreferredTime; | ||
import seedu.address.model.tag.Tag; | ||
|
||
|
||
|
@@ -32,23 +33,28 @@ public static Person[] getSamplePersons() { | |
return new Person[] { | ||
new Person(new Name("Alex Yeoh"), new Phone("87438807"), new Email("[email protected]"), | ||
new Address("Blk 30 Geylang Street 29, #06-40"), | ||
getTagSet("friends"), | ||
sample), | ||
getTagSet("friends"), sample, | ||
getPreferredTimeSet("Monday 2100")), | ||
new Person(new Name("Bernice Yu"), new Phone("99272758"), new Email("[email protected]"), | ||
new Address("Blk 30 Lorong 3 Serangoon Gardens, #07-18"), | ||
getTagSet("colleagues", "friends"), getGameMap("LoL")), | ||
getTagSet("colleagues", "friends"), getGameMap("LoL"), | ||
getPreferredTimeSet("Monday 2030")), | ||
new Person(new Name("Charlotte Oliveiro"), new Phone("93210283"), new Email("[email protected]"), | ||
new Address("Blk 11 Ang Mo Kio Street 74, #11-04"), | ||
getTagSet("neighbours"), getGameMap("LoL")), | ||
getTagSet("neighbours"), getGameMap("LoL"), | ||
getPreferredTimeSet("Saturday 1900")), | ||
new Person(new Name("David Li"), new Phone("91031282"), new Email("[email protected]"), | ||
new Address("Blk 436 Serangoon Gardens Street 26, #16-43"), | ||
getTagSet("family"), getGameMap("LoL")), | ||
getTagSet("family"), getGameMap("LoL"), | ||
getPreferredTimeSet("Tuesday 2100", "Thursday 1900")), | ||
new Person(new Name("Irfan Ibrahim"), new Phone("92492021"), new Email("[email protected]"), | ||
new Address("Blk 47 Tampines Street 20, #17-35"), | ||
getTagSet("classmates"), getGameMap("LoL")), | ||
getTagSet("classmates"), getGameMap("LoL"), | ||
getPreferredTimeSet("Sunday 1800")), | ||
new Person(new Name("Roy Balakrishnan"), new Phone("92624417"), new Email("[email protected]"), | ||
new Address("Blk 45 Aljunied Street 85, #11-31"), | ||
getTagSet("colleagues"), getGameMap("LoL")) | ||
getTagSet("colleagues"), getGameMap("LoL"), | ||
getPreferredTimeSet("Friday 2100")) | ||
}; | ||
} | ||
|
||
|
@@ -80,4 +86,13 @@ public static Map<String, Game> getGameMap(String... strings) { | |
return gameMap; | ||
} | ||
|
||
/** | ||
* Returns a preferredTime set containing the list of strings given. | ||
*/ | ||
public static Set<PreferredTime> getPreferredTimeSet(String... strings) { | ||
return Arrays.stream(strings) | ||
.map(PreferredTime::new) | ||
.collect(Collectors.toSet()); | ||
} | ||
|
||
} |
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
Oops, something went wrong.