Package-level declarations

Types

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

A rule that tests the array value.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
class BooleanRuleTester(val predicate: Boolean.() -> Boolean, val message: () -> String) : ValidationRule<Boolean>

A rule that tests the boolean value.

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

A rule that tests the collection value.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
class DoubleRuleTester(val predicate: Double.() -> Boolean, val message: () -> String) : ValidationRule<Double>

A rule that tests the double value.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
class FloatRuleTester(val predicate: Float.() -> Boolean, val message: () -> String) : ValidationRule<Float>

A rule that tests the float value.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
class IntRuleTester(val predicate: Int.() -> Boolean, val message: () -> String) : ValidationRule<Int>

A rule that tests the integer value.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
class LongRuleTester(val predicate: Long.() -> Boolean, val message: () -> String) : ValidationRule<Long>

A rule that tests the long value.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
class ObjectRuleChainer<V, S>(val transform: (V) -> S) : ValidationRule<V>

A rule that chains a transformation function with a set of rules.

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

A rule that tests the object value.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
class OptionalRuleChainer<V>(val message: () -> String) : ValidationRule<V?>

A rule that chains non-optional rules. If the value is not null, the rule set is applied to the value.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
class StringRuleTester(val predicate: String.() -> Boolean, val message: () -> String) : ValidationRule<String>

A rule that tests the string value.

Functions

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

Chains a transformation function with a set of rules.

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

Validates that the boolean value is false.

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

Validates that the double value is NaN.

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

Validates that the float value is NaN.

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

Validates that the boolean value is true.

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 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>.test(predicate: V.() -> Boolean, message: () -> String)

Validates that the object value passes the given predicate.