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.

LuJSONArrayContainer.java 1.4KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  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 LuJSONArrayContainer implements LuAbstractJsonContainer {
  9. protected JSONArray _jsonArray;
  10. public LuJSONArrayContainer(JSONArray jsonArray)
  11. {
  12. _jsonArray = jsonArray;
  13. }
  14. @Override
  15. public int getInt(Object key) throws JSONException {
  16. return _jsonArray.getInt((int) key);
  17. }
  18. @Override
  19. public String getString(Object key) throws JSONException {
  20. return _jsonArray.getString((int) key);
  21. }
  22. @Override
  23. public long getLong(Object key) throws JSONException {
  24. return _jsonArray.getLong((int) key);
  25. }
  26. @Override
  27. public double getDouble(Object key) throws JSONException {
  28. return _jsonArray.getDouble((int) key);
  29. }
  30. @Override
  31. public boolean getBoolean(Object key) throws JSONException {
  32. return _jsonArray.getBoolean((int) key);
  33. }
  34. @Override
  35. public JSONObject getJSONObject(Object key) throws JSONException {
  36. return _jsonArray.getJSONObject((int) key);
  37. }
  38. @Override
  39. public JSONArray getJSONArray(Object key) throws JSONException {
  40. return _jsonArray.getJSONArray((int) key);
  41. }
  42. @Override
  43. public boolean isNull(Object key) throws JSONException {
  44. return _jsonArray.isNull((int) key);
  45. }
  46. }