FloatRange

class FloatRange
androidx.annotation.FloatRange

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() { ... } 

Summary

Public constructors
<init>(from: Double, to: Double, fromInclusive: Boolean, toInclusive: Boolean)

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

Properties
Double

Smallest value.

Double

Largest value.

Boolean

Whether the from value is included in the range

Boolean

Whether the to value is included in the range

Public constructors

<init>

FloatRange(from: Double, to: Double, fromInclusive: Boolean, toInclusive: Boolean)

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

from

val from: Double

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

to

val to: Double

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

fromInclusive

val fromInclusive: Boolean

Whether the from value is included in the range

toInclusive

val toInclusive: Boolean

Whether the to value is included in the range