Package io.datarouter.gson
Class GsonTool
java.lang.Object
io.datarouter.gson.GsonTool
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic com.google.gson.GsonBuilderbuilder(EnumTypeAdapterFactory enumTypeAdapterFactory) static com.google.gson.GsonBuilderThis can be used if you don't expect to serialize any enums and would like an error if an enum is foundstatic final com.google.gson.GsonforLogs()Quick solution for printing a value that is not parsed by another system.static final com.google.gson.GsonQuick solution for pretty-printing a value that is not parsed by another system.static StringprettyPrint(String json) static com.google.gson.Gsonstatic com.google.gson.GsonDeprecated.This is for a quick check to see if any enums are being serialized.
-
Field Details
-
GSON
public static final com.google.gson.Gson GSON
-
-
Constructor Details
-
GsonTool
public GsonTool()
-
-
Method Details
-
builder
-
withoutEnums
public static com.google.gson.Gson withoutEnums() -
builderWithoutEnums
public static com.google.gson.GsonBuilder builderWithoutEnums()This can be used if you don't expect to serialize any enums and would like an error if an enum is found -
withUnregisteredEnums
Deprecated.This is for a quick check to see if any enums are being serialized. If so it should be replaced with a dedicated subclass of EnumTypeAdapterFactory. If not it should be replaced with GsonTool.withoutEnums(). -
forLogsPretty
public static final com.google.gson.Gson forLogsPretty()Quick solution for pretty-printing a value that is not parsed by another system. Lacks things like enum validation. -
forLogs
public static final com.google.gson.Gson forLogs()Quick solution for printing a value that is not parsed by another system. Lacks things like enum validation. -
prettyPrint
-