Range

annotation class Range(val min: Long = Long.MIN_VALUE, val max: Long = Long.MAX_VALUE)

Validates that a numeric field is within the given inclusive range.

The annotation applies to Byte, Short, Int, Long, Float, and Double values.

Example:

data class MyConfig(
@Range(min = 1, max = 65535) val port: Int = 8080
)

Properties

Link copied to clipboard
val max: Long
Link copied to clipboard
val min: Long