Converter

interface Converter<T>

Converts instances of T to be stored and retrieved as Strings in SharedPreferences.

Functions

Link copied to clipboard
abstract fun deserialize(serialized: String?): T

Deserialize to an instance of T. The input is retrieved from SharedPreferences.getString.

Link copied to clipboard
abstract fun serialize(value: T): String?

Serialize the value to a String. The result will be used with SharedPreferences.Editor.putString.