- static long getLong(JSONObject json, String key, long def) {
- if (json.has(key)) {
- Object o = json.get(key);
- if (o instanceof Byte)
- return (Byte) o;
- if (o instanceof Short)
- return (Short) o;
- if (o instanceof Integer)
- return (Integer) o;
- if (o instanceof Long)
- return (Long) o;
- }
+ static private String getString(JSONObject json, String key) {
+ Object o = getObject(json, key);
+ if (o instanceof String)
+ return (String) o;
+
+ return null;
+ }
+
+ static private long getLong(JSONObject json, String key, long def) {
+ Object o = getObject(json, key);
+ if (o instanceof Byte)
+ return (Byte) o;
+ if (o instanceof Short)
+ return (Short) o;
+ if (o instanceof Integer)
+ return (Integer) o;
+ if (o instanceof Long)
+ return (Long) o;