commonMain.neat.PropertyValidators.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of neat-validation-jvm Show documentation
Show all versions of neat-validation-jvm Show documentation
A collection library that is built with interoperability in mind
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)
}
}