public class Utils extends Object
| Modifier and Type | Method and Description |
|---|---|
static <T> T |
fromJson(String json,
Class<T> klass)
Convert the given JSON string into an object using
Gson.
|
static String |
join(String[] strings,
String delimiter)
Concatenate string with the specified delimiter.
|
static String |
stringifyPrompts(Prompt[] prompts)
Stringify an array of
Prompt. |
static String |
stringifyProperties(Property[] properties)
Stringify an array of
Property. |
static String |
stringifyScopeNames(Scope[] scopes)
Generate a list of scope names.
|
static String |
toJson(Object object)
Convert the given object into a JSON string using
Gson.
|
static String |
toJson(Object object,
boolean pretty)
Convert the given object into a JSON string using
Gson.
|
public static String join(String[] strings, String delimiter)
strings - Strings to be concatenated.delimiter - A delimiter used between strings. If null or an empty
string is given, delimiters are not inserted between strings.strings is null,
null is returned. If the size of strings is 0,
an empty string is returned.public static String toJson(Object object)
object - The input object.object is null,
null is returned.public static String toJson(Object object, boolean pretty)
object - The input object.pretty - True for human-readable format.object is null,
null is returned.public static <T> T fromJson(String json, Class<T> klass)
json - The input JSON.klass - The class of the resultant object.public static String stringifyProperties(Property[] properties)
Property.properties - An array of Property. If null is given,
null is returned.properties parameter
is null, null is returned.public static String stringifyPrompts(Prompt[] prompts)
Prompt.prompts - An array of Prompt. If null is given,
null is returned.Copyright © 2017. All rights reserved.