Class JsonUtil
java.lang.Object
io.grpc.internal.JsonUtil
Helper utility to work with JSON values in Java types. Includes the JSON dialect used by
Protocol Buffers.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncheckObjectList(List<?> rawList) Casts a list of unchecked JSON values to a list of checked objects in Java type.checkStringList(List<?> rawList) Casts a list of unchecked JSON values to a list of String.static BooleangetBoolean(Map<String, ?> obj, String key) Gets a boolean from an object for the given key.static List<?> Gets a list from an object for the given key.getListOfObjects(Map<String, ?> obj, String key) Gets a list from an object for the given key, and verifies all entries are objects.getListOfStrings(Map<String, ?> obj, String key) Gets a list from an object for the given key, and verifies all entries are strings.static DoublegetNumberAsDouble(Map<String, ?> obj, String key) Gets a number from an object for the given key.static FloatgetNumberAsFloat(Map<String, ?> obj, String key) Gets a number from an object for the given key.static IntegergetNumberAsInteger(Map<String, ?> obj, String key) Gets a number from an object for the given key, casted to an integer.static LonggetNumberAsLong(Map<String, ?> obj, String key) Gets a number from an object for the given key, casted to an long.Gets an object from an object for the given key.static StringGets a string from an object for the given key.static LonggetStringAsDuration(Map<String, ?> obj, String key) Gets a string from an object for the given key, parsed as a duration (defined by protobuf).
-
Constructor Details
-
JsonUtil
public JsonUtil()
-
-
Method Details
-
getList
-
getListOfObjects
-
getListOfStrings
-
getObject
-
getNumberAsDouble
-
getNumberAsFloat
-
getNumberAsInteger
-
getNumberAsLong
-
getString
-
getStringAsDuration
-
getBoolean
-
checkObjectList
-
checkStringList
-