Tree PREV CLASS NEXT CLASS SUMMARY: NESTED | FIELD | CONSTR | METHOD DETAIL: FIELD | CONSTR | METHOD com.ibm.portal.streaming.json.helper
Class JsonUtilsjava.lang.Object com.ibm.portal.streaming.json.helper.JsonUtils
public abstract class JsonUtils- extends java.lang.Object
Some helper function for JSON support
- Since:
- 8.0.0.1
Constructor Summary JsonUtils()
Method Summary static java.lang.Object getMember(java.lang.String name, java.lang.Object node)
Return the member of the objectstatic java.util.Set<java.lang.String> getMemberNames(java.lang.Object node)
Return the names of the membersstatic java.lang.Boolean toBoolean(java.lang.Object node)
Converts the node to a boolean valuestatic java.lang.Double toDouble(java.lang.Object node)
Converts the node to a double valuestatic java.lang.Float toFloat(java.lang.Object node)
Converts the node to a float valuestatic java.lang.Integer toInteger(java.lang.Object node)
Converts the node to an integer valuestatic java.util.List<?> toList(java.lang.Object node)
Converts the node to a liststatic java.lang.Long toLong(java.lang.Object node)
Converts the node to a long valuestatic java.util.Map<java.lang.String,?> toMap(java.lang.Object node)
Converts the node to a liststatic java.lang.Number toNumber(java.lang.Object node)
Converts the node to a numberstatic java.lang.String toString(java.lang.Object node)
Converts the node to a string
Methods inherited from class java.lang.Object clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Constructor Detail JsonUtils
public JsonUtils()
Method Detail getMember
public static java.lang.Object getMember(java.lang.String name, java.lang.Object node)
- Returns the member of the object
- Parameters:
- name - the member name
- node - the node
- Returns:
- the member
getMemberNames
public static java.util.Set<java.lang.String> getMemberNames(java.lang.Object node)
- Returns the names of the members
- Parameters:
- node - the node
- Returns:
- the set of names, not null but may be empty
- Since:
- 8.5
toBoolean
public static java.lang.Boolean toBoolean(java.lang.Object node)
- Converts the node to a boolean value
- Parameters:
- node - the node
- Returns:
- the boolean value or null
toDouble
public static java.lang.Double toDouble(java.lang.Object node)
- Converts the node to a double value
- Parameters:
- node - the node
- Returns:
- the double value or null
toFloat
public static java.lang.Float toFloat(java.lang.Object node)
- Converts the node to a float value
- Parameters:
- node - the node
- Returns:
- the float value or null
toInteger
public static java.lang.Integer toInteger(java.lang.Object node)
- Converts the node to an integer value
- Parameters:
- node - the node
- Returns:
- the integer value or null
toList
public static java.util.List<?> toList(java.lang.Object node)
- Converts the node to a list
- Parameters:
- node - the node
- Returns:
- resulting list
toLong
public static java.lang.Long toLong(java.lang.Object node)
- Converts the node to a long value
- Parameters:
- node - the node
- Returns:
- the long value or null
toMap
public static java.util.Map<java.lang.String,?> toMap(java.lang.Object node)
- Converts the node to a list
- Parameters:
- node - the node
- Returns:
- resulting list
toNumber
public static java.lang.Number toNumber(java.lang.Object node)
- Converts the node to a number
- Parameters:
- node - the node
- Returns:
- resulting number
toString
public static java.lang.String toString(java.lang.Object node)
- Converts the node to a string
- Parameters:
- node - the node
- Returns:
- resulting string
Tree PREV CLASS NEXT CLASS SUMMARY: NESTED | FIELD | CONSTR | METHOD DETAIL: FIELD | CONSTR | METHOD