Skip to content

Commit

Permalink
Merge pull request AY2324S1-CS2103T-T09-2#143 from emzm2023/master
Browse files Browse the repository at this point in the history
Modify method in SampleDataUtil
  • Loading branch information
mingyu-wan authored Nov 1, 2023
2 parents bd9da34 + 90401a5 commit ee2f347
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions src/main/java/seedu/address/model/util/SampleDataUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import java.util.stream.Collectors;

Expand Down Expand Up @@ -60,10 +61,10 @@ public static Client[] getSampleClients() {

public static Project[] getSampleProjects() {
return new Project[] {
new Project(new Name("CodeContact"), new Description("test"), getDeadlineSet("")),
new Project(new Name("TeamTrekker"), new Description("test"), getDeadlineSet("")),
new Project(new Name("Oribital"), new Description("test"), getDeadlineSet("")),
new Project(new Name("Appollo"), new Description("test"), getDeadlineSet("")),
new Project(new Name("CodeContact"), new Description("test"), getDeadlineList("")),
new Project(new Name("TeamTrekker"), new Description("test"), getDeadlineList("")),
new Project(new Name("Oribital"), new Description("test"), getDeadlineList("")),
new Project(new Name("Appollo"), new Description("test"), getDeadlineList("")),
};
}

Expand All @@ -83,9 +84,11 @@ public static Set<String> getProjectSet(String... strings) {
.collect(Collectors.toSet());
}

public static Set<Deadline> getDeadlineSet(String... deadlines) {
return Arrays.stream(deadlines)
.map(t->new Deadline(t))
.collect(Collectors.toSet());
public static List<Deadline> getDeadlineList(String... deadlines) {
List<Deadline> deadlineList = new ArrayList<>();
for (String s : deadlines) {
deadlineList.add(new Deadline(s, deadlineList.size() + 1));
}
return deadlineList;
}
}

0 comments on commit ee2f347

Please sign in to comment.