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

*** ** * ** ***


```
public final class SelectedCredential
```

<br />

*** ** * ** ***

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

## Summary

| ### Public constructors |
|---|
| `https://developer.android.com/reference/androidx/credentials/registry/provider/SelectedCredential#SelectedCredential(kotlin.String,kotlin.String)(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html credentialId, https://developer.android.com/reference/java/lang/String.html metadata)` |

| ### Public methods |
|---|---|
| `boolean` | `https://developer.android.com/reference/androidx/credentials/registry/provider/SelectedCredential#equals(kotlin.Any)(https://developer.android.com/reference/java/lang/Object.html other)` |
| `final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/credentials/registry/provider/SelectedCredential#getCredentialId()()` the id of the selected credential. |
| `final https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/credentials/registry/provider/SelectedCredential#getMetadata()()` optional metadata associated with the selected credential; this can be generated by the provider matcher (see `https://developer.android.com/reference/androidx/credentials/registry/provider/RegisterCredentialsRequest#matcher()`) |
| `int` | `https://developer.android.com/reference/androidx/credentials/registry/provider/SelectedCredential#hashCode()()` |

## Public constructors

### SelectedCredential

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

```
public SelectedCredential(@NonNull String credentialId, String metadata)
```

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html credentialId` | 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/androidx/credentials/registry/provider/digitalcredentials/DigitalCredentialEntry#id()` |
| `https://developer.android.com/reference/java/lang/String.html metadata` | optional metadata associated with the selected credential; this can be generated by the provider matcher (see `https://developer.android.com/reference/androidx/credentials/registry/provider/RegisterCredentialsRequest#matcher()`) |

## Public methods

### equals

```
public boolean equals(Object other)
```

### getCredentialId

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

```
public final @NonNull String getCredentialId()
```

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/androidx/credentials/registry/provider/digitalcredentials/DigitalCredentialEntry#id()`

### getMetadata

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

```
public final String getMetadata()
```

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

### hashCode

```
public int hashCode()
```