getOrDefault

inline fun <T : Any> ConfigurationSection.getOrDefault(key: String, default: T): T

Gets the configuration section at the specified key and converts it to type T, or returns default if not found.

Return

an instance of type T, or default if not found

Parameters

T

the type to convert the section to

key

the configuration key pointing to the section

default

the default value to return if the section is not found