RichUtils / pyxis.uzuki.live.richutilskt.utils / RPreference

RPreference

class RPreference

Functions

clear

fun clear(): Boolean

clear all of preferences

delete

fun delete(key: String): Boolean

delete key-value from SharedPreference

getBoolean

fun getBoolean(key: String, def: Boolean = false): Boolean

get Boolean value from SharedPreference

getChar

fun getChar(key: String, def: Char = '\u0000'): Char

get Char value from SharedPreference

getCharSequence

fun getCharSequence(key: String, def: CharSequence = ""): CharSequence

get CharSequence value from SharedPreference

getDouble

fun getDouble(key: String, def: Double = 0.toDouble()): Double

get Double value from SharedPreference

getFloat

fun getFloat(key: String, def: Float = 0f): Float

get Float value from SharedPreference

getInt

fun getInt(key: String, def: Int = 0): Int

get Int value from SharedPreference

getLong

fun getLong(key: String, def: Long = 0): Long

get Long value from SharedPreference

getString

fun getString(key: String, def: String = ""): String

get String value from SharedPreference

put

fun put(key: String, value: String): Boolean

put String to SharedPreference

fun put(key: String, value: CharSequence): Boolean

put CharSequence to SharedPreference

fun put(key: String, value: Boolean): Boolean

put Boolean to SharedPreference

fun put(key: String, value: Int): Boolean

put Int to SharedPreference

fun put(key: String, value: Long): Boolean

put Long to SharedPreference

fun put(key: String, value: Float): Boolean

put Float to SharedPreference

fun put(key: String, value: Double): Boolean

put Double to SharedPreference

fun put(key: String, value: Char): Boolean

put Char to SharedPreference

fun put(pair: Pair<String, Any>): Unit

Put any value to SharedPreference

Companion Object Functions

getInstance

fun getInstance(c: Context): RPreference