ConfigSection

open class ConfigSection(val internalSection: ConfigurationSection)(source)

A wrapper around ConfigurationSection providing useful utilities for reading/writing.

All get calls are cached, so performance is generally a non-issue here.

See also

Inheritors

Constructors

Link copied to clipboard
constructor(internalSection: ConfigurationSection)

Types

Link copied to clipboard

Thrown when a key is not found.

Properties

Link copied to clipboard
Link copied to clipboard

Returns all the keys in the section.

Functions

Link copied to clipboard
Link copied to clipboard
fun <T> get(key: String, adapter: ConfigAdapter<T>): T?

Returns null if the key does not exist or if the value cannot be converted to the desired type.

fun <T> get(key: String, adapter: ConfigAdapter<T>, defaultValue: T): T

Returns defaultValue if the key does not exist or if the value cannot be converted to the desired type.

Link copied to clipboard
fun <T> getOrThrow(key: String, adapter: ConfigAdapter<T>): T

Throws an error if the key does not exist or if the value cannot be converted to the desired type.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Gets all the values in the section that are themselves sections.

Link copied to clipboard
fun merge(other: ConfigSection)

'Merges' other with this ConfigSection by copying all of its keys into this ConfigSection. If a key exists in both section, this ConfigSection's keys take priority.

Link copied to clipboard
fun <T> set(key: String, value: T)