OfDsl

inner class OfDsl<T>(val property: KProperty<T>)(source)

A domain-specific language (DSL) for creating Validators for a specific property.

Parameters

T

the type of property

property

the property for which this DSL should create Validators

See also

to construct this DSL

Constructors

Link copied to clipboard
constructor(property: KProperty<T>)

Properties

Link copied to clipboard
private val property: KProperty<T>

Functions

Link copied to clipboard

Adds a Validator to the outer ValidatorDsl that checks property's value with validate.

fun check(isValid: ValidatorDsl.OfDsl<T>.(T) -> Boolean, message: ValidatorDsl.OfDsl<T>.(T) -> String): ValidatorDsl.OfDsl<T>

Adds a Validator to the outer ValidatorDsl that checks the property's value with isValid.

Link copied to clipboard

Adds a Validator to the outer ValidatorDsl that checks that no Exception is thrown inside validate.

Link copied to clipboard
fun info(message: String?): ValidationInfo?

Constructs ValidationInfo from the given message using parameters inferred from the DSL context.