tuweni / org.apache.tuweni.config / SchemaBuilder / addInteger

addInteger

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

Add an integer property to the schema.

Even if no validator is provided, the schema will validate that the configuration property, if present, contains an integer.

If a defaultValue is provided, then the provided validator, if any, will only be invoked if the value is present (i.e. it will not be provided a null value to validate).

Parameters

key - String!: The configuration property key.

defaultValue - Int?: A default value for the property or null if no default is provided.

description - String?: The description to associate with this property, or null if no documentation is provided.

validator - PropertyValidator<in Int!>?: A validator for the property, or null if no validator is provided.

Exceptions

IllegalArgumentException - If the key cannot be parsed.

Return
SchemaBuilder!: This builder.