# Size

Artifact: [androidx.annotation:annotation](https://developer.android.com/jetpack/androidx/releases/annotation) [View Source](https://cs.android.com/search?q=file:androidx/annotation/Size.kt+class:androidx.annotation.Size) 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.VALUE_PARAMETER, AnnotationTarget.LOCAL_VARIABLE, AnnotationTarget.FUNCTION, AnnotationTarget.PROPERTY_GETTER, AnnotationTarget.PROPERTY_SETTER, AnnotationTarget.FIELD, AnnotationTarget.ANNOTATION_CLASS])
  annotation Size
  ```

*** ** * ** ***

Denotes that the annotated element should have a given size or length. Note that "-1" means "unset". Typically used with a parameter or return value of type array or collection.

Example:

```kotlin
public void getLocationInWindow(@Size(2) int[] location) {
    ...
}
```

## Summary

| ### Public constructors |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/annotation/Size#Size(kotlin.Long,kotlin.Long,kotlin.Long,kotlin.Long)(value: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html, min: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html, max: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html, multiple: 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/Size#max()` A maximum size, inclusive | Cmn |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html` | `https://developer.android.com/reference/kotlin/androidx/annotation/Size#min()` A minimum size, inclusive | Cmn |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html` | `https://developer.android.com/reference/kotlin/androidx/annotation/Size#multiple()` The size must be a multiple of this factor | Cmn |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html` | `https://developer.android.com/reference/kotlin/androidx/annotation/Size#value()` An exact size (or -1 if not specified) | Cmn |

## Public constructors

### Size

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

```
Size(
    value: Long = -1,
    min: Long = Long.MIN_VALUE,
    max: Long = Long.MAX_VALUE,
    multiple: Long = 1
)
```

## Public properties

### max

Cmn

```
val max: Long
```

A maximum size, inclusive

### min

Cmn

```
val min: Long
```

A minimum size, inclusive

### multiple

Cmn

```
val multiple: Long
```

The size must be a multiple of this factor

### value

Cmn

```
val value: Long
```

An exact size (or -1 if not specified)