Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @Document()
- public class ToDo {
- @Id
- private Object id;
- private List<Item> day;
- private List<Item> week;
- private List<Item> month;
- private List<Item> year;
- private List<Item> other;
- ToDo(){
- this.id = new ObjectId();
- this.day = new ArrayList<>();
- this.week = new ArrayList<>();
- this.month = new ArrayList<>();
- this.year = new ArrayList<>();
- this.other = new ArrayList<>();
- }
- private class Item {
- @Id
- private Object id;
- private boolean completed;
- private String description;
- private Date date;
- public Item(String description, boolean completed) {
- this.description = description;
- this.completed = completed;
- this.date = new Date();
- this.id = new ObjectId(date);
- }
- }
- public void createItem(String name){
- new Item(name, false);
- }
Add Comment
Please, Sign In to add comment