You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

UserDbo.java 1.1KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. package com.rthoni.stssaguenay.dbo;
  2. import com.luticate.utils.dbo.LuDbo;
  3. import org.json.JSONException;
  4. import org.json.JSONObject;
  5. import java.util.HashMap;
  6. /**
  7. * Created by robin on 10/3/16.
  8. */
  9. public class UserDbo extends LuDbo {
  10. protected String _id;
  11. protected String _name;
  12. protected String _email;
  13. @Override
  14. public void fromJson(JSONObject json) throws JSONException {
  15. _id = json.getString("id");
  16. _name = json.getString("name");
  17. _email = json.getString("email");
  18. }
  19. @Override
  20. public HashMap<String, Object> toArray() {
  21. HashMap<String, Object> map = new HashMap<>();
  22. map.put("id", _id);
  23. map.put("name", _name);
  24. map.put("email", _email);
  25. return map;
  26. }
  27. public String getId() {
  28. return _id;
  29. }
  30. public void setId(String id) {
  31. _id = id;
  32. }
  33. public String getName() {
  34. return _name;
  35. }
  36. public void setName(String name) {
  37. _name = name;
  38. }
  39. public String getEmail() {
  40. return _email;
  41. }
  42. public void setEmail(String email) {
  43. _email = email;
  44. }
  45. }