class SchemaBuilder
(source)
This interface allows customers to determine a schema to associate with a configuration to validate the entries read from configuration files, and provide default values if no value is present in the configuration file.
fun addBoolean(key: String, defaultValue: Boolean?, description: String?, validator: PropertyValidator<in Boolean>?): SchemaBuilder
Add a boolean property to the schema. Even if no If a |
|
fun addDefault(key: String, value: Any): SchemaBuilder
Provide a default value for a property. Invoking this method with the same key as a previous invocation will replace the default value for that key. |
|
fun addDouble(key: String, defaultValue: Double?, description: String?, validator: PropertyValidator<in Double>?): SchemaBuilder
Add a double property to the schema. Even if no If a |
|
fun addInteger(key: String, defaultValue: Int?, description: String?, validator: PropertyValidator<in Int>?): SchemaBuilder
Add an integer property to the schema. Even if no If a |
|
fun addListOfBoolean(key: String, defaultValue: MutableList<Boolean>?, description: String?, validator: PropertyValidator<in MutableList<Boolean>>?): SchemaBuilder
Add a list-of-booleans property to the schema. Even if no If a |
|
fun addListOfDouble(key: String, defaultValue: MutableList<Double>?, description: String?, validator: PropertyValidator<in MutableList<Double>>?): SchemaBuilder
Add a list-of-doubles property to the schema. Even if no If a |
|
fun addListOfInteger(key: String, defaultValue: MutableList<Int>?, description: String?, validator: PropertyValidator<in MutableList<Int>>?): SchemaBuilder
Add a list-of-integers property to the schema. Even if no If a |
|
fun addListOfLong(key: String, defaultValue: MutableList<Long>?, description: String?, validator: PropertyValidator<in MutableList<Long>>?): SchemaBuilder
Add a list-of-longs property to the schema. Even if no If a |
|
fun addListOfMap(key: String, defaultValue: MutableList<MutableMap<String, Any>>?, description: String?, validator: PropertyValidator<in MutableList<MutableMap<String, Any>>>?): SchemaBuilder
Add a list-of-maps property to the schema. Even if no If a |
|
fun addListOfString(key: String, defaultValue: MutableList<String>?, description: String?, validator: PropertyValidator<in MutableList<String>>?): SchemaBuilder
Add a list-of-strings property to the schema. Even if no If a |
|
fun addLong(key: String, defaultValue: Long?, description: String?, validator: PropertyValidator<in Long>?): SchemaBuilder
Add a long property to the schema. Even if no If a |
|
fun addString(key: String, defaultValue: String?, description: String?, validator: PropertyValidator<in String>?): SchemaBuilder
Add a string property to the schema. Even if no If a |
|
static fun create(): SchemaBuilder
Get a new builder for a schema. |
|
fun documentProperty(key: String, description: String): SchemaBuilder
Provide documentation for a property. Invoking this method with the same key as a previous invocation will replace the description for that key. |
|
fun toSchema(): Schema
Return the Schema constructed by this builder. |
|
fun validateConfiguration(validator: ConfigurationValidator): SchemaBuilder
Add a configuration validator to the schema. Multiple validators can be provided by invoking this method multiple times. |
|
fun validateProperty(key: String, validator: PropertyValidator<Any>): SchemaBuilder
Add a property validation to this schema. Multiple validators can be provided for the same key by invoking this method multiple times. |