Package net.dona.doip.util
Class GsonUtility
- java.lang.Object
-
- net.dona.doip.util.GsonUtility
-
public class GsonUtility extends java.lang.Object
A provider ofGson
instances able to serialize instances ofStream
(as arrays) and instances ofPublicKey
andPrivateKey
(in JSON Web Key format).
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
GsonUtility.PrivateKeyTypeHierarchyAdapter
static class
GsonUtility.PublicKeyTypeHierarchyAdapter
static class
GsonUtility.StreamGsonTypeAdapter<T>
SerializingStream
s of objects in a streaming fashion, which will be useful for outputting extremely large search results.static class
GsonUtility.StreamTypeAdapterFactory
-
Constructor Summary
Constructors Constructor Description GsonUtility()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static com.google.gson.Gson
getGson()
Returns aGson
.static com.google.gson.Gson
getPrettyGson()
Returns aGson
which is configured for pretty-printing.static com.google.gson.GsonBuilder
setup(com.google.gson.GsonBuilder gsonBuilder)
Sets up an instance ofGsonBuilder
to serialize streams and keys.
-
-
-
Method Detail
-
setup
public static com.google.gson.GsonBuilder setup(com.google.gson.GsonBuilder gsonBuilder)
Sets up an instance ofGsonBuilder
to serialize streams and keys.- Parameters:
gsonBuilder
- the GsonBuilder- Returns:
-
getGson
public static com.google.gson.Gson getGson()
Returns aGson
.
-
getPrettyGson
public static com.google.gson.Gson getPrettyGson()
Returns aGson
which is configured for pretty-printing.
-
-