# SelectedCredentialSet

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.SelectedCredentialSet) Added in [1.0.0-alpha05](https://developer.android.com/jetpack/androidx/releases/credentials-registry#1.0.0-alpha05)

*** ** * ** ***


```
public final class SelectedCredentialSet
```

<br />

*** ** * ** ***

Contains information about the user selection result on the Credential Manager UI.

During the `https://developer.android.com/reference/androidx/credentials/CredentialManager#getCredential(android.content.Context,androidx.credentials.GetCredentialRequest)` invocation, the user will be presented a Credential Manager selector \& permission UI that displays the available credentials to choose from. The selector may display credential options in two dimensions. First, it may display a set of options; then each credential set can contain a list of credentials that must be all returned at once.

For example, the user could be presented options of `{ {cred1, cred2, cred3}, {cred1, cred4}, {cred5} }` and may choose to use the {cred1, cred4} credential set. In that case, the selected provider will be invoked and be given a `https://developer.android.com/reference/androidx/credentials/registry/provider/SelectedCredentialSet` containing the corresponding `setId` and `credentialId`s for each individual credential in the set.

| Throws |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-illegal-argument-exception/index.html` | if `credentials` is empty |

## Summary

| ### Public constructors |
|---|
| `https://developer.android.com/reference/androidx/credentials/registry/provider/SelectedCredentialSet#SelectedCredentialSet(kotlin.String,kotlin.collections.List)( @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html credentialSetId, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/util/List.html<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/credentials/registry/provider/SelectedCredential> credentials )` |

| ### Public methods |
|---|---|
| `boolean` | `https://developer.android.com/reference/androidx/credentials/registry/provider/SelectedCredentialSet#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/SelectedCredentialSet#getCredentialSetId()()` the id of the selected credential set; the `credentialSetId` is generated by the provider's matcher (see `https://developer.android.com/reference/androidx/credentials/registry/provider/RegisterCredentialsRequest#matcher()`) and therefore its format is specific to the matcher |
| `final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/util/List.html<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/credentials/registry/provider/SelectedCredential>` | `https://developer.android.com/reference/androidx/credentials/registry/provider/SelectedCredentialSet#getCredentials()()` the non-empty list of credentials in this selected credential set; the provider must return all credentials to the caller |
| `int` | `https://developer.android.com/reference/androidx/credentials/registry/provider/SelectedCredentialSet#hashCode()()` |

## Public constructors

### SelectedCredentialSet

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

```
public SelectedCredentialSet(
    @NonNull String credentialSetId,
    @NonNull List<@NonNull SelectedCredential> credentials
)
```

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html credentialSetId` | the id of the selected credential set; the `credentialSetId` is generated by the provider's matcher (see `https://developer.android.com/reference/androidx/credentials/registry/provider/RegisterCredentialsRequest#matcher()`) and therefore its format is specific to the matcher |
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/util/List.html<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/credentials/registry/provider/SelectedCredential> credentials` | the non-empty list of credentials in this selected credential set; the provider must return all credentials to the caller |

## Public methods

### equals

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

### getCredentialSetId

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

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

the id of the selected credential set; the `credentialSetId` is generated by the provider's matcher (see `https://developer.android.com/reference/androidx/credentials/registry/provider/RegisterCredentialsRequest#matcher()`) and therefore its format is specific to the matcher

### getCredentials

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

```
public final @NonNull List<@NonNull SelectedCredential> getCredentials()
```

the non-empty list of credentials in this selected credential set; the provider must return all credentials to the caller

### hashCode

```
public int hashCode()
```