forked from nus-cs2103-AY2324S1/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 zekone/adapt-storage
Adapt storage
- Loading branch information
Showing
9 changed files
with
319 additions
and
29 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
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,31 @@ | ||
package seedu.address.model.event; | ||
|
||
import java.time.LocalDateTime; | ||
import java.time.format.DateTimeFormatter; | ||
|
||
public class Event { | ||
private LocalDateTime start; | ||
private LocalDateTime end; | ||
private String name; | ||
|
||
public Event(String name, String start, String end) { | ||
// Temporary, need update | ||
this.name = name; | ||
this.start = LocalDateTime.now(); | ||
this.end = LocalDateTime.now(); | ||
} | ||
|
||
public String getName() { | ||
return name; | ||
} | ||
|
||
public String getStartString() { | ||
// Temporary, can use Util class instead | ||
return start.format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")); | ||
} | ||
|
||
public String getEndString() { | ||
// Temporary, can use Util class instead | ||
return end.format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")); | ||
} | ||
} |
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,19 @@ | ||
package seedu.address.model.note; | ||
|
||
public class Note { | ||
private final String title; | ||
private final String body; | ||
|
||
public Note(String title, String body) { | ||
this.title = title; | ||
this.body = body; | ||
} | ||
|
||
public String getTitle() { | ||
return title; | ||
} | ||
|
||
public String getBody() { | ||
return body; | ||
} | ||
} |
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 |
---|---|---|
@@ -1,11 +1,14 @@ | ||
package seedu.address.model.util; | ||
|
||
import java.util.ArrayList; | ||
import java.util.Arrays; | ||
import java.util.Set; | ||
import java.util.stream.Collectors; | ||
|
||
import seedu.address.model.AddressBook; | ||
import seedu.address.model.ReadOnlyAddressBook; | ||
import seedu.address.model.event.Event; | ||
import seedu.address.model.note.Note; | ||
import seedu.address.model.person.Address; | ||
import seedu.address.model.person.Email; | ||
import seedu.address.model.person.Name; | ||
|
@@ -18,25 +21,32 @@ | |
*/ | ||
public class SampleDataUtil { | ||
public static Person[] getSamplePersons() { | ||
|
||
ArrayList<Note> sampleNotes = new ArrayList<Note>(); | ||
sampleNotes.add(new Note("Hello", "Sample body")); | ||
|
||
ArrayList<Event> sampleEvents = new ArrayList<Event>(); | ||
sampleEvents.add(new Event("Sample event", null, null)); | ||
|
||
return new Person[] { | ||
new Person(new Name("Alex Yeoh"), new Phone("87438807"), new Email("[email protected]"), | ||
new Address("Blk 30 Geylang Street 29, #06-40"), | ||
getTagSet("friends")), | ||
new Address("Blk 30 Geylang Street 29, #06-40"), | ||
getTagSet("friends"), sampleNotes, sampleEvents), | ||
new Person(new Name("Bernice Yu"), new Phone("99272758"), new Email("[email protected]"), | ||
new Address("Blk 30 Lorong 3 Serangoon Gardens, #07-18"), | ||
getTagSet("colleagues", "friends")), | ||
new Address("Blk 30 Lorong 3 Serangoon Gardens, #07-18"), | ||
getTagSet("colleagues", "friends"), sampleNotes, sampleEvents), | ||
new Person(new Name("Charlotte Oliveiro"), new Phone("93210283"), new Email("[email protected]"), | ||
new Address("Blk 11 Ang Mo Kio Street 74, #11-04"), | ||
getTagSet("neighbours")), | ||
new Address("Blk 11 Ang Mo Kio Street 74, #11-04"), | ||
getTagSet("neighbours"), sampleNotes, sampleEvents), | ||
new Person(new Name("David Li"), new Phone("91031282"), new Email("[email protected]"), | ||
new Address("Blk 436 Serangoon Gardens Street 26, #16-43"), | ||
getTagSet("family")), | ||
new Address("Blk 436 Serangoon Gardens Street 26, #16-43"), | ||
getTagSet("family"), sampleNotes, sampleEvents), | ||
new Person(new Name("Irfan Ibrahim"), new Phone("92492021"), new Email("[email protected]"), | ||
new Address("Blk 47 Tampines Street 20, #17-35"), | ||
getTagSet("classmates")), | ||
new Address("Blk 47 Tampines Street 20, #17-35"), | ||
getTagSet("classmates"), sampleNotes, sampleEvents), | ||
new Person(new Name("Roy Balakrishnan"), new Phone("92624417"), new Email("[email protected]"), | ||
new Address("Blk 45 Aljunied Street 85, #11-31"), | ||
getTagSet("colleagues")) | ||
new Address("Blk 45 Aljunied Street 85, #11-31"), | ||
getTagSet("colleagues"), sampleNotes, sampleEvents) | ||
}; | ||
} | ||
|
||
|
Oops, something went wrong.