FloatRange

annotation class FloatRange(val from: Double = Double.NEGATIVE_INFINITY, val to: Double = Double.POSITIVE_INFINITY, val fromInclusive: Boolean = true, val toInclusive: Boolean = true)

Denotes that the annotated element should be a float or double in the given range

Example:

@FloatRange(from=0.0,to=1.0)
public float getAlpha() {
...
}

Properties

Link copied to clipboard

Smallest value. Whether it is inclusive or not is determined by .fromInclusive

Link copied to clipboard

Whether the from value is included in the range

Link copied to clipboard
val to: Double

Largest value. Whether it is inclusive or not is determined by .toInclusive

Link copied to clipboard
val toInclusive: Boolean = true

Whether the to value is included in the range