Package com.ibm.cloud.sdk.core.util
Class GsonSingleton
- java.lang.Object
-
- com.ibm.cloud.sdk.core.util.GsonSingleton
-
public final class GsonSingleton extends java.lang.Object
Gson singleton to be use when transforming from JSON to Java Objects and vise versa. It handles date formatting and pretty print the result
-
-
Field Summary
Fields Modifier and Type Field Description static com.google.gson.TypeAdapter<java.lang.Number>
LAZILY_PARSED_NUMBER_ADAPTER
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static com.google.gson.Gson
getGson()
Gets the Gson instance.static com.google.gson.Gson
getGsonWithoutPrettyPrinting()
Gets the Gson instance.static com.google.gson.Gson
getGsonWithSerializeNulls()
Returns an instance of Gson with the "serialize nulls" config option enabled.
-
-
-
Method Detail
-
getGson
public static com.google.gson.Gson getGson()
Gets the Gson instance.- Returns:
- the Gson
-
getGsonWithoutPrettyPrinting
public static com.google.gson.Gson getGsonWithoutPrettyPrinting()
Gets the Gson instance.- Returns:
- the Gson
-
getGsonWithSerializeNulls
public static com.google.gson.Gson getGsonWithSerializeNulls()
Returns an instance of Gson with the "serialize nulls" config option enabled.- Returns:
- a Gson instance configured to serialize nulls
-
-