Advertisement
Guest User

Untitled

a guest
Jan 31st, 2018
160
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.45 KB | None | 0 0
  1. @Document(collection = "Account")
  2. public class Account {
  3. @Id
  4. private String id;
  5. private String userName;
  6. private String passWord;
  7. private String phone;
  8. private String privilege;
  9. private boolean lock;
  10. private long count;
  11. private Date dateCreate;
  12. private Date dateModify;
  13. private Date lastAccess;
  14. private boolean active;
  15.  
  16. public Account() {
  17. }
  18.  
  19. public Account(String id, String userName,
  20. String passWord, String phone, String privilege,
  21. boolean lock, long count, Date dateCreate,
  22. Date dateModify, Date lastAccess, boolean active) {
  23. this.id = id;
  24. this.userName = userName;
  25. this.passWord = passWord;
  26. this.phone = phone;
  27. this.privilege = privilege;
  28. this.lock = lock;
  29. this.count = count;
  30. this.dateCreate = dateCreate;
  31. this.dateModify = dateModify;
  32. this.lastAccess = lastAccess;
  33. this.active = active;
  34. }
  35.  
  36. private JSONObject parseToJSONObject() {
  37. JSONObject jsonObject = JSONFactoryUtil.createJSONObject();
  38.  
  39. jsonObject.put("id", id);
  40. jsonObject.put("username", userName);
  41. jsonObject.put("password", passWord);
  42. jsonObject.put("phone", phone);
  43. jsonObject.put("privilege", privilege);
  44. jsonObject.put("lock", lock);
  45. jsonObject.put("count", count);
  46. jsonObject.put("dateCreate", dateCreate);
  47. jsonObject.put("dateModify", dateModify);
  48. jsonObject.put("lastAccess", lastAccess);
  49. jsonObject.put("active", active);
  50. return jsonObject;
  51. }
  52.  
  53. public String toString() {
  54. JSONObject jsonObject = parseToJSONObject();
  55.  
  56. return jsonObject.toString();
  57. }
  58.  
  59. public String getId() {
  60. return id;
  61. }
  62.  
  63. public void setId(String id) {
  64. this.id = id;
  65. }
  66.  
  67. public String getUserName() {
  68. return userName;
  69. }
  70.  
  71. public void setUserName(String userName) {
  72. this.userName = userName;
  73. }
  74.  
  75. public String getPassWord() {
  76. return passWord;
  77. }
  78.  
  79. public void setPassWord(String passWord) {
  80. this.passWord = passWord;
  81. }
  82.  
  83. public String getPhone() {
  84. return phone;
  85. }
  86.  
  87. public void setPhone(String phone) {
  88. this.phone = phone;
  89. }
  90.  
  91. public String getPrivilege() {
  92. return privilege;
  93. }
  94.  
  95. public void setPrivilege(String privilege) {
  96. this.privilege = privilege;
  97. }
  98.  
  99. public boolean isLock() {
  100. return lock;
  101. }
  102.  
  103. public void setLock(boolean lock) {
  104. this.lock = lock;
  105. }
  106.  
  107. public long getCount() {
  108. return count;
  109. }
  110.  
  111. public void setCount(long count) {
  112. this.count = count;
  113. }
  114.  
  115. public Date getDateCreate() {
  116. return dateCreate;
  117. }
  118.  
  119. public void setDateCreate(Date dateCreate) {
  120. this.dateCreate = dateCreate;
  121. }
  122.  
  123. public Date getDateModify() {
  124. return dateModify;
  125. }
  126.  
  127. public void setDateModify(Date dateModify) {
  128. this.dateModify = dateModify;
  129. }
  130.  
  131. public Date getLastAccess() {
  132. return lastAccess;
  133. }
  134.  
  135. public void setLastAccess(Date lassAccess) {
  136. this.lastAccess = lassAccess;
  137. }
  138.  
  139. public boolean isActive() {
  140. return active;
  141. }
  142.  
  143. public void setActive(boolean active) {
  144. this.active = active;
  145. }
  146. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement