maximum

fun DoubleRuleBuilder.maximum(limit: Double, message: () -> String)

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

Usage:

rules<Double> {
maximum(20.0) { "must be less than or equal to 20.0" }
}

Parameters

limit

The maximum value the double can have.

message

The message to return when the test fails.


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

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

Usage:

rules<Float> {
maximum(20.0f) { "must be less than or equal to 20.0" }
}

Parameters

limit

The maximum value the float can have.

message

The message to return when the test fails.


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

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

Usage:

rules<Int> {
maximum(20) { "must be less than or equal to 20" }
}

Parameters

limit

The maximum value the integer can have.

message

The message to return when the test fails.


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

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

rules { maximum(20) { "must be less than or equal to 20" } }

Parameters

limit

The maximum value the long can have.

message

The message to return when the test fails.