# IntRange

Artifact: [androidx.annotation:annotation](https://developer.android.com/jetpack/androidx/releases/annotation) [View Source](https://cs.android.com/search?q=file:androidx/annotation/IntRange.kt+class:androidx.annotation.IntRange) Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/annotation#1.0.0)

*** ** * ** ***

Common/AllAndroid/JVM
- Cmn

  ```
  @MustBeDocumented
  @Retention(value = AnnotationRetention.BINARY)
  @Target(allowedTargets = [AnnotationTarget.FUNCTION, AnnotationTarget.PROPERTY_GETTER, AnnotationTarget.PROPERTY_SETTER, AnnotationTarget.VALUE_PARAMETER, AnnotationTarget.FIELD, AnnotationTarget.LOCAL_VARIABLE, AnnotationTarget.ANNOTATION_CLASS])
  annotation IntRange
  ```

*** ** * ** ***

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

Example:

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

## Summary

| ### Public constructors |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/annotation/IntRange#IntRange(kotlin.Long,kotlin.Long)(from: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html, to: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)` | Cmn |

| ### Public properties |
|---|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html` | `https://developer.android.com/reference/kotlin/androidx/annotation/IntRange#from()` Smallest value, inclusive | Cmn |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html` | `https://developer.android.com/reference/kotlin/androidx/annotation/IntRange#to()` Largest value, inclusive | Cmn |

## Public constructors

### IntRange

Cmn Added in [1.10.0](https://developer.android.com/jetpack/androidx/releases/annotation#1.10.0)

```
IntRange(from: Long = Long.MIN_VALUE, to: Long = Long.MAX_VALUE)
```

## Public properties

### from

Cmn

```
val from: Long
```

Smallest value, inclusive

### to

Cmn

```
val to: Long
```

Largest value, inclusive