EnumAdapter

class EnumAdapter<T : Enum<T>>(clazz: Class<T>) : Adapter<T>

Stores and retrieves instances of enum T converted into a String in SharedPreferences

Constructors

Link copied to clipboard
constructor(clazz: Class<T>)

Functions

Link copied to clipboard
open override fun get(key: String?, sharedPreference: SharedPreferences, defaultValue: T): T

Retrieve the value for key from sharedPreference, or defaultValue if the preference is unset, or was set to null.

Link copied to clipboard
open override fun set(key: String?, value: T, editor: SharedPreferences.Editor)

Store value for key in editor.