Entity.java 620 B

123456789101112131415161718192021222324252627282930313233343536
  1. package com.edu.base;
  2. import com.alibaba.fastjson.JSON;
  3. import java.io.Serializable;
  4. public class Entity implements Pageable, Serializable {
  5. private static final long serialVersionUID = -7208074780550828689L;
  6. private Page page = null;
  7. public Page setPage(Page page) {
  8. this.page = page;
  9. return this.getPage();
  10. }
  11. public Page getPage() {
  12. return this.page;
  13. }
  14. /**
  15. *
  16. * @return {@link #getPage()}
  17. */
  18. public Page ensurePage() {
  19. if (null == this.getPage()) {
  20. this.setPage(new Page());
  21. }
  22. return this.getPage();
  23. }
  24. @Override
  25. public String toString() {
  26. return JSON.toJSONString(this);
  27. }
  28. }