SettingsUtilsJSON

class SettingsUtilsJSON(plugin: String)

Utility class to store and retrieve preferences

Constructors

Link copied to clipboard
constructor(plugin: String)

Functions

Link copied to clipboard
fun exists(key: String): Boolean

Check if Key exists in settings

Link copied to clipboard

Gets All Keys from settings

Link copied to clipboard
fun getBool(key: String, defValue: Boolean): Boolean

Get a boolean from the preferences

Link copied to clipboard
fun getFloat(key: String, defValue: Float): Float

Get a float from the preferences

Link copied to clipboard
fun getInt(key: String, defValue: Int): Int

Get an int from the preferences

Link copied to clipboard
fun getJSONObject(key: String, defValue: JSONObject?): JSONObject?

Get a JSONObject item

Link copied to clipboard
fun getLong(key: String, defValue: Long): Long

Get a long from the preferences

Link copied to clipboard
fun <T> getObject(key: String, defValue: T): T
fun <T> getObject(key: String, defValue: T, type: Type?): T

Get an Object from the preferences

Link copied to clipboard
fun getString(key: String, defValue: String?): String?

Get a String from the preferences

Link copied to clipboard

Removes Item from settings

Link copied to clipboard

Resets All Settings

Link copied to clipboard
fun setBool(key: String, value: Boolean)

Set a boolean item

Link copied to clipboard
fun setFloat(key: String, value: Float)

Set a float item

Link copied to clipboard
fun setInt(key: String, value: Int)

Set an int item

Link copied to clipboard
fun setJSONObject(key: String, value: JSONObject)

Set a JSONObject item

Link copied to clipboard
fun setLong(key: String, value: Long)

Set a long item

Link copied to clipboard
fun setObject(key: String, value: Any)

Set an Object item

Link copied to clipboard
fun setString(key: String, value: String?)

Set a String item

Link copied to clipboard
fun toggleBool(key: String, defVal: Boolean): Boolean

Toggles Boolean and returns it