tuweni / org.apache.tuweni.config / SchemaBuilder

SchemaBuilder

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.

Functions

addBoolean

Add a boolean property to the schema.

fun addBoolean(key: String!, defaultValue: Boolean?, description: String?, validator: PropertyValidator<in Boolean!>?): SchemaBuilder!

addDefault

Provide a default value for a property.

fun addDefault(key: String!, value: Any!): SchemaBuilder!

addDouble

Add a double property to the schema.

fun addDouble(key: String!, defaultValue: Double?, description: String?, validator: PropertyValidator<in Double!>?): SchemaBuilder!

addInteger

Add an integer property to the schema.

fun addInteger(key: String!, defaultValue: Int?, description: String?, validator: PropertyValidator<in Int!>?): SchemaBuilder!

addListOfBoolean

Add a list-of-booleans property to the schema.

fun addListOfBoolean(key: String!, defaultValue: MutableList<Boolean!>?, description: String?, validator: PropertyValidator<in MutableList<Boolean!>!>?): SchemaBuilder!

addListOfDouble

Add a list-of-doubles property to the schema.

fun addListOfDouble(key: String!, defaultValue: MutableList<Double!>?, description: String?, validator: PropertyValidator<in MutableList<Double!>!>?): SchemaBuilder!

addListOfInteger

Add a list-of-integers property to the schema.

fun addListOfInteger(key: String!, defaultValue: MutableList<Int!>?, description: String?, validator: PropertyValidator<in MutableList<Int!>!>?): SchemaBuilder!

addListOfLong

Add a list-of-longs property to the schema.

fun addListOfLong(key: String!, defaultValue: MutableList<Long!>?, description: String?, validator: PropertyValidator<in MutableList<Long!>!>?): SchemaBuilder!

addListOfMap

Add a list-of-maps property to the schema.

fun addListOfMap(key: String!, defaultValue: MutableList<MutableMap<String!, Any!>!>?, description: String?, validator: PropertyValidator<in MutableList<MutableMap<String!, Any!>!>!>?): SchemaBuilder!

addListOfString

Add a list-of-strings property to the schema.

fun addListOfString(key: String!, defaultValue: MutableList<String!>?, description: String?, validator: PropertyValidator<in MutableList<String!>!>?): SchemaBuilder!

addLong

Add a long property to the schema.

fun addLong(key: String!, defaultValue: Long?, description: String?, validator: PropertyValidator<in Long!>?): SchemaBuilder!

addSection

fun addSection(key: String!, section: Schema!): SchemaBuilder!

addString

Add a string property to the schema.

fun addString(key: String!, defaultValue: String?, description: String?, validator: PropertyValidator<in String!>?): SchemaBuilder!

create

Get a new builder for a schema.

static fun create(): SchemaBuilder!

documentProperty

Provide documentation for a property.

fun documentProperty(key: String!, description: String!): SchemaBuilder!

toSchema

Return the Schema constructed by this builder.

fun toSchema(): Schema!

validateConfiguration

Add a configuration validator to the schema.

fun validateConfiguration(validator: ConfigurationValidator!): SchemaBuilder!

validateProperty

Add a property validation to this schema.

fun validateProperty(key: String!, validator: PropertyValidator<Any!>!): SchemaBuilder!