forked from nus-tic4002-AY2021S2/tp2
-
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 nus-tic4002-AY2021S2#9 from AY2021S2-TIC4002-F18-3…
…/master Merge team repo 24 Mar 2021
- Loading branch information
Showing
11 changed files
with
67 additions
and
23 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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
6 changes: 6 additions & 0 deletions
6
src/main/java/seedu/address/model/group/exceptions/GroupNotFoundException.java
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 |
---|---|---|
@@ -0,0 +1,6 @@ | ||
package seedu.address.model.group.exceptions; | ||
|
||
/** | ||
* Signals that the operation is unable to find the specified person. | ||
*/ | ||
public class GroupNotFoundException extends RuntimeException {} |
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 |
---|---|---|
|
@@ -21,7 +21,7 @@ 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_GROUP = "ABC"; | ||
public static final String DEFAULT_GROUP = "N/A"; | ||
|
||
private Name name; | ||
private Phone phone; | ||
|
@@ -51,7 +51,7 @@ public PersonBuilder(Person personToCopy) { | |
email = personToCopy.getEmail(); | ||
address = personToCopy.getAddress(); | ||
tags = new HashSet<>(personToCopy.getTags()); | ||
group = new Group().setGroupName(personToCopy.getGroup().toString()); | ||
group = new Group().setGroupName(DEFAULT_GROUP); | ||
} | ||
|
||
/** | ||
|
@@ -94,6 +94,15 @@ public PersonBuilder withEmail(String email) { | |
return this; | ||
} | ||
|
||
/** | ||
* Sets the {@code Group} of the {@code Person} that we are building. | ||
*/ | ||
public PersonBuilder withGroup(String group) { | ||
this.group = new Group(); | ||
this.group.setGroupName(group); | ||
return this; | ||
} | ||
|
||
public Person build() { | ||
return new Person(name, phone, email, address, tags, group); | ||
} | ||
|
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,6 +4,8 @@ | |
import static seedu.address.logic.commands.CommandTestUtil.VALID_ADDRESS_BOB; | ||
import static seedu.address.logic.commands.CommandTestUtil.VALID_EMAIL_AMY; | ||
import static seedu.address.logic.commands.CommandTestUtil.VALID_EMAIL_BOB; | ||
import static seedu.address.logic.commands.CommandTestUtil.VALID_GROUP_AMY; | ||
import static seedu.address.logic.commands.CommandTestUtil.VALID_GROUP_BOB; | ||
import static seedu.address.logic.commands.CommandTestUtil.VALID_NAME_AMY; | ||
import static seedu.address.logic.commands.CommandTestUtil.VALID_NAME_BOB; | ||
import static seedu.address.logic.commands.CommandTestUtil.VALID_PHONE_AMY; | ||
|
@@ -26,34 +28,37 @@ public class TypicalPersons { | |
public static final Person ALICE = new PersonBuilder().withName("Alice Pauline") | ||
.withAddress("123, Jurong West Ave 6, #08-111").withEmail("[email protected]") | ||
.withPhone("94351253") | ||
.withTags("friends").build(); | ||
.withTags("friends").withGroup("N/A").build(); | ||
public static final Person BENSON = new PersonBuilder().withName("Benson Meier") | ||
.withAddress("311, Clementi Ave 2, #02-25") | ||
.withEmail("[email protected]").withPhone("98765432") | ||
.withTags("owesMoney", "friends").build(); | ||
.withTags("owesMoney", "friends").withGroup("N/A").build(); | ||
public static final Person CARL = new PersonBuilder().withName("Carl Kurz").withPhone("95352563") | ||
.withEmail("[email protected]").withAddress("wall street").build(); | ||
.withEmail("[email protected]").withAddress("wall street").withGroup("N/A").build(); | ||
public static final Person DANIEL = new PersonBuilder().withName("Daniel Meier").withPhone("87652533") | ||
.withEmail("[email protected]").withAddress("10th street").withTags("friends").build(); | ||
.withEmail("[email protected]").withAddress("10th street").withTags("friends") | ||
.withGroup("N/A").build(); | ||
public static final Person ELLE = new PersonBuilder().withName("Elle Meyer").withPhone("9482224") | ||
.withEmail("[email protected]").withAddress("michegan ave").build(); | ||
.withEmail("[email protected]").withAddress("michegan ave") | ||
.withGroup("N/A").build(); | ||
public static final Person FIONA = new PersonBuilder().withName("Fiona Kunz").withPhone("9482427") | ||
.withEmail("[email protected]").withAddress("little tokyo").build(); | ||
.withEmail("[email protected]").withAddress("little tokyo").withGroup("N/A").build(); | ||
public static final Person GEORGE = new PersonBuilder().withName("George Best").withPhone("9482442") | ||
.withEmail("[email protected]").withAddress("4th street").build(); | ||
.withEmail("[email protected]").withAddress("4th street").withGroup("N/A").build(); | ||
|
||
// Manually added | ||
public static final Person HOON = new PersonBuilder().withName("Hoon Meier").withPhone("8482424") | ||
.withEmail("[email protected]").withAddress("little india").build(); | ||
.withEmail("[email protected]").withAddress("little india").withGroup("N/A").build(); | ||
public static final Person IDA = new PersonBuilder().withName("Ida Mueller").withPhone("8482131") | ||
.withEmail("[email protected]").withAddress("chicago ave").build(); | ||
.withEmail("[email protected]").withAddress("chicago ave").withGroup("N/A").build(); | ||
|
||
// Manually added - Person's details found in {@code CommandTestUtil} | ||
public static final Person AMY = new PersonBuilder().withName(VALID_NAME_AMY).withPhone(VALID_PHONE_AMY) | ||
.withEmail(VALID_EMAIL_AMY).withAddress(VALID_ADDRESS_AMY).withTags(VALID_TAG_FRIEND).build(); | ||
.withEmail(VALID_EMAIL_AMY).withAddress(VALID_ADDRESS_AMY).withTags(VALID_TAG_FRIEND) | ||
.withGroup(VALID_GROUP_AMY).build(); | ||
public static final Person BOB = new PersonBuilder().withName(VALID_NAME_BOB).withPhone(VALID_PHONE_BOB) | ||
.withEmail(VALID_EMAIL_BOB).withAddress(VALID_ADDRESS_BOB).withTags(VALID_TAG_HUSBAND, VALID_TAG_FRIEND) | ||
.build(); | ||
.withGroup(VALID_GROUP_BOB).build(); | ||
|
||
public static final String KEYWORD_MATCHING_MEIER = "Meier"; // A keyword that matches MEIER | ||
|
||
|