Advertisement
Guest User

Untitled

a guest
Aug 25th, 2016
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.80 KB | None | 0 0
  1. @Document()
  2.  
  3.  
  4. public class ToDo {
  5. @Id
  6. private Object id;
  7. private List<Item> day;
  8. private List<Item> week;
  9. private List<Item> month;
  10. private List<Item> year;
  11. private List<Item> other;
  12.  
  13. ToDo(){
  14. this.id = new ObjectId();
  15. this.day = new ArrayList<>();
  16. this.week = new ArrayList<>();
  17. this.month = new ArrayList<>();
  18. this.year = new ArrayList<>();
  19. this.other = new ArrayList<>();
  20. }
  21.  
  22. private class Item {
  23.  
  24. @Id
  25. private Object id;
  26. private boolean completed;
  27. private String description;
  28. private Date date;
  29.  
  30. public Item(String description, boolean completed) {
  31. this.description = description;
  32. this.completed = completed;
  33. this.date = new Date();
  34. this.id = new ObjectId(date);
  35. }
  36. }
  37.  
  38. public void createItem(String name){
  39. new Item(name, false);
  40. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement