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

commonMain.ru.astrainteractive.klibs.mikro.validation.ValidationContext.kt Maven / Gradle / Ivy

The newest version!
package ru.astrainteractive.klibs.mikro.validation

/**
 * Context of current validation scope
 *
 * [T] - validatable value type
 *
 * [R] - result, which will be returned when validation pass failed
 */
interface ValidationContext {
    /**
     * Validatable value
     */
    val value: T

    /**
     * Remember validation for current value
     */
    fun validate(otherwise: R, validation: Validation): Validation

    /**
     * Remember validation for current value
     */
    fun validate(otherwise: (T) -> R, validation: Validation): Validation

    /**
     * Create list of remembered validators
     */
    fun create(): List>
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy