forked from nus-cs2103-AY2425S1/tp
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9b4f39e
commit 00fe168
Showing
11 changed files
with
95 additions
and
19 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,31 +11,35 @@ | |
import seedu.address.model.person.Name; | ||
import seedu.address.model.person.Person; | ||
import seedu.address.model.person.Phone; | ||
import seedu.address.model.person.Remark; | ||
import seedu.address.model.tag.Tag; | ||
|
||
/** | ||
* Contains utility methods for populating {@code AddressBook} with sample data. | ||
*/ | ||
public class SampleDataUtil { | ||
|
||
public static final Remark EMPTY_REMARK = new Remark(""); | ||
|
||
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"), | ||
new Address("Blk 30 Geylang Street 29, #06-40"), EMPTY_REMARK, | ||
getTagSet("friends")), | ||
new Person(new Name("Bernice Yu"), new Phone("99272758"), new Email("[email protected]"), | ||
new Address("Blk 30 Lorong 3 Serangoon Gardens, #07-18"), | ||
new Address("Blk 30 Lorong 3 Serangoon Gardens, #07-18"), EMPTY_REMARK, | ||
getTagSet("colleagues", "friends")), | ||
new Person(new Name("Charlotte Oliveiro"), new Phone("93210283"), new Email("[email protected]"), | ||
new Address("Blk 11 Ang Mo Kio Street 74, #11-04"), | ||
new Address("Blk 11 Ang Mo Kio Street 74, #11-04"), EMPTY_REMARK, | ||
getTagSet("neighbours")), | ||
new Person(new Name("David Li"), new Phone("91031282"), new Email("[email protected]"), | ||
new Address("Blk 436 Serangoon Gardens Street 26, #16-43"), | ||
new Address("Blk 436 Serangoon Gardens Street 26, #16-43"), EMPTY_REMARK, | ||
getTagSet("family")), | ||
new Person(new Name("Irfan Ibrahim"), new Phone("92492021"), new Email("[email protected]"), | ||
new Address("Blk 47 Tampines Street 20, #17-35"), | ||
new Address("Blk 47 Tampines Street 20, #17-35"), EMPTY_REMARK, | ||
getTagSet("classmates")), | ||
new Person(new Name("Roy Balakrishnan"), new Phone("92624417"), new Email("[email protected]"), | ||
new Address("Blk 45 Aljunied Street 85, #11-31"), | ||
new Address("Blk 45 Aljunied Street 85, #11-31"), EMPTY_REMARK, | ||
getTagSet("colleagues")) | ||
}; | ||
} | ||
|
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 |
---|---|---|
|
@@ -4,11 +4,13 @@ | |
"phone": "94351253", | ||
"email": "[email protected]", | ||
"address": "123, Jurong West Ave 6, #08-111", | ||
"remark": "", | ||
"tags": [ "friends" ] | ||
}, { | ||
"name": "Alice Pauline", | ||
"phone": "94351253", | ||
"email": "[email protected]", | ||
"address": "4th street" | ||
"address": "4th street", | ||
"remark": "" | ||
} ] | ||
} |
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 |
---|---|---|
|
@@ -5,42 +5,49 @@ | |
"phone" : "94351253", | ||
"email" : "[email protected]", | ||
"address" : "123, Jurong West Ave 6, #08-111", | ||
"remark" : "", | ||
"tags" : [ "friends" ] | ||
}, { | ||
"name" : "Benson Meier", | ||
"phone" : "98765432", | ||
"email" : "[email protected]", | ||
"address" : "311, Clementi Ave 2, #02-25", | ||
"remark" : "", | ||
"tags" : [ "owesMoney", "friends" ] | ||
}, { | ||
"name" : "Carl Kurz", | ||
"phone" : "95352563", | ||
"email" : "[email protected]", | ||
"address" : "wall street", | ||
"remark" : "", | ||
"tags" : [ ] | ||
}, { | ||
"name" : "Daniel Meier", | ||
"phone" : "87652533", | ||
"email" : "[email protected]", | ||
"address" : "10th street", | ||
"remark" : "", | ||
"tags" : [ "friends" ] | ||
}, { | ||
"name" : "Elle Meyer", | ||
"phone" : "9482224", | ||
"email" : "[email protected]", | ||
"address" : "michegan ave", | ||
"remark" : "", | ||
"tags" : [ ] | ||
}, { | ||
"name" : "Fiona Kunz", | ||
"phone" : "9482427", | ||
"email" : "[email protected]", | ||
"address" : "little tokyo", | ||
"remark" : "", | ||
"tags" : [ ] | ||
}, { | ||
"name" : "George Best", | ||
"phone" : "9482442", | ||
"email" : "[email protected]", | ||
"address" : "4th street", | ||
"remark" : "", | ||
"tags" : [ ] | ||
} ] | ||
} |
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 |
---|---|---|
|
@@ -8,6 +8,7 @@ | |
import seedu.address.model.person.Name; | ||
import seedu.address.model.person.Person; | ||
import seedu.address.model.person.Phone; | ||
import seedu.address.model.person.Remark; | ||
import seedu.address.model.tag.Tag; | ||
import seedu.address.model.util.SampleDataUtil; | ||
|
||
|
@@ -20,11 +21,13 @@ public class PersonBuilder { | |
public static final String DEFAULT_PHONE = "85355255"; | ||
public static final String DEFAULT_EMAIL = "[email protected]"; | ||
public static final String DEFAULT_ADDRESS = "123, Jurong West Ave 6, #08-111"; | ||
public static final String DEFAULT_REMARK = ""; | ||
|
||
private Name name; | ||
private Phone phone; | ||
private Email email; | ||
private Address address; | ||
private Remark remark; | ||
private Set<Tag> tags; | ||
|
||
/** | ||
|
@@ -35,6 +38,7 @@ public PersonBuilder() { | |
phone = new Phone(DEFAULT_PHONE); | ||
email = new Email(DEFAULT_EMAIL); | ||
address = new Address(DEFAULT_ADDRESS); | ||
remark = new Remark(DEFAULT_REMARK); | ||
tags = new HashSet<>(); | ||
} | ||
|
||
|
@@ -46,6 +50,7 @@ public PersonBuilder(Person personToCopy) { | |
phone = personToCopy.getPhone(); | ||
email = personToCopy.getEmail(); | ||
address = personToCopy.getAddress(); | ||
remark = personToCopy.getRemark(); | ||
tags = new HashSet<>(personToCopy.getTags()); | ||
} | ||
|
||
|
@@ -89,8 +94,16 @@ public PersonBuilder withEmail(String email) { | |
return this; | ||
} | ||
|
||
/** | ||
* Sets the {@code Remark} of the {@code Person} that we are building. | ||
*/ | ||
public PersonBuilder withRemark(String remark) { | ||
this.remark = new Remark(remark); | ||
return this; | ||
} | ||
|
||
public Person build() { | ||
return new Person(name, phone, email, address, tags); | ||
return new Person(name, phone, email, address, remark, tags); | ||
} | ||
|
||
} |