ObjectRuleTester

class ObjectRuleTester<V>(val predicate: V.() -> Boolean, val message: () -> String) : ValidationRule<V>

A rule that tests the object value.

Constructors

Link copied to clipboard
constructor(predicate: V.() -> Boolean, message: () -> String)

Creates a new instance of ObjectRuleTester.

Properties

Link copied to clipboard
val message: () -> String

The message to return when the test fails.

Link copied to clipboard
val predicate: V.() -> Boolean

The predicate to test the object value. Returns true if the test passes; false otherwise.

Functions

Link copied to clipboard
open override fun test(value: V): FieldErrors

Tests the given value against this rule.