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

io.javalin.validation.NullableValidator.kt Maven / Gradle / Ivy

There is a newer version: 6.3.0
Show newest version
/*
 * Javalin - https://javalin.io
 * Copyright 2017 David Åse
 * Licensed under Apache 2.0: https://github.com/tipsy/javalin/blob/master/LICENSE
 */

package io.javalin.validation

/**
 * The NullableValidator is a [Validator] that allows null values, created by calling [Validator.allowNullable].
 */
open class NullableValidator internal constructor(params: Params) : BaseValidator(params) {
    fun check(check: Check, error: String) = addRule(params.fieldName, check, error) as NullableValidator
    fun check(check: Check, error: ValidationError) = addRule(params.fieldName, check, error) as NullableValidator
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy