Validator

class Validator<T>(val property: KProperty<T>, validate: (T) -> ValidationInfo?)(source)

Associates a property with a method that validates that property.

Parameters

T

the type of property

validate

the method by which the property is validated, which returns null if the property is valid, and returns ValidationInfo otherwise

Constructors

Link copied to clipboard
constructor(property: KProperty<T>, validate: (T) -> ValidationInfo?)

Properties

Link copied to clipboard
val property: KProperty<T>

The property that is validated.

Link copied to clipboard

Partially applied form of validate that automatically reads the value from property.