Save the date! Android Dev Summit is coming to Sunnyvale, CA on Oct 23-24, 2019.

IntRange

@Target([AnnotationTarget.FUNCTION, AnnotationTarget.PROPERTY_GETTER, AnnotationTarget.PROPERTY_SETTER, AnnotationTarget.VALUE_PARAMETER, AnnotationTarget.FIELD, AnnotationTarget.LOCAL_VARIABLE, AnnotationTarget.ANNOTATION_CLASS]) class IntRange
androidx.annotation.IntRange

Denotes that the annotated element should be an int or long in the given range

Example:

 @IntRange(from=0,to=255) public int getAlpha() { ... } 

Summary

Public constructors
<init>(from: Long, to: Long)

Denotes that the annotated element should be an int or long in the given range

Properties
Long

Smallest value, inclusive

Long

Largest value, inclusive

Public constructors

<init>

IntRange(from: Long, to: Long)

Denotes that the annotated element should be an int or long in the given range

Example:

 @IntRange(from=0,to=255) public int getAlpha() { ... } 

Properties

from

val from: Long

Smallest value, inclusive

to

val to: Long

Largest value, inclusive