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.

LuStringDbo.java 779B

1234567891011121314151617181920212223242526272829303132333435363738
  1. package com.luticate.utils.dbo;
  2. import org.json.JSONException;
  3. import org.json.JSONObject;
  4. import java.util.HashMap;
  5. /**
  6. * Created by robin on 11/27/15.
  7. */
  8. public class LuStringDbo extends LuDbo {
  9. public String getString() {
  10. return _value;
  11. }
  12. public void setString(String value) {
  13. _value = value;
  14. }
  15. private String _value;
  16. @Override
  17. public void fromJson(JSONObject json) throws JSONException {
  18. if (json.isNull("value")) {
  19. _value = null;
  20. }
  21. else {
  22. _value = json.getString("value");
  23. }
  24. }
  25. @Override
  26. public HashMap<String, Object> toArray() {
  27. HashMap<String, Object> array = new HashMap<>();
  28. array.put("value", _value);
  29. return array;
  30. }
  31. }