Package-level declarations

Types

Link copied to clipboard

A type alias for validation rules that operate on Array values.

Link copied to clipboard

A type alias for builders that create Array validation rules.

Link copied to clipboard
class ArrayRuleTester<V>(predicate: Array<V>.() -> Boolean, message: () -> String) : Function1<value: Array<V>, ValidationResult>
Link copied to clipboard

A type alias for validation rules that operate on Boolean values.

Link copied to clipboard

A type alias for builders that create Boolean validation rules.

Link copied to clipboard
class BooleanRuleTester(predicate: Boolean.() -> Boolean, message: () -> String) : Function1<value: Boolean, ValidationResult>
Link copied to clipboard

A type alias for validation rules that operate on Collection values.

Link copied to clipboard

A type alias for builders that create Collection validation rules.

Link copied to clipboard
class CollectionRuleTester<V>(predicate: Collection<V>.() -> Boolean, message: () -> String) : Function1<value: Collection<V>, ValidationResult>
Link copied to clipboard

A type alias for validation rules that operate on Double values.

Link copied to clipboard

A type alias for builders that create Double validation rules.

Link copied to clipboard
class DoubleRuleTester(predicate: Double.() -> Boolean, message: () -> String) : Function1<value: Double, ValidationResult>
Link copied to clipboard

A type alias for validation rules that operate on Float values.

Link copied to clipboard

A type alias for builders that create Float validation rules.

Link copied to clipboard
class FloatRuleTester(predicate: Float.() -> Boolean, message: () -> String) : Function1<value: Float, ValidationResult>
Link copied to clipboard

A type alias for validation rules that operate on Int values.

Link copied to clipboard

A type alias for builders that create Int validation rules.

Link copied to clipboard
class IntRuleTester(predicate: Int.() -> Boolean, message: () -> String) : Function1<value: Int, ValidationResult>
Link copied to clipboard

A type alias for validation rules that operate on Long values.

Link copied to clipboard

A type alias for builders that create Long validation rules.

Link copied to clipboard
class LongRuleTester(predicate: Long.() -> Boolean, message: () -> String) : Function1<value: Long, ValidationResult>
Link copied to clipboard

A type alias for validation rules that operate on any object type.

Link copied to clipboard

A type alias for builders that create object validation rules.

Link copied to clipboard
class ObjectRuleTester<V>(predicate: V.() -> Boolean, message: () -> String) : Function1<value: V, ValidationResult>
Link copied to clipboard

A type alias for validation rules that operate on optional (nullable) values.

Link copied to clipboard

A type alias for builders that create optional validation rules.

Link copied to clipboard

A type alias for validation rules that operate on String values.

Link copied to clipboard

A type alias for builders that create String validation rules.

Link copied to clipboard
class StringRuleTester(predicate: String.() -> Boolean, message: () -> String) : Function1<value: String, ValidationResult>

Functions

Link copied to clipboard
fun <V> ArrayRule(predicate: Array<V>.() -> Boolean, message: () -> String): ArrayRule<V>

A rule that tests the array value.

Link copied to clipboard
fun BooleanRule(predicate: Boolean.() -> Boolean, message: () -> String): BooleanRule

A rule that tests the boolean value.

Link copied to clipboard
fun <V : Any, S> ObjectRuleBuilder<V>.cast(transform: (V) -> S): ValidationRuleChainer<S>

Creates a transformation-based validation rule chain.

Link copied to clipboard
fun <V> CollectionRule(predicate: Collection<V>.() -> Boolean, message: () -> String): CollectionRule<V>

A rule that tests the collection value.

Link copied to clipboard
fun DoubleRule(predicate: Double.() -> Boolean, message: () -> String): DoubleRule

A rule that tests the double value.

Link copied to clipboard

Creates a validation rule chain for applying rules to each element of the array.

Creates a validation rule chain for applying rules to each element of the collection.

Link copied to clipboard
fun <V : Any> ObjectRuleBuilder<V>.equalTo(expected: () -> V, message: () -> String)

Validates that the object value is equal to the expected value.

Link copied to clipboard
fun BooleanRuleBuilder.falsy(message: () -> String)

Validates that the boolean value is false.

Link copied to clipboard
fun FloatRule(predicate: Float.() -> Boolean, message: () -> String): FloatRule

A rule that tests the float value.

Link copied to clipboard
fun IntRule(predicate: Int.() -> Boolean, message: () -> String): IntRule

A rule that tests the integer value.

Link copied to clipboard
fun BooleanRuleBuilder.isFalse(message: () -> String)

Validates that the boolean value is false.

Link copied to clipboard
fun BooleanRuleBuilder.isTrue(message: () -> String)

Validates that the boolean value is true.

Link copied to clipboard
fun LongRule(predicate: Long.() -> Boolean, message: () -> String): LongRule

A rule that tests the long value.

Link copied to clipboard
fun StringRuleBuilder.match(pattern: String, message: () -> String)
fun StringRuleBuilder.match(pattern: Regex, message: () -> String)

Validates that the string matches the pattern.

Link copied to clipboard
fun DoubleRuleBuilder.maximum(limit: Double, message: () -> String)

Validates that the double value is less than or equal to limit.

fun FloatRuleBuilder.maximum(limit: Float, message: () -> String)

Validates that the float value is less than or equal to limit.

fun IntRuleBuilder.maximum(limit: Int, message: () -> String)

Validates that the integer value is less than or equal to limit.

fun LongRuleBuilder.maximum(limit: Long, message: () -> String)

Validates that the long value is less than or equal to limit.

Link copied to clipboard
fun StringRuleBuilder.maxLength(limit: Int, message: () -> String)

Validates that the string length is no more than limit characters.

Link copied to clipboard
fun <V> ArrayRuleBuilder<V>.maxSize(limit: Int, message: () -> String)

Validates that the array size is no more than limit.

fun <V> CollectionRuleBuilder<V>.maxSize(limit: Int, message: () -> String)

Validates that the collection size is no more than limit.

Link copied to clipboard
fun DoubleRuleBuilder.minimum(limit: Double, message: () -> String)

Validates that the double value is greater than or equal to limit.

fun FloatRuleBuilder.minimum(limit: Float, message: () -> String)

Validates that the float value is greater than or equal to limit.

fun IntRuleBuilder.minimum(limit: Int, message: () -> String)

Validates that the integer value is greater than or equal to limit.

fun LongRuleBuilder.minimum(limit: Long, message: () -> String)

Validates that the long value is greater than or equal to limit.

Link copied to clipboard
fun StringRuleBuilder.minLength(limit: Int, message: () -> String)

Validates that the string length is at least limit characters.

Link copied to clipboard
fun <V> ArrayRuleBuilder<V>.minSize(limit: Int, message: () -> String)

Validates that the array size is at least limit.

fun <V> CollectionRuleBuilder<V>.minSize(limit: Int, message: () -> String)

Validates that the collection size is at least limit.

Link copied to clipboard
fun StringRuleBuilder.notBlank(message: () -> String)

Validates that the string value is not blank.

Link copied to clipboard
fun <V> ArrayRuleBuilder<V>.notEmpty(message: () -> String)

Validates that the array is not empty.

fun StringRuleBuilder.notEmpty(message: () -> String)

Validates that the string value is not empty.

fun <V> CollectionRuleBuilder<V>.notEmpty(message: () -> String)

Validates that the collection is not empty.

Link copied to clipboard
fun DoubleRuleBuilder.notNaN(message: () -> String)

Validates that the double value is not NaN.

fun FloatRuleBuilder.notNaN(message: () -> String)

Validates that the float value is not NaN.

Link copied to clipboard

Validates that the optional value is not null.

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

A rule that tests the object value.

Link copied to clipboard
fun StringRuleBuilder.pattern(pattern: String, message: () -> String)
fun StringRuleBuilder.pattern(pattern: Regex, message: () -> String)

Validates that the string matches the pattern.

Link copied to clipboard
fun <V : Any> ObjectRuleBuilder<V>.satisfy(predicate: V.() -> Boolean, message: () -> String)

Validates that the object value passes the given predicate.

Link copied to clipboard
fun StringRule(predicate: String.() -> Boolean, message: () -> String): StringRule

A rule that tests the string value.

Link copied to clipboard
fun <V : Any> ObjectRuleBuilder<V>.test(predicate: V.() -> Boolean, message: () -> String)

Validates that the object value passes the given predicate.

Link copied to clipboard
fun BooleanRuleBuilder.truthy(message: () -> String)

Validates that the boolean value is true.