# 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)

*** ** * ** ***


```
@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])
public annotation IntRange
```

<br />

*** ** * ** ***

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 methods |
|---|---|
| `final long` | `https://developer.android.com/reference/androidx/annotation/IntRange#getFrom()()` Smallest value, inclusive |
| `final long` | `https://developer.android.com/reference/androidx/annotation/IntRange#getTo()()` Largest value, inclusive |

## Public methods

### getFrom

```
public final long getFrom()
```

Smallest value, inclusive

### getTo

```
public final long getTo()
```

Largest value, inclusive