config / org.apache.tuweni.config / Schema

Schema

class Schema (source)

A schema for a configuration, providing default values and validation rules.

Functions

defaultsKeySet

fun defaultsKeySet(): MutableSet<String>

The keys of all defaults provided by this schema.

description

fun description(key: String): String?

Get the description for a key.

getDefault

fun getDefault(key: String): Any

Get a default value from this configuration.

getDefaultBoolean

fun getDefaultBoolean(key: String): Boolean?

Get a default value from this configuration as a boolean.

getDefaultDouble

fun getDefaultDouble(key: String): Double?

Get a default value from this configuration as a double.

getDefaultInteger

fun getDefaultInteger(key: String): Int?

Get a default value from this configuration as a integer.

getDefaultList

fun getDefaultList(key: String): MutableList<Any>?

Get a default value from this configuration as a list.

getDefaultListOfBoolean

fun getDefaultListOfBoolean(key: String): MutableList<Boolean>?

Get a default value from this configuration as a list of booleans.

getDefaultListOfDouble

fun getDefaultListOfDouble(key: String): MutableList<Double>?

Get a default value from this configuration as a list of doubles.

getDefaultListOfInteger

fun getDefaultListOfInteger(key: String): MutableList<Int>?

Get a default value from this configuration as a list of integers.

getDefaultListOfLong

fun getDefaultListOfLong(key: String): MutableList<Long>?

Get a default value from this configuration as a list of longs.

getDefaultListOfMap

fun getDefaultListOfMap(key: String): MutableList<MutableMap<String, Any>>?

Get a default value from this configuration as a list of maps.

getDefaultListOfString

fun getDefaultListOfString(key: String): MutableList<String>?

Get a default value from this configuration as a list of strings.

getDefaultLong

fun getDefaultLong(key: String): Long?

Get a default value from this configuration as a long.

getDefaultMap

fun getDefaultMap(key: String): MutableMap<String, Any>?

Get a default value from this configuration as a map.

getDefaultString

fun getDefaultString(key: String): String?

Get a default value from this configuration as a string.

hasDefault

fun hasDefault(key: String): Boolean

Check if a key has a default provided by this schema.

validate

fun validate(configuration: Configuration): Stream<ConfigurationError>

Validate a configuration against this schema.

The validations are done incrementally as the stream is consumed. Use .limit(...) on the stream to control the maximum number of validation errors to receive.