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.

LuPermissionDbo.java 1.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. package com.luticate.auth.dbo;
  2. import com.luticate.utils.dbo.LuDbo;
  3. import com.luticate.utils.dbo.LuMultipleDbo;
  4. import org.json.JSONException;
  5. import org.json.JSONObject;
  6. import java.util.HashMap;
  7. /**
  8. *
  9. * Created by robin on 11/27/15.
  10. */
  11. public class LuPermissionDbo extends LuDbo {
  12. public static class LuMultiplePermissionDbo extends LuMultipleDbo<LuPermissionDbo> {
  13. }
  14. private String _name;
  15. private boolean _value;
  16. public String getName() {
  17. return _name;
  18. }
  19. public void setName(String name) {
  20. _name = name;
  21. }
  22. public boolean getValue() {
  23. return _value;
  24. }
  25. public void setValue(boolean value) {
  26. _value = value;
  27. }
  28. @Override
  29. public void fromJson(JSONObject json) throws JSONException {
  30. _name = json.getString("Name");
  31. _value = json.getBoolean("Value");
  32. }
  33. @Override
  34. public HashMap<String, Object> toArray() {
  35. HashMap<String, Object> array = new HashMap<>();
  36. array.put("Name", _name);
  37. array.put("Value", _value);
  38. return array;
  39. }
  40. }