PageRenderTime 38ms CodeModel.GetById 0ms RepoModel.GetById 0ms app.codeStats 0ms

/src/com/jieshuhuiyou/entity/notifications/NewBorrowRequestNotification.java

https://bitbucket.org/psjay/ants-bookbase
Java | 52 lines | 31 code | 14 blank | 7 comment | 0 complexity | c7221076bbfb7cf57c4508a9d55462ff MD5 | raw file
  1. package com.jieshuhuiyou.entity.notifications;
  2. import com.alibaba.fastjson.annotation.JSONCreator;
  3. import com.alibaba.fastjson.annotation.JSONField;
  4. import com.jieshuhuiyou.entity.BorrowRequest;
  5. import com.jieshuhuiyou.entity.Notification.Type;
  6. import com.jieshuhuiyou.entity.User;
  7. /**
  8. * ???????
  9. * @author PSJay
  10. *
  11. */
  12. public class NewBorrowRequestNotification extends AbstractNotification {
  13. private BorrowRequest request;
  14. @JSONCreator
  15. public NewBorrowRequestNotification(@JSONField(name = "request") BorrowRequest request) {
  16. this.request = request;
  17. }
  18. @Override
  19. public String toHTML() {
  20. // TODO Auto-generated method stub
  21. return null;
  22. }
  23. @Override
  24. public User getOwner() {
  25. return request.getSharing().getUser();
  26. }
  27. @Override
  28. public Type getType() {
  29. return Type.NEW_BORROW_REQUEST;
  30. }
  31. // setters and getters
  32. public BorrowRequest getRequest() {
  33. return request;
  34. }
  35. public void setRequest(BorrowRequest request) {
  36. this.request = request;
  37. }
  38. }