commonMain.neat.PropertyValidators.kt Maven / Gradle / Ivy
package neat
import neat.internal.OptionalValidator
import kotlin.reflect.KProperty1
class PropertyValidators(
label: String,
val parent: CompoundValidators
,
val nested: CompoundValidators
?,
val property: KProperty1
) : Validators(label) {
// override fun required(
// message: (C) -> String
// ): Validator {
// parent.properties.add(this)
// return RequiredValidator(this as Validators, message) as Validator
// }
override fun optional(): Validator {
parent.properties.add(this)
return OptionalValidator(this)
}
}