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.

RoutesDbo.java 1.6KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. package com.rthoni.stssaguenay.dbo;
  2. import com.luticate.utils.dbo.LuDbo;
  3. import com.luticate.utils.dbo.LuPaginatedDbo;
  4. import org.json.JSONException;
  5. import org.json.JSONObject;
  6. import java.util.HashMap;
  7. /**
  8. * Created by robin on 9/30/16.
  9. */
  10. public class RoutesDbo extends LuDbo {
  11. public static class PaginatedRoutesDbo extends LuPaginatedDbo<RoutesDbo>
  12. {
  13. }
  14. protected String _id;
  15. protected String _name;
  16. protected String _bgColor;
  17. protected String _fgColor;
  18. @Override
  19. public void fromJson(JSONObject json) throws JSONException {
  20. _id = json.getString("id");
  21. _name = json.getString("name");
  22. _bgColor = json.getString("bgColor");
  23. _fgColor = json.getString("fgColor");
  24. }
  25. @Override
  26. public HashMap<String, Object> toArray() {
  27. HashMap<String, Object> map = new HashMap<>();
  28. map.put("id", _id);
  29. map.put("name", _name);
  30. map.put("bgColor", _bgColor);
  31. map.put("fgColor", _fgColor);
  32. return map;
  33. }
  34. public String getId() {
  35. return _id;
  36. }
  37. public void setId(String id) {
  38. _id = id;
  39. }
  40. public String getFullName()
  41. {
  42. return String.format("%s - %s", _id, _name);
  43. }
  44. public String getName() {
  45. return _name;
  46. }
  47. public void setName(String name) {
  48. _name = name;
  49. }
  50. public String getBgColor() {
  51. return _bgColor;
  52. }
  53. public void setBgColor(String bgColor) {
  54. _bgColor = bgColor;
  55. }
  56. public String getFgColor() {
  57. return _fgColor;
  58. }
  59. public void setFgColor(String fgColor) {
  60. _fgColor = fgColor;
  61. }
  62. }