VirtualConfig

class VirtualConfig(val name: String, var description: String = "none", val database: Database? = null)

Constructors

Link copied to clipboard
constructor(name: String, description: String = "none", database: Database? = null)

Properties

Link copied to clipboard
val database: Database? = null
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Functions

Link copied to clipboard
fun close()

Closes the config and deletes the temp file

Link copied to clipboard
fun <T : Any> getEntry(entry: String, default: T, addIfMissing: Boolean = true): T

Returns the Value from the Entry and sets the Value if it does not exist NOTE: This will not update the config in the Database, you have to manually call publish() if you want to add the missing entry

Link copied to clipboard
fun init(defaultConfig: JSONObject = JSONObject())

Initializes the VirtualConfig This will create the temp file and load the config from MySQL or create an empty config

Link copied to clipboard

Reloads the data from the JSON File NOTE: This won't update the config in the Database, you have to manually call publish()

Link copied to clipboard
fun publish()

Publishes the current config to the MySQL Database

Link copied to clipboard
fun pull()

Pulls the config from MySQL

Link copied to clipboard
fun <T : Any> setEntry(entry: String, value: T)

Sets the Entry specified to a Value NOTE: This will not update the config in the Database, you have to manually call publish()