All Downloads are FREE. Search and download functionalities are using the official Maven repository.

commonMain.io.konform.validation.Validation.kt Maven / Gradle / Ivy

There is a newer version: 0.10.0
Show newest version
package io.konform.validation

import io.konform.validation.internal.ValidationBuilderImpl

public interface Validation {
    public companion object {
        public operator fun  invoke(init: ValidationBuilder.() -> Unit): Validation {
            val builder = ValidationBuilderImpl()
            return builder.apply(init).build()
        }
    }

    public fun validate(value: T): ValidationResult

    public operator fun invoke(value: T): ValidationResult = validate(value)
}

public class Constraint internal constructor(
    public val hint: String,
    public val templateValues: List,
    public val test: (R) -> Boolean,
)




© 2015 - 2024 Weber Informatics LLC | Privacy Policy