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 TypeMethodDescriptionvoidClears cached instances for the given connection.voidclearAll()Clears all cached instances.com.google.gson.GsongetInstance(T connection) Creates the configuredGsoninstance.com.google.gson.GsongetInstanceForPrettyPrinting(T connection) Gets the configuredGsoninstance that provides pretty-printed formatted JSON (i.e., useful for testing and/or debugging).
-
Constructor Details
-
GsonFactoryBase
public GsonFactoryBase()
-
-
Method Details
-
getInstance
Creates the configuredGsoninstance.- Parameters:
connection- the connection- Returns:
- the Gson instance
-
getInstanceForPrettyPrinting
Gets the configuredGsoninstance 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
-