forked from nus-cs2103-AY2324S2/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.
Merge pull request #32 from Dexter-Wong/branch-add-extra-info
Branch add extra info
- Loading branch information
Showing
23 changed files
with
284 additions
and
44 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,6 +4,7 @@ | |
import static seedu.address.logic.parser.CliSyntax.PREFIX_ADDRESS; | ||
import static seedu.address.logic.parser.CliSyntax.PREFIX_COMPANY_NAME; | ||
import static seedu.address.logic.parser.CliSyntax.PREFIX_EMAIL; | ||
import static seedu.address.logic.parser.CliSyntax.PREFIX_INFO; | ||
import static seedu.address.logic.parser.CliSyntax.PREFIX_INTERVIEWTIME; | ||
import static seedu.address.logic.parser.CliSyntax.PREFIX_NAME; | ||
import static seedu.address.logic.parser.CliSyntax.PREFIX_PHONE; | ||
|
@@ -31,7 +32,8 @@ public class AddCommand extends Command { | |
+ PREFIX_EMAIL + "EMAIL " | ||
+ PREFIX_ADDRESS + "ADDRESS " | ||
+ PREFIX_INTERVIEWTIME + "INTERVIEW-TIME" | ||
+ PREFIX_SALARY + "SALARY" | ||
+ PREFIX_SALARY + "SALARY " | ||
+ PREFIX_INFO + "INFO " | ||
+ "[" + PREFIX_TAG + "TAG]...\n" | ||
+ "Example: " + COMMAND_WORD + " " | ||
+ PREFIX_COMPANY_NAME + "Google " | ||
|
@@ -40,13 +42,13 @@ public class AddCommand extends Command { | |
+ PREFIX_EMAIL + "[email protected] " | ||
+ PREFIX_ADDRESS + "311, Clementi Ave 2, #02-25 " | ||
+ PREFIX_INTERVIEWTIME + "121220221400" | ||
+ PREFIX_SALARY + "Salary: 0$" | ||
+ PREFIX_SALARY + "Salary: 0$ " | ||
+ PREFIX_INFO + "Birthday: 12 May 2001 " | ||
+ PREFIX_TAG + "friends " | ||
+ PREFIX_TAG + "owesMoney"; | ||
|
||
public static final String MESSAGE_SUCCESS = "New person added: %1$s"; | ||
public static final String MESSAGE_DUPLICATE_PERSON = "This person already exists in the address book"; | ||
|
||
private final Person toAdd; | ||
|
||
/** | ||
|
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 |
---|---|---|
@@ -0,0 +1,55 @@ | ||
package seedu.address.model.person; | ||
|
||
/** | ||
* Represents a Person's info in the address book. | ||
*/ | ||
public class Info { | ||
public final String value; | ||
|
||
/** | ||
* Constructs a {@code Info}. | ||
* | ||
* @param info Information about the person in the address book | ||
*/ | ||
public Info(String info) { | ||
value = info; | ||
} | ||
|
||
public Info() { | ||
value = ""; | ||
} | ||
|
||
public static boolean isValidInfo(String test) { | ||
return true; | ||
} | ||
|
||
public String getInfo() { | ||
return value; | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
return value; | ||
} | ||
|
||
@Override | ||
public boolean equals(Object other) { | ||
if (other == this) { | ||
return true; | ||
} | ||
|
||
// instanceof handles nulls | ||
if (!(other instanceof Info)) { | ||
return false; | ||
} | ||
|
||
Info otherInfo = (Info) other; | ||
return value.equals(otherInfo.value); | ||
} | ||
|
||
@Override | ||
public int hashCode() { | ||
return value.hashCode(); | ||
} | ||
|
||
} |
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 |
---|---|---|
|
@@ -9,6 +9,7 @@ | |
import seedu.address.model.person.Address; | ||
import seedu.address.model.person.CompanyName; | ||
import seedu.address.model.person.Email; | ||
import seedu.address.model.person.Info; | ||
import seedu.address.model.person.InterviewTime; | ||
import seedu.address.model.person.Name; | ||
import seedu.address.model.person.Person; | ||
|
@@ -25,25 +26,28 @@ public static Person[] getSamplePersons() { | |
new Person(new CompanyName("Google"), new Name("Alex Yeoh"), new Phone("87438807"), new Email("alexyeoh" | ||
+ "@example.com"), | ||
new Address("Blk 30 Geylang Street 29, #06-40"), | ||
new InterviewTime("121220221400"), new Salary("0"), | ||
new InterviewTime("121220221400"), new Salary("0"), new Info("Friend of boss"), | ||
getTagSet("friends")), | ||
new Person(new CompanyName("Google"), new Name("Bernice Yu"), new Phone("99272758"), | ||
new Email("[email protected]"), new Address("Blk 30 Lorong 3 Serangoon Gardens, #07-18"), | ||
new InterviewTime("121220221400"), new Salary("0"), | ||
new InterviewTime("121220221400"), new Salary("0"), new Info("Friend of boss"), | ||
getTagSet("colleagues", "friends")), | ||
new Person(new CompanyName("Google"), new Name("Charlotte Oliveiro"), new Phone("93210283"), | ||
new Email("[email protected]"), new Address("Blk 11 Ang Mo Kio Street 74, #11-04"), | ||
new InterviewTime("121220221400"), new Salary("0"), | ||
new InterviewTime("121220221400"), new Salary("0"), new Info("Friend of boss"), | ||
getTagSet("neighbours")), | ||
new Person(new CompanyName("Google"), new Name("David Li"), new Phone("91031282"), | ||
new Email("[email protected]"), new Address("Blk 436 Serangoon Gardens Street 26, #16-43"), | ||
new InterviewTime("121220221400"), new Salary("0"), getTagSet("family")), | ||
new InterviewTime("121220221400"), new Salary("0"), new Info("Friend of boss"), | ||
getTagSet("family")), | ||
new Person(new CompanyName("Google"), new Name("Irfan Ibrahim"), new Phone("92492021"), | ||
new Email("[email protected]"), new Address("Blk 47 Tampines Street 20, #17-35"), | ||
new InterviewTime("121220221400"), new Salary("0"), getTagSet("classmates")), | ||
new InterviewTime("121220221400"), new Salary("0"), new Info("Friend of boss"), | ||
getTagSet("classmates")), | ||
new Person(new CompanyName("Amazon"), new Name("Roy Balakrishnan"), new Phone("92624417"), | ||
new Email("[email protected]"), new Address("Blk 45 Aljunied Street 85, #11-31"), | ||
new InterviewTime("121220221400"), new Salary("0"), getTagSet("colleagues")) | ||
new InterviewTime("121220221400"), new Salary("0"), new Info("Friend of boss"), | ||
getTagSet("colleagues")) | ||
}; | ||
} | ||
|
||
|
Oops, something went wrong.