Package com.amilesend.client.parse
Class GsonFactoryBase<T extends Connection>
java.lang.Object
com.amilesend.client.parse.GsonFactoryBase<T>
- Type Parameters:
T
- The connection type that this factory is for
Factory that vends new pre-configured
Gson
instances.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
Clears cached instances for the given connection.void
clearAll()
Clears all cached instances.com.google.gson.Gson
getInstance
(T connection) Creates the configuredGson
instance.com.google.gson.Gson
getInstanceForPrettyPrinting
(T connection) Gets the configuredGson
instance that provides pretty-printed formatted JSON (i.e., useful for testing and/or debugging).
-
Constructor Details
-
GsonFactoryBase
public GsonFactoryBase()
-
-
Method Details
-
getInstance
Creates the configuredGson
instance.- Parameters:
connection
- the connection- Returns:
- the Gson instance
-
getInstanceForPrettyPrinting
Gets the configuredGson
instance that provides pretty-printed formatted JSON (i.e., useful for testing and/or debugging).- Parameters:
connection
- the connection- Returns:
- the pre-configured Gson instance
-
clearAll
public void clearAll()Clears all cached instances. -
clear
Clears cached instances for the given connection.- Parameters:
connection
- the connection
-