# AutoboxingStateValueProperty

Artifact: [androidx.compose.runtime:runtime](https://developer.android.com/jetpack/androidx/releases/compose-runtime) [View Source](https://cs.android.com/search?q=file:androidx/compose/runtime/snapshots/AutoboxingStateValueProperty.kt+class:androidx.compose.runtime.snapshots.AutoboxingStateValueProperty) Added in [1.5.0](https://developer.android.com/jetpack/androidx/releases/compose-runtime#1.5.0) Common/AllAndroid/JVMNative/C/iOSJavaScript
- Cmn

  ```
  @Retention(value = AnnotationRetention.BINARY)
  @Target(allowedTargets = [AnnotationTarget.PROPERTY_SETTER, AnnotationTarget.PROPERTY_GETTER])
  annotation AutoboxingStateValueProperty
  ```

*** ** * ** ***

This annotation designates that a property on a `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-state/index.html` class will autobox when it is read from or assigned to. This is helpful for state APIs like `https://developer.android.com/reference/kotlin/androidx/compose/runtime/IntState`, which define an alternative value property that does not box while maintaining compatibility with the generic `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-state/index.html` API.

Whenever a property that is annotated with `AutoboxingStateValueProperty` is accessed in code, it will be flagged with a warning and will suggest using an alternative, non-boxing property instead.

## Summary

| ### Public constructors |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/compose/runtime/snapshots/AutoboxingStateValueProperty#AutoboxingStateValueProperty(kotlin.String)(preferredPropertyName: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)` | Cmn |

| ### Public properties |
|---|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/runtime/snapshots/AutoboxingStateValueProperty#preferredPropertyName()` An alternative, non-boxing property that can be used instead of the annotated property. | Cmn |

## Public constructors

### AutoboxingStateValueProperty

Cmn Added in [1.9.0](https://developer.android.com/jetpack/androidx/releases/compose-runtime#1.9.0)

```
AutoboxingStateValueProperty(preferredPropertyName: String)
```

## Public properties

### preferredPropertyName

Cmn

```
val preferredPropertyName: String
```

An alternative, non-boxing property that can be used instead of the annotated property. The property indicated in this property should contain the exact same value as the annotated property and should be observed in Compose in the same way, meaning that the designated replacement property can serve as a drop-in replacement to the annotated property.

This property name will be used for suggesting quick fixes. It must match the suggested property name exactly, including its case.