data class Settings
Class which holds all current settings
Settings(clientToken: String, selectedAccount: String? = null, accounts: HashMap<String, Map<String, Any>> = hashMapOf(), profiles: MutableList<Profile> = mutableListOf(), repositories: MutableList<RepositoryDefinition> = mutableListOf())
Class which holds all current settings |
val accounts: HashMap<String, Map<String, Any>> |
|
val clientToken: String |
|
val profiles: MutableList<Profile> |
|
val repositories: MutableList<RepositoryDefinition> |
|
var selectedAccount: String? |
fun addAccount(account: MutableMap<String, Any>): Unit
Add account data retrieved from Yggdrasil to settings |
|
fun addProfile(profile: Profile): Boolean
Add profile to settings |
|
fun addRepository(repositoryDefinition: RepositoryDefinition): Boolean
Add repository definition to settings |
|
fun getAccount(uuid: String): Map<String, Any>
Get account by uuid, will throw when no account is found |
|
fun getAccounts(): List<Map<String, Any>>
Get all account maps in a list |
|
fun getConfiguredRepositories(): List<RepositoryDefinition>
Get currently configured repository definitons |
|
fun getProfiles(): List<Profile>
Get profiles from settings |
|
fun getSelectedAccount(): Map<String, Any>?
Get currently selected account, will throw when no accounts are configured |
|
fun getSelectedAccountUuid(): String
Get currently selected account uuid, will throw when no accounts are configured |
|
fun removeAccount(uuid: String): Unit
Remove account by uuid |
|
fun removeRepository(repositoryDefinition: RepositoryDefinition): Boolean
Remove repository definition from settings |
|
fun save(): Unit
Save settings to file |
|
fun selectAccount(uuid: String): Unit
Set selected account by uuid |
fun load(): Settings
Load settings from file, if settings is corrupt or not found a new settings file is created. |