get

inline fun <T : Any> ConfigurationSection.get(key: String): T?

Gets the configuration section at the specified key and converts it to type T.

Return

an instance of type T, or null if the key does not exist or is not a section

Parameters

T

the type to convert the section to

key

the configuration key pointing to the section


inline operator fun <T : Any> ConfigurationSection.get(key: String, runner: T.() -> Unit): T?

Gets the configuration section at the specified key, converts it to type T, and executes the runner on it.

This operator function allows for a concise DSL-like syntax for accessing and configuring nested data.

Return

the converted instance of type T, or null if the section was not found

Parameters

T

the type to convert the section to

key

the configuration key pointing to the section

runner

a block of code to execute on the converted instance