commonMain.io.konform.validation.Validation.kt Maven / Gradle / Ivy
package io.konform.validation
import io.konform.validation.internal.ValidationBuilderImpl
interface Validation {
companion object {
operator fun invoke(init: ValidationBuilder.() -> Unit): Validation {
val builder = ValidationBuilderImpl()
return builder.apply(init).build()
}
}
fun validate(value: T): ValidationResult
operator fun invoke(value: T) = validate(value)
}
class Constraint internal constructor(val hint: String, val templateValues: List, val test: (R) -> Boolean)