YmlConfig

class YmlConfig(val file: File)

Representation of a YAML config file

Parameters

file

The file to load the config from (usually a file ending in .yml)

Constructors

Link copied to clipboard
constructor(file: File)

Properties

Link copied to clipboard
var config: YamlConfiguration

The raw YamlConfiguration file

Link copied to clipboard
val file: File

Functions

Link copied to clipboard
fun add(path: String, value: Any): YmlConfig

Adds the value of the given path without replacing it if it already exists

Link copied to clipboard

Destroys the config file

Link copied to clipboard
fun entries(deep: Boolean = false): Set<Map.Entry<String, Any>>

Gets the entry set of the YmlConfig

Link copied to clipboard
fun get(path: String): Any

Gets the value of the given path

Link copied to clipboard

Gets the value of the given path as a Boolean

Link copied to clipboard

Gets a List of Boolean from the given path

Link copied to clipboard

Gets a List of Boolean from the given path or sets the default value if it doesn't exist

Link copied to clipboard
fun getBooleanOrSet(path: String, default: Boolean): Boolean

Gets the value of the given path as a Boolean or sets the default value if it doesn't exist

Link copied to clipboard
fun getDouble(path: String): Double

Gets the value of the given path as a Double

Link copied to clipboard

Gets a List of Double from the given path

Link copied to clipboard

Gets a List of Double from the given path or sets the default value if it doesn't exist

Link copied to clipboard
fun getDoubleOrSet(path: String, default: Double): Double

Gets the value of the given path as a Double or sets the default value if it doesn't exist

Link copied to clipboard
fun getFloat(path: String): Float

Gets the value of the given path as a Float

Link copied to clipboard

Gets a List of Float from the given path

Link copied to clipboard
fun getFloatListOrSet(path: String, default: List<Float>): List<Float>

Gets a List of Float from the given path or sets the default value if it doesn't exist

Link copied to clipboard
fun getFloatOrSet(path: String, default: Float): Float

Gets the value of the given path as a Float or sets the default value if it doesn't exist

Link copied to clipboard
fun getInt(path: String): Int

Gets the value of the given path as a Int

Link copied to clipboard
fun getIntList(path: String): List<Int>

Gets a List of Int from the given path

Link copied to clipboard
fun getIntListOrSet(path: String, default: List<Int>): List<Int>

Gets a List of Int from the given path or sets the default value if it doesn't exist

Link copied to clipboard
fun getIntOrSet(path: String, default: Int): Int

Gets the value of the given path as a Int or sets the default value if it doesn't exist

Link copied to clipboard
fun getList(path: String): List<*>

Gets a List from the given path

Link copied to clipboard
fun getListOrSet(path: String, default: List<*>): List<*>

Gets a List from the given path or sets the default value if it doesn't exist

Link copied to clipboard
fun getLong(path: String): Long

Gets the value of the given path as a Long

Link copied to clipboard

Gets a List of Long from the given path

Link copied to clipboard
fun getLongListOrSet(path: String, default: List<Long>): List<Long>

Gets a List of Long from the given path or sets the default value if it doesn't exist

Link copied to clipboard
fun getLongOrSet(path: String, default: Long): Long

Gets the value of the given path as a Long or sets the default value if it doesn't exist

Link copied to clipboard
fun getOrSet(path: String, default: Any): Any

Gets the value of the given path or sets the default value if it doesn't exist

Link copied to clipboard
fun getSection(path: String): ConfigurationSection

Gets a configuration section of the given path

Link copied to clipboard
fun getString(path: String): String

Gets the value of the given path as a String

Link copied to clipboard

Gets a List of String from the given path

Link copied to clipboard

Gets a List of String from the given path or sets the default value if it doesn't exist

Link copied to clipboard
fun getStringOrSet(path: String, default: String): String

Gets the value of the given path as a String or sets the default value if it doesn't exist

Link copied to clipboard
fun has(path: String): Boolean

Checks if the given path exists

Link copied to clipboard
fun keys(deep: Boolean = false): Set<String>

Gets the keys of the YmlConfig

Link copied to clipboard

Loads the config file and clears the current cache

Link copied to clipboard
fun remove(path: String): YmlConfig

Removes the value of the given path

Link copied to clipboard

Saves the config file

Link copied to clipboard
fun set(path: String, value: Any): YmlConfig

Sets the value of the given path