# PinSignInMethod

Artifact: [androidx.car.app:app](https://developer.android.com/jetpack/androidx/releases/car-app) [View Source](https://cs.android.com/search?q=file:androidx/car/app/model/signin/PinSignInMethod.java+class:androidx.car.app.model.signin.PinSignInMethod) Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/car-app#1.0.0)

*** ** * ** ***


```
@RequiresCarApi(value = 2)
@CarProtocol
public final class PinSignInMethod implements SignInTemplate.SignInMethod
```

<br />

*** ** * ** ***

A `https://developer.android.com/reference/androidx/car/app/model/signin/SignInTemplate.SignInMethod` that presents a PIN or activation code that the user can use to sign-in.

## Summary

| ### Public constructors |
|---|
| `https://developer.android.com/reference/androidx/car/app/model/signin/PinSignInMethod#PinSignInMethod(java.lang.CharSequence)(@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/lang/CharSequence.html pinCode)` Returns a `https://developer.android.com/reference/androidx/car/app/model/signin/PinSignInMethod` instance. |

| ### Public methods |
|---|---|
| `boolean` | `https://developer.android.com/reference/androidx/car/app/model/signin/PinSignInMethod#equals(java.lang.Object)(https://developer.android.com/reference/java/lang/Object.html other)` |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/car/app/model/CarText` | `https://developer.android.com/reference/androidx/car/app/model/signin/PinSignInMethod#getPinCode()()` Returns the PIN or activation code to present to the user. |
| `int` | `https://developer.android.com/reference/androidx/car/app/model/signin/PinSignInMethod#hashCode()()` |

## Public constructors

### PinSignInMethod

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/car-app#1.1.0)

```
public PinSignInMethod(@NonNull CharSequence pinCode)
```

Returns a `https://developer.android.com/reference/androidx/car/app/model/signin/PinSignInMethod` instance.

#### Requirements

The provided pin must be no more than 12 characters long. To facilitate typing this code, it is recommended restricting the string to a limited set (for example, numbers, upper-case letters, hexadecimal, etc.).

Spans are not supported in the pin and will be ignored.

| Parameters |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/lang/CharSequence.html pinCode` | the PIN to display is empty. |

| Throws |
|---|---|
| `https://developer.android.com/reference/java/lang/IllegalArgumentException.html` | if `pin` is empty or longer than 12 characters. |
| `https://developer.android.com/reference/java/lang/NullPointerException.html` | if `pin` is `null` |

## Public methods

### equals

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

### getPinCode

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/car-app#1.1.0)

```
public @NonNull CarText getPinCode()
```

Returns the PIN or activation code to present to the user.

### hashCode

```
public int hashCode()
```