forked from se-edu/addressbook-level4
-
Notifications
You must be signed in to change notification settings - Fork 2
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 #17 from CS2103-AY1819S2-W16-4/master
Updates are taken
- Loading branch information
Showing
29 changed files
with
513 additions
and
168 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,6 +5,7 @@ | |
import static seedu.address.logic.parser.CliSyntax.PREFIX_EDUCATION; | ||
import static seedu.address.logic.parser.CliSyntax.PREFIX_EMAIL; | ||
import static seedu.address.logic.parser.CliSyntax.PREFIX_GPA; | ||
import static seedu.address.logic.parser.CliSyntax.PREFIX_DEGREE; | ||
import static seedu.address.logic.parser.CliSyntax.PREFIX_NAME; | ||
import static seedu.address.logic.parser.CliSyntax.PREFIX_PHONE; | ||
import static seedu.address.logic.parser.CliSyntax.PREFIX_POS; | ||
|
@@ -29,6 +30,7 @@ public class AddCommand extends Command { | |
+ PREFIX_EMAIL + "EMAIL " | ||
+ PREFIX_EDUCATION + "EDUCATION " | ||
+ PREFIX_GPA + "Gpa " | ||
+ PREFIX_DEGREE + "DEGREE " | ||
+ PREFIX_ADDRESS + "ADDRESS " | ||
+ "[" + PREFIX_SKILL + "TAG]...\n" | ||
+ "Example: " + COMMAND_WORD + " " | ||
|
@@ -37,6 +39,7 @@ public class AddCommand extends Command { | |
+ PREFIX_EMAIL + "[email protected] " | ||
+ PREFIX_EDUCATION + "NUS " | ||
+ PREFIX_GPA + "3 " | ||
+ PREFIX_DEGREE + "Bachelors " | ||
+ PREFIX_ADDRESS + "311, Clementi Ave 2, #02-25 " | ||
+ PREFIX_SKILL + "Java " | ||
+ PREFIX_POS + "Software Engineer"; | ||
|
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
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,81 @@ | ||
package seedu.address.model.person; | ||
|
||
import static java.util.Objects.requireNonNull; | ||
import static seedu.address.commons.util.AppUtil.checkArgument; | ||
|
||
/** | ||
* Represents a Person's name in the address book. | ||
* Guarantees: immutable; is valid as declared in {@link #isValidDegree)} | ||
*/ | ||
public class Degree { | ||
|
||
public static final String MESSAGE_CONSTRAINTS = | ||
"Degree should be the highest level of completed education, and it should not be blank \n" | ||
+ "Can only be either: High school, Associates, Bachelors, Masters or PHD" ; | ||
|
||
/* | ||
* The first character of the Degree must not be a whitespace, | ||
* otherwise " " (a blank string) becomes a valid input. | ||
*/ | ||
|
||
//public static final String VALIDATION_REGEX = ; | ||
|
||
public final String value; | ||
|
||
/** | ||
* Constructs a {@code Degree}. | ||
* | ||
* @param degree A valid degree. | ||
*/ | ||
public Degree(String degree) { | ||
requireNonNull(degree); | ||
checkArgument(isValidDegree(degree), MESSAGE_CONSTRAINTS); | ||
value = degree; | ||
} | ||
|
||
/** | ||
* Returns true if a given string is a valid name. | ||
*/ | ||
public static boolean isValidDegree(String test) { | ||
|
||
if(test.equalsIgnoreCase("High School")){ | ||
return true; | ||
} | ||
if(test.equalsIgnoreCase("Associates")){ | ||
return true; | ||
} | ||
if(test.equalsIgnoreCase("Bachelors")){ | ||
return true; | ||
} | ||
if(test.equalsIgnoreCase("Masters")){ | ||
return true; | ||
} | ||
if(test.equalsIgnoreCase("PHD")){ | ||
return true; | ||
} | ||
return false; | ||
|
||
} | ||
|
||
|
||
@Override | ||
public String toString() { | ||
return value; | ||
} | ||
|
||
//unsure if needed bc people can have the same??? | ||
@Override | ||
public boolean equals(Object other) { | ||
return other == this // short circuit if same object | ||
|| (other instanceof Degree // instanceof handles nulls | ||
&& value.equals(((Degree) other).value)); // state check | ||
} | ||
|
||
@Override | ||
public int hashCode() { | ||
return value.hashCode(); | ||
} | ||
|
||
} | ||
|
||
|
Oops, something went wrong.