ProviderSettings

class ProviderSettings(fileDirectory: String, providerId: String)

Settings manager for a Provider

See also

SettingsAPI

(https://github.com/Aliucord/Aliucord/blob/main/Aliucord/src/main/java/com/aliucord/api/SettingsAPI.java)

Constructors

Link copied to clipboard
constructor(fileDirectory: String, providerId: String)

Properties

Link copied to clipboard
Link copied to clipboard

The main settings object of this wrapper class.

Functions

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

Check if Key exists in settings

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

Reads a Boolean from the settings.

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

Gets a Float stored in the settings.

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

Gets an Int stored in the settings.

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

Gets a Long stored in the settings.

Link copied to clipboard
inline fun <T> getObject(key: String, defValue: T? = null): T?

Gets an Object stored in the settings.

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

Gets a String stored in the settings.

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

Get a value of an unknown type

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

Removes Item from settings

Link copied to clipboard

Resets All Settings

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

Writes a Boolean to the settings.

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

Writes a Float to the settings.

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

Writes an Int to the settings.

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

Writes a Long to the settings.

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

Writes an Object to the settings.

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

Writes a String to the settings.

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

Set a value of an unknown type

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

Toggles Boolean and returns it