Added in [API level 19](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels) Summary: [Ctors](https://developer.android.com/reference/android/print/PrinterInfo.Builder#pubctors) \| [Methods](https://developer.android.com/reference/android/print/PrinterInfo.Builder#pubmethods) \| [Inherited Methods](https://developer.android.com/reference/android/print/PrinterInfo.Builder#inhmethods)

# PrinterInfo.Builder

*** ** * ** ***

[Kotlin](https://developer.android.com/reference/kotlin/android/print/PrinterInfo.Builder "View this page in Kotlin") \|Java


`
public
static
final

class
PrinterInfo.Builder
`


`

extends https://developer.android.com/reference/java/lang/Object


`

`


`

|---|---|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object) ||
| ↳ | android.print.PrinterInfo.Builder |

<br />

*** ** * ** ***

Builder for creating of a `https://developer.android.com/reference/android/print/PrinterInfo`.

## Summary

| ### Public constructors ||
|---|---|
| ` https://developer.android.com/reference/android/print/PrinterInfo.Builder#Builder(android.print.PrinterId,%20java.lang.String,%20int)(https://developer.android.com/reference/android/print/PrinterId printerId, https://developer.android.com/reference/java/lang/String name, int status) ` Constructor. |
| ` https://developer.android.com/reference/android/print/PrinterInfo.Builder#Builder(android.print.PrinterInfo)(https://developer.android.com/reference/android/print/PrinterInfo other) ` Constructor. |

| ### Public methods ||
|---|---|
| ` https://developer.android.com/reference/android/print/PrinterInfo` | ` https://developer.android.com/reference/android/print/PrinterInfo.Builder#build()() ` Creates a new `https://developer.android.com/reference/android/print/PrinterInfo`. |
| ` https://developer.android.com/reference/android/print/PrinterInfo.Builder` | ` https://developer.android.com/reference/android/print/PrinterInfo.Builder#setCapabilities(android.print.PrinterCapabilitiesInfo)(https://developer.android.com/reference/android/print/PrinterCapabilitiesInfo capabilities) ` Sets the printer capabilities. |
| ` https://developer.android.com/reference/android/print/PrinterInfo.Builder` | ` https://developer.android.com/reference/android/print/PrinterInfo.Builder#setDescription(java.lang.String)(https://developer.android.com/reference/java/lang/String description) ` Sets the **localized** printer description which is shown to the user |
| ` https://developer.android.com/reference/android/print/PrinterInfo.Builder` | ` https://developer.android.com/reference/android/print/PrinterInfo.Builder#setHasCustomPrinterIcon(boolean)(boolean hasCustomPrinterIcon) ` Declares that the print service can load a custom per printer's icon. |
| ` https://developer.android.com/reference/android/print/PrinterInfo.Builder` | ` https://developer.android.com/reference/android/print/PrinterInfo.Builder#setIconResourceId(int)(int iconResourceId) ` Set a drawable resource as icon for this printer. |
| ` https://developer.android.com/reference/android/print/PrinterInfo.Builder` | ` https://developer.android.com/reference/android/print/PrinterInfo.Builder#setInfoIntent(android.app.PendingIntent)(https://developer.android.com/reference/android/app/PendingIntent infoIntent) ` Sets the `https://developer.android.com/reference/android/app/PendingIntent` that launches an activity showing more information about the printer. |
| ` https://developer.android.com/reference/android/print/PrinterInfo.Builder` | ` https://developer.android.com/reference/android/print/PrinterInfo.Builder#setName(java.lang.String)(https://developer.android.com/reference/java/lang/String name) ` Sets the **localized** printer name which is shown to the user |
| ` https://developer.android.com/reference/android/print/PrinterInfo.Builder` | ` https://developer.android.com/reference/android/print/PrinterInfo.Builder#setStatus(int)(int status) ` Sets the printer status. |

| ### Inherited methods |
|---|---|
| From class ` https://developer.android.com/reference/java/lang/Object ` |---|---| | ` https://developer.android.com/reference/java/lang/Object` | ` https://developer.android.com/reference/java/lang/Object#clone()() ` Creates and returns a copy of this object. | | ` boolean` | ` https://developer.android.com/reference/java/lang/Object#equals(java.lang.Object)(https://developer.android.com/reference/java/lang/Object obj) ` Indicates whether some other object is "equal to" this one. | | ` void` | ` https://developer.android.com/reference/java/lang/Object#finalize()() ` Called by the garbage collector on an object when garbage collection determines that there are no more references to the object. | | ` final https://developer.android.com/reference/java/lang/Class<?>` | ` https://developer.android.com/reference/java/lang/Object#getClass()() ` Returns the runtime class of this `Object`. | | ` int` | ` https://developer.android.com/reference/java/lang/Object#hashCode()() ` Returns a hash code value for the object. | | ` final void` | ` https://developer.android.com/reference/java/lang/Object#notify()() ` Wakes up a single thread that is waiting on this object's monitor. | | ` final void` | ` https://developer.android.com/reference/java/lang/Object#notifyAll()() ` Wakes up all threads that are waiting on this object's monitor. | | ` https://developer.android.com/reference/java/lang/String` | ` https://developer.android.com/reference/java/lang/Object#toString()() ` Returns a string representation of the object. | | ` final void` | ` https://developer.android.com/reference/java/lang/Object#wait(long,%20int)(long timeoutMillis, int nanos) ` Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*, or until a certain amount of real time has elapsed. | | ` final void` | ` https://developer.android.com/reference/java/lang/Object#wait(long)(long timeoutMillis) ` Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*, or until a certain amount of real time has elapsed. | | ` final void` | ` https://developer.android.com/reference/java/lang/Object#wait()() ` Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*. | ||

## Public constructors

### Builder

Added in [API level 19](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public Builder (PrinterId printerId, 
                String name, 
                int status)
```

Constructor.

<br />

| Parameters ||
|---|---|
| `printerId` | `PrinterId`: The printer id. Cannot be null. <br /> |
| `name` | `String`: The printer name. Cannot be empty. This value cannot be `null`. <br /> |
| `status` | `int`: The printer status. Must be a valid status. Value is one of the following: - `https://developer.android.com/reference/android/print/PrinterInfo#STATUS_IDLE` - `https://developer.android.com/reference/android/print/PrinterInfo#STATUS_BUSY` - `https://developer.android.com/reference/android/print/PrinterInfo#STATUS_UNAVAILABLE` |

| Throws ||
|---|---|
| `https://developer.android.com/reference/java/lang/IllegalArgumentException` | If the printer id is null, or the printer name is empty or the status is not a valid one. |

### Builder

Added in [API level 19](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public Builder (PrinterInfo other)
```

Constructor.

<br />

| Parameters ||
|---|---|
| `other` | `PrinterInfo`: Other info from which to start building. This value cannot be `null`. <br /> |

## Public methods

### build

Added in [API level 19](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public PrinterInfo build ()
```

Creates a new `https://developer.android.com/reference/android/print/PrinterInfo`.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/print/PrinterInfo` | A new `https://developer.android.com/reference/android/print/PrinterInfo`. This value cannot be `null`. <br /> |

### setCapabilities

Added in [API level 19](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public PrinterInfo.Builder setCapabilities (PrinterCapabilitiesInfo capabilities)
```

Sets the printer capabilities.

<br />

| Parameters ||
|---|---|
| `capabilities` | `PrinterCapabilitiesInfo`: The capabilities. This value cannot be `null`. <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/print/PrinterInfo.Builder` | This builder. This value cannot be `null`. <br /> |

### setDescription

Added in [API level 19](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public PrinterInfo.Builder setDescription (String description)
```

Sets the **localized** printer description
which is shown to the user

<br />

| Parameters ||
|---|---|
| `description` | `String`: The description. This value cannot be `null`. <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/print/PrinterInfo.Builder` | This builder. This value cannot be `null`. <br /> |

### setHasCustomPrinterIcon

Added in [API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public PrinterInfo.Builder setHasCustomPrinterIcon (boolean hasCustomPrinterIcon)
```

Declares that the print service can load a custom per printer's icon. If both
`https://developer.android.com/reference/android/print/PrinterInfo.Builder#setIconResourceId(int)` and a custom icon are set the resource icon
is shown while the custom icon loads but then the custom icon is used. If
`https://developer.android.com/reference/android/print/PrinterInfo.Builder#setIconResourceId(int)` is not set the printer's service's icon is
shown while loading.


The icon is requested asynchronously and only when needed via
`https://developer.android.com/reference/android/printservice/PrinterDiscoverySession#onRequestCustomPrinterIcon(android.print.PrinterId,%20android.os.CancellationSignal,%20android.printservice.CustomPrinterIconCallback)`.

<br />

<br />

| Parameters ||
|---|---|
| `hasCustomPrinterIcon` | `boolean`: If the printer has a custom icon or not. <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/print/PrinterInfo.Builder` | This builder. This value cannot be `null`. <br /> |

### setIconResourceId

Added in [API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public PrinterInfo.Builder setIconResourceId (int iconResourceId)
```

Set a drawable resource as icon for this printer. If no icon is set the printer's
service's icon is used for the printer.

<br />

| Parameters ||
|---|---|
| `iconResourceId` | `int`: The resource ID of the icon. <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/print/PrinterInfo.Builder` | This builder. This value cannot be `null`. <br /> |

**See also:**

- `https://developer.android.com/reference/android/print/PrinterInfo.Builder#setHasCustomPrinterIcon(boolean)`

### setInfoIntent

Added in [API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public PrinterInfo.Builder setInfoIntent (PendingIntent infoIntent)
```

Sets the `https://developer.android.com/reference/android/app/PendingIntent` that launches an activity showing more information about
the printer.

<br />

| Parameters ||
|---|---|
| `infoIntent` | `PendingIntent`: The `https://developer.android.com/reference/android/app/PendingIntent`. This value cannot be `null`. <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/print/PrinterInfo.Builder` | This builder. This value cannot be `null`. <br /> |

### setName

Added in [API level 19](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public PrinterInfo.Builder setName (String name)
```

Sets the **localized** printer name which
is shown to the user

<br />

| Parameters ||
|---|---|
| `name` | `String`: The name. This value cannot be `null`. <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/print/PrinterInfo.Builder` | This builder. This value cannot be `null`. <br /> |

### setStatus

Added in [API level 19](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public PrinterInfo.Builder setStatus (int status)
```

Sets the printer status.

<br />

| Parameters ||
|---|---|
| `status` | `int`: The status. Value is one of the following: - `https://developer.android.com/reference/android/print/PrinterInfo#STATUS_IDLE` - `https://developer.android.com/reference/android/print/PrinterInfo#STATUS_BUSY` - `https://developer.android.com/reference/android/print/PrinterInfo#STATUS_UNAVAILABLE` |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/print/PrinterInfo.Builder` | This builder. This value cannot be `null`. <br /> |

**See also:**

- `https://developer.android.com/reference/android/print/PrinterInfo#STATUS_IDLE`
- `https://developer.android.com/reference/android/print/PrinterInfo#STATUS_BUSY`
- `https://developer.android.com/reference/android/print/PrinterInfo#STATUS_UNAVAILABLE`