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.

LuJSONObjectContainer.java 1.4KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. package com.luticate.utils.dbo.JSONContainer;
  2. import org.json.JSONArray;
  3. import org.json.JSONException;
  4. import org.json.JSONObject;
  5. /**
  6. * Created by robin on 10/21/16.
  7. */
  8. public class LuJSONObjectContainer implements LuAbstractJsonContainer {
  9. protected JSONObject _jsonObject;
  10. public LuJSONObjectContainer(JSONObject jsonObject)
  11. {
  12. _jsonObject = jsonObject;
  13. }
  14. @Override
  15. public int getInt(Object key) throws JSONException {
  16. return _jsonObject.getInt((String) key);
  17. }
  18. @Override
  19. public String getString(Object key) throws JSONException {
  20. return _jsonObject.getString((String) key);
  21. }
  22. @Override
  23. public long getLong(Object key) throws JSONException {
  24. return _jsonObject.getLong((String) key);
  25. }
  26. @Override
  27. public double getDouble(Object key) throws JSONException {
  28. return _jsonObject.getDouble((String) key);
  29. }
  30. @Override
  31. public boolean getBoolean(Object key) throws JSONException {
  32. return _jsonObject.getBoolean((String) key);
  33. }
  34. @Override
  35. public JSONObject getJSONObject(Object key) throws JSONException {
  36. return _jsonObject.getJSONObject((String) key);
  37. }
  38. @Override
  39. public JSONArray getJSONArray(Object key) throws JSONException {
  40. return _jsonObject.getJSONArray((String) key);
  41. }
  42. @Override
  43. public boolean isNull(Object key) throws JSONException {
  44. return _jsonObject.isNull((String) key);
  45. }
  46. }