Range

@Target(allowedTargets = [AnnotationTarget.FIELD])
annotation class Range(val min: Long = Long.MIN_VALUE, val max: Long = Long.MAX_VALUE)

Specifies a valid numeric range for a field.

When validating the loaded configuration, the field value will be checked to ensure it falls within the defined range (inclusive). If the value is out of range, an error will be raised.

Example:

@Range(min = 1, max = 100)
int threadCount;

Properties

Link copied to clipboard
val max: Long

the maximum allowed value (inclusive)

Link copied to clipboard
val min: Long

the minimum allowed value (inclusive)