rename example
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
package com.bitcointxoko.gudariwallet.api
|
||||
|
||||
import com.google.gson.Gson
|
||||
import com.google.gson.GsonBuilder
|
||||
|
||||
/**
|
||||
* Single source of truth for the app's Gson instance.
|
||||
*
|
||||
* All serialization/deserialization — Retrofit, SharedPreferences caches,
|
||||
* and WebSocket message parsing — must use this instance so that registered
|
||||
* type adapters (e.g. [SuccessActionAdapter]) are applied consistently
|
||||
* everywhere.
|
||||
*
|
||||
* To add a new adapter: register it here once. It will automatically apply
|
||||
* to every deserialization path in the app.
|
||||
*/
|
||||
object GsonProvider {
|
||||
val gson: Gson = GsonBuilder()
|
||||
.registerTypeAdapter(SuccessAction::class.java, SuccessActionAdapter())
|
||||
.create()
|
||||
}
|
||||
Reference in New Issue
Block a user