forked from AY2324S1-CS2103T-W15-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 AY2324S1-CS2103T-W15-4#53 from tiongjjyi/branch_tag
Implement tag feature and enum class StudentRank.java
- Loading branch information
Showing
23 changed files
with
154 additions
and
115 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 |
---|---|---|
@@ -0,0 +1,10 @@ | ||
package seedu.address.model.tag; | ||
|
||
/** | ||
* Enumeration representing the ranking of a student's performance. | ||
*/ | ||
public enum StudentRank { | ||
GOOD, | ||
AVERAGE, | ||
POOR | ||
} |
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,6 +11,7 @@ | |
import seedu.address.model.person.Name; | ||
import seedu.address.model.person.Remark; | ||
import seedu.address.model.person.Student; | ||
import seedu.address.model.tag.StudentRank; | ||
import seedu.address.model.tag.Tag; | ||
|
||
/** | ||
|
@@ -19,20 +20,19 @@ | |
public class SampleDataUtil { | ||
public static final Remark EMPTY_REMARK = new Remark(""); | ||
public static Student[] getSampleStudents() { | ||
|
||
return new Student[] { | ||
new Student(new Name("Alex Yeoh"), new Course("CS2103T"), new Email("[email protected]"), EMPTY_REMARK, | ||
getTagSet("GOOD")), | ||
getTagSet(StudentRank.GOOD)), | ||
new Student(new Name("Bernice Yu"), new Course("CS2103T"), new Email("[email protected]"), | ||
EMPTY_REMARK, getTagSet("GOOD")), | ||
EMPTY_REMARK, getTagSet(StudentRank.POOR)), | ||
new Student(new Name("Charlotte Oliveiro"), new Course("CS2103T"), new Email("[email protected]"), | ||
EMPTY_REMARK, getTagSet("POOR")), | ||
EMPTY_REMARK, getTagSet(StudentRank.POOR)), | ||
new Student(new Name("David Li"), new Course("CS2103T"), new Email("[email protected]"), EMPTY_REMARK, | ||
getTagSet("POOR")), | ||
getTagSet(StudentRank.AVERAGE)), | ||
new Student(new Name("Irfan Ibrahim"), new Course("CS2103T"), new Email("[email protected]"), | ||
EMPTY_REMARK, getTagSet("AVERAGE")), | ||
EMPTY_REMARK, getTagSet(StudentRank.GOOD)), | ||
new Student(new Name("Roy Balakrishnan"), new Course("CS2103T"), new Email("[email protected]"), | ||
EMPTY_REMARK, getTagSet("AVERAGE")) | ||
EMPTY_REMARK, getTagSet(StudentRank.GOOD)) | ||
}; | ||
} | ||
|
||
|
@@ -47,8 +47,8 @@ public static ReadOnlyStudentList getSampleStudentList() { | |
/** | ||
* Returns a tag set containing the list of strings given. | ||
*/ | ||
public static Set<Tag> getTagSet(String... strings) { | ||
return Arrays.stream(strings) | ||
public static Set<Tag> getTagSet(StudentRank... ranking) { | ||
return Arrays.stream(ranking) | ||
.map(Tag::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
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,8 +4,7 @@ | |
"phone": "94351253", | ||
"email": "[email protected]", | ||
"address": "123, Jurong West Ave 6, #08-111", | ||
"remark" : "", | ||
"tagged": [ "friends" ] | ||
"remark" : "" | ||
}, { | ||
"name": "Alice Pauline", | ||
"phone": "94351253", | ||
|
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,7 +4,7 @@ | |
"course": "CS2103T", | ||
"email": "[email protected]", | ||
"remark" : "", | ||
"tags": [ "friends" ] | ||
"tags": [ "GOOD" ] | ||
}, { | ||
"name": "Alice Pauline", | ||
"course": "CS2103T", | ||
|
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,15 +4,15 @@ | |
"name" : "Alice Pauline", | ||
"course" : "CS2103T", | ||
"email" : "[email protected]", | ||
"remark" : "", | ||
"tags" : [ "friends" ] | ||
"remark" : "She likes aardvarks.", | ||
"tags" : [ "AVERAGE" ] | ||
|
||
}, { | ||
"name" : "Benson Meier", | ||
"course" : "CS2103T", | ||
"email" : "[email protected]", | ||
"remark" : "", | ||
"tags" : [ "owesMoney", "friends" ] | ||
"remark" : "He can't take beer!", | ||
"tags" : [ "GOOD" ] | ||
|
||
}, { | ||
"name" : "Carl Kurz", | ||
|
@@ -26,7 +26,7 @@ | |
"course" : "CS2103T", | ||
"email" : "[email protected]", | ||
"remark" : "", | ||
"tags" : [ "friends" ] | ||
"tags" : [ "GOOD" ] | ||
|
||
}, { | ||
"name" : "Elle Meyer", | ||
|
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 |
---|---|---|
|
@@ -18,6 +18,7 @@ | |
import seedu.address.model.StudentList; | ||
import seedu.address.model.person.NameContainsKeywordsPredicate; | ||
import seedu.address.model.person.Student; | ||
import seedu.address.model.tag.StudentRank; | ||
import seedu.address.testutil.EditStudentDescriptorBuilder; | ||
|
||
/** | ||
|
@@ -27,23 +28,32 @@ public class CommandTestUtil { | |
|
||
public static final String VALID_NAME_AMY = "Amy Bee"; | ||
public static final String VALID_NAME_BOB = "Bob Choo"; | ||
public static final String VALID_NAME_CLARA = "Clara Ng"; | ||
|
||
public static final String VALID_COURSE_AMY = "11111111"; | ||
public static final String VALID_COURSE_BOB = "22222222"; | ||
public static final String VALID_COURSE_CLARA = "33333333"; | ||
public static final String VALID_EMAIL_AMY = "[email protected]"; | ||
public static final String VALID_EMAIL_BOB = "[email protected]"; | ||
public static final String VALID_EMAIL_CLARA = "[email protected]"; | ||
public static final String VALID_REMARK_AMY = "Like skiing."; | ||
public static final String VALID_REMARK_BOB = "Favourite pastime: Eating"; | ||
public static final String VALID_TAG_HUSBAND = "husband"; | ||
public static final String VALID_TAG_FRIEND = "friend"; | ||
public static final StudentRank VALID_TAG_AVERAGE = StudentRank.AVERAGE; | ||
public static final StudentRank VALID_TAG_GOOD = StudentRank.GOOD; | ||
public static final StudentRank VALID_TAG_POOR = StudentRank.POOR; | ||
|
||
public static final String NAME_DESC_AMY = " " + PREFIX_NAME + VALID_NAME_AMY; | ||
public static final String NAME_DESC_BOB = " " + PREFIX_NAME + VALID_NAME_BOB; | ||
public static final String NAME_DESC_CLARA = " " + PREFIX_NAME + VALID_NAME_CLARA; | ||
public static final String COURSE_DESC_AMY = " " + PREFIX_COURSE + VALID_COURSE_AMY; | ||
public static final String COURSE_DESC_BOB = " " + PREFIX_COURSE + VALID_COURSE_BOB; | ||
public static final String COURSE_DESC_CLARA = " " + PREFIX_COURSE + VALID_COURSE_CLARA; | ||
public static final String EMAIL_DESC_AMY = " " + PREFIX_EMAIL + VALID_EMAIL_AMY; | ||
public static final String EMAIL_DESC_BOB = " " + PREFIX_EMAIL + VALID_EMAIL_BOB; | ||
public static final String TAG_DESC_FRIEND = " " + PREFIX_TAG + VALID_TAG_FRIEND; | ||
public static final String TAG_DESC_HUSBAND = " " + PREFIX_TAG + VALID_TAG_HUSBAND; | ||
public static final String EMAIL_DESC_CLARA = " " + PREFIX_EMAIL + VALID_EMAIL_CLARA; | ||
public static final String TAG_DESC_AVERAGE = " " + PREFIX_TAG + VALID_TAG_AVERAGE; | ||
public static final String TAG_DESC_GOOD = " " + PREFIX_TAG + VALID_TAG_GOOD; | ||
public static final String TAG_DESC_POOR = " " + PREFIX_TAG + VALID_TAG_POOR; | ||
|
||
public static final String INVALID_NAME_DESC = " " + PREFIX_NAME + "James&"; // '&' not allowed in names | ||
public static final String INVALID_COURSE_DESC = " " + PREFIX_COURSE + "911CS"; // 'a' not allowed in COURSEs | ||
|
@@ -52,17 +62,20 @@ public class CommandTestUtil { | |
|
||
public static final String PREAMBLE_WHITESPACE = "\t \r \n"; | ||
public static final String PREAMBLE_NON_EMPTY = "NonEmptyPreamble"; | ||
|
||
public static final EditCommand.EditStudentDescriptor DESC_AMY; | ||
public static final EditCommand.EditStudentDescriptor DESC_BOB; | ||
public static final EditCommand.EditStudentDescriptor DESC_CLARA; | ||
|
||
static { | ||
DESC_AMY = new EditStudentDescriptorBuilder().withName(VALID_NAME_AMY) | ||
.withCourse(VALID_COURSE_AMY).withEmail(VALID_EMAIL_AMY) | ||
.withTags(VALID_TAG_FRIEND).build(); | ||
.withTags(VALID_TAG_AVERAGE).build(); | ||
DESC_BOB = new EditStudentDescriptorBuilder().withName(VALID_NAME_BOB) | ||
.withCourse(VALID_COURSE_BOB).withEmail(VALID_EMAIL_BOB) | ||
.withTags(VALID_TAG_HUSBAND, VALID_TAG_FRIEND).build(); | ||
.withTags(VALID_TAG_POOR).build(); | ||
DESC_CLARA = new EditStudentDescriptorBuilder().withName(VALID_NAME_CLARA) | ||
.withCourse(VALID_COURSE_CLARA).withEmail(VALID_EMAIL_CLARA) | ||
.withTags(VALID_TAG_GOOD).build(); | ||
} | ||
|
||
/** | ||
|
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
Oops, something went wrong.