Package nxt.addons
Class JO
- java.lang.Object
-
- java.util.AbstractMap
-
- nxt.addons.JO
-
- All Implemented Interfaces:
java.util.Map
public class JO extends java.util.AbstractMap
Delegate json object operations to json simple and wrap it with convenience methods This class does not really keep a map, but it implements a map in order to delegate entrySet to the underlying JSONArray in order to support streaming into String.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.Set<java.util.Map.Entry>
entrySet()
java.lang.Object
get(java.lang.String key)
JA
getArray(java.lang.String key)
boolean
getBoolean(java.lang.String key)
boolean
getBoolean(java.lang.String key, boolean defaultValue)
byte
getByte(java.lang.String key)
byte
getByte(java.lang.String key, byte defaultValue)
double
getDouble(java.lang.String key)
double
getDouble(java.lang.String key, double defaultValue)
long
getEntityId(java.lang.String key)
float
getFloat(java.lang.String key)
float
getFloat(java.lang.String key, float defaultValue)
int
getInt(java.lang.String key)
int
getInt(java.lang.String key, int defaultValue)
JO
getJo(java.lang.String key)
java.util.List<JO>
getJoList(java.lang.String key)
long
getLong(java.lang.String key)
long
getLong(java.lang.String key, long defaultValue)
short
getShort(java.lang.String key)
short
getShort(java.lang.String key, short defaultValue)
java.lang.String
getString(java.lang.String key)
java.lang.String
getString(java.lang.String key, java.lang.String defaultValue)
boolean
isExist(java.lang.String key)
static JO
parse(java.io.Reader r)
static JO
parse(java.lang.String s)
byte[]
parseHexString(java.lang.String key)
void
put(java.lang.String key, java.lang.Object o)
org.json.simple.JSONObject
toJSONObject()
java.lang.String
toJSONString()
static JO
valueOf(java.lang.Object o)
-
Methods inherited from class java.util.AbstractMap
clear, clone, containsKey, containsValue, equals, get, hashCode, isEmpty, keySet, put, putAll, remove, size, toString, values
-
-
-
-
Method Detail
-
toJSONObject
public org.json.simple.JSONObject toJSONObject()
-
put
public void put(java.lang.String key, java.lang.Object o)
-
getArray
public JA getArray(java.lang.String key)
-
getJoList
public java.util.List<JO> getJoList(java.lang.String key)
-
valueOf
public static JO valueOf(java.lang.Object o)
-
parse
public static JO parse(java.lang.String s)
-
parse
public static JO parse(java.io.Reader r)
-
get
public java.lang.Object get(java.lang.String key)
-
getJo
public JO getJo(java.lang.String key)
-
getEntityId
public long getEntityId(java.lang.String key)
-
entrySet
public java.util.Set<java.util.Map.Entry> entrySet()
- Specified by:
entrySet
in interfacejava.util.Map
- Specified by:
entrySet
in classjava.util.AbstractMap
-
toJSONString
public java.lang.String toJSONString()
-
getLong
public long getLong(java.lang.String key, long defaultValue)
-
getLong
public long getLong(java.lang.String key)
-
getInt
public int getInt(java.lang.String key, int defaultValue)
-
getInt
public int getInt(java.lang.String key)
-
getDouble
public double getDouble(java.lang.String key, double defaultValue)
-
getDouble
public double getDouble(java.lang.String key)
-
getFloat
public float getFloat(java.lang.String key, float defaultValue)
-
getFloat
public float getFloat(java.lang.String key)
-
getShort
public short getShort(java.lang.String key, short defaultValue)
-
getShort
public short getShort(java.lang.String key)
-
getByte
public byte getByte(java.lang.String key, byte defaultValue)
-
getByte
public byte getByte(java.lang.String key)
-
getBoolean
public boolean getBoolean(java.lang.String key, boolean defaultValue)
-
getBoolean
public boolean getBoolean(java.lang.String key)
-
getString
public java.lang.String getString(java.lang.String key, java.lang.String defaultValue)
-
getString
public java.lang.String getString(java.lang.String key)
-
parseHexString
public byte[] parseHexString(java.lang.String key)
-
isExist
public boolean isExist(java.lang.String key)
-
-