# WidgetInstanceId

Artifact: [androidx.glance.wear:wear-core](https://developer.android.com/jetpack/androidx/releases/glance-wear) [View Source](https://cs.android.com/search?q=file:androidx/glance/wear/core/WidgetInstanceId.kt+class:androidx.glance.wear.core.WidgetInstanceId) Added in [1.0.0-alpha22](https://developer.android.com/jetpack/androidx/releases/glance-wear#1.0.0-alpha22)


```
class WidgetInstanceId
```

<br />

*** ** * ** ***

An identifier for a widget instance.

This is an id that is created by the system and passed to the widget provider. The id is unique for each widget instance and is persistent across device reboots.

## Summary

| ### Public constructors |
|---|
| `https://developer.android.com/reference/kotlin/androidx/glance/wear/core/WidgetInstanceId#WidgetInstanceId(kotlin.String,kotlin.Int)(namespace: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html, id: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` |

| ### Public functions |
|---|---|
| `open operator https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/glance/wear/core/WidgetInstanceId#equals(kotlin.Any)(other: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html?)` |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` | `https://developer.android.com/reference/kotlin/androidx/glance/wear/core/WidgetInstanceId#flattenToString()()` Returns a string representation of the id that can be used for logging and debugging. |
| `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/glance/wear/core/WidgetInstanceId#hashCode()()` |
| `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` | `https://developer.android.com/reference/kotlin/androidx/glance/wear/core/WidgetInstanceId#toString()()` |

| ### Public properties |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/glance/wear/core/WidgetInstanceId#id()` The integer id of this instance |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` | `https://developer.android.com/reference/kotlin/androidx/glance/wear/core/WidgetInstanceId#namespace()` The namespace indicating the Host where the id is generated |

## Public constructors

### WidgetInstanceId

Added in [1.0.0-alpha22](https://developer.android.com/jetpack/androidx/releases/glance-wear#1.0.0-alpha22)

```
WidgetInstanceId(namespace: String, id: Int)
```

## Public functions

### equals

```
open operator fun equals(other: Any?): Boolean
```

### flattenToString

Added in [1.0.0-alpha22](https://developer.android.com/jetpack/androidx/releases/glance-wear#1.0.0-alpha22)

```
fun flattenToString(): String
```

Returns a string representation of the id that can be used for logging and debugging.

### hashCode

```
open fun hashCode(): Int
```

### toString

```
open fun toString(): String
```

## Public properties

### id

Added in [1.0.0-alpha22](https://developer.android.com/jetpack/androidx/releases/glance-wear#1.0.0-alpha22)

```
val id: Int
```

The integer id of this instance

### namespace

Added in [1.0.0-alpha22](https://developer.android.com/jetpack/androidx/releases/glance-wear#1.0.0-alpha22)

```
val namespace: String
```

The namespace indicating the Host where the id is generated