# SelectedCredential

Artifact: [androidx.credentials.registry:registry-provider](https://developer.android.com/jetpack/androidx/releases/credentials-registry) [View Source](https://cs.android.com/search?q=file:androidx/credentials/registry/provider/ProviderGetCredentialRequest.kt+class:androidx.credentials.registry.provider.SelectedCredential) Added in [1.0.0-alpha05](https://developer.android.com/jetpack/androidx/releases/credentials-registry#1.0.0-alpha05)

*** ** * ** ***


```
class SelectedCredential
```

<br />

*** ** * ** ***

A credential selected within a `https://developer.android.com/reference/kotlin/androidx/credentials/registry/provider/SelectedCredentialSet`.

## Summary

| ### Public constructors |
|---|
| `https://developer.android.com/reference/kotlin/androidx/credentials/registry/provider/SelectedCredential#SelectedCredential(kotlin.String,kotlin.String)(credentialId: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html, metadata: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html?)` |

| ### Public functions |
|---|---|
| `open operator https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/credentials/registry/provider/SelectedCredential#equals(kotlin.Any)(other: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html?)` |
| `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/credentials/registry/provider/SelectedCredential#hashCode()()` |

| ### Public properties |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` | `https://developer.android.com/reference/kotlin/androidx/credentials/registry/provider/SelectedCredential#credentialId()` the id of the selected credential. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html?` | `https://developer.android.com/reference/kotlin/androidx/credentials/registry/provider/SelectedCredential#metadata()` optional metadata associated with the selected credential; this can be generated by the provider matcher (see `https://developer.android.com/reference/kotlin/androidx/credentials/registry/provider/RegisterCredentialsRequest#matcher()`) |

## Public constructors

### SelectedCredential

Added in [1.0.0-alpha05](https://developer.android.com/jetpack/androidx/releases/credentials-registry#1.0.0-alpha05)

```
SelectedCredential(credentialId: String, metadata: String?)
```

| Parameters |
|---|---|
| `credentialId: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` | the id of the selected credential. For example for a digital credential entry, this maps to the corresponding entry's `https://developer.android.com/reference/kotlin/androidx/credentials/registry/provider/digitalcredentials/DigitalCredentialEntry#id()` |
| `metadata: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html?` | optional metadata associated with the selected credential; this can be generated by the provider matcher (see `https://developer.android.com/reference/kotlin/androidx/credentials/registry/provider/RegisterCredentialsRequest#matcher()`) |

## Public functions

### equals

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

### hashCode

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

## Public properties

### credentialId

Added in [1.0.0-alpha05](https://developer.android.com/jetpack/androidx/releases/credentials-registry#1.0.0-alpha05)

```
val credentialId: String
```

the id of the selected credential. For example for a digital credential entry, this maps to the corresponding entry's `https://developer.android.com/reference/kotlin/androidx/credentials/registry/provider/digitalcredentials/DigitalCredentialEntry#id()`

### metadata

Added in [1.0.0-alpha05](https://developer.android.com/jetpack/androidx/releases/credentials-registry#1.0.0-alpha05)

```
val metadata: String?
```

optional metadata associated with the selected credential; this can be generated by the provider matcher (see `https://developer.android.com/reference/kotlin/androidx/credentials/registry/provider/RegisterCredentialsRequest#matcher()`)