# ContentInfoCompat.Builder

Artifact: [androidx.core:core](https://developer.android.com/jetpack/androidx/releases/core) [View Source](https://cs.android.com/search?q=file:androidx/core/view/ContentInfoCompat.java+class:androidx.core.view.ContentInfoCompat.Builder) Added in [1.5.0](https://developer.android.com/jetpack/androidx/releases/core#1.5.0)

*** ** * ** ***


```
public final class ContentInfoCompat.Builder
```

<br />

*** ** * ** ***

Builder for `https://developer.android.com/reference/androidx/core/view/ContentInfoCompat`.

## Summary

| ### Public constructors |
|---|
| `https://developer.android.com/reference/androidx/core/view/ContentInfoCompat.Builder#Builder(androidx.core.view.ContentInfoCompat)(@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/core/view/ContentInfoCompat other)` Creates a new builder initialized with the data from the given object (shallow copy). |
| `https://developer.android.com/reference/androidx/core/view/ContentInfoCompat.Builder#Builder(android.content.ClipData,int)(@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/android/content/ClipData.html clip, int source)` Creates a new builder. |

| ### Public methods |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/core/view/ContentInfoCompat` | `https://developer.android.com/reference/androidx/core/view/ContentInfoCompat.Builder#build()()` |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/core/view/ContentInfoCompat.Builder` | `https://developer.android.com/reference/androidx/core/view/ContentInfoCompat.Builder#setClip(android.content.ClipData)(@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/android/content/ClipData.html clip)` Sets the data to be inserted. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/core/view/ContentInfoCompat.Builder` | `https://developer.android.com/reference/androidx/core/view/ContentInfoCompat.Builder#setExtras(android.os.Bundle)(@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/android/os/Bundle.html extras)` Sets additional metadata. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/core/view/ContentInfoCompat.Builder` | `https://developer.android.com/reference/androidx/core/view/ContentInfoCompat.Builder#setFlags(int)(int flags)` Sets flags that control content insertion behavior. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/core/view/ContentInfoCompat.Builder` | `https://developer.android.com/reference/androidx/core/view/ContentInfoCompat.Builder#setLinkUri(android.net.Uri)(@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/android/net/Uri.html linkUri)` Sets the http/https URI for the content. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/core/view/ContentInfoCompat.Builder` | `https://developer.android.com/reference/androidx/core/view/ContentInfoCompat.Builder#setSource(int)(int source)` Sets the source of the operation. |

## Public constructors

### Builder

Added in [1.5.0](https://developer.android.com/jetpack/androidx/releases/core#1.5.0)

```
public Builder(@NonNull ContentInfoCompat other)
```

Creates a new builder initialized with the data from the given object (shallow copy).

### Builder

Added in [1.5.0](https://developer.android.com/jetpack/androidx/releases/core#1.5.0)

```
public Builder(@NonNull ClipData clip, int source)
```

Creates a new builder.

| Parameters |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/android/content/ClipData.html clip` | The data to insert. |
| `int source` | The source of the operation. See `SOURCE_` constants. |

## Public methods

### build

Added in [1.5.0](https://developer.android.com/jetpack/androidx/releases/core#1.5.0)

```
public @NonNull ContentInfoCompat build()
```

| Returns |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/core/view/ContentInfoCompat` | A new `https://developer.android.com/reference/androidx/core/view/ContentInfoCompat` instance with the data from this builder. |

### setClip

Added in [1.5.0](https://developer.android.com/jetpack/androidx/releases/core#1.5.0)

```
public @NonNull ContentInfoCompat.Builder setClip(@NonNull ClipData clip)
```

Sets the data to be inserted.

| Parameters |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/android/content/ClipData.html clip` | The data to insert. |

| Returns |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/core/view/ContentInfoCompat.Builder` | this builder |

### setExtras

Added in [1.5.0](https://developer.android.com/jetpack/androidx/releases/core#1.5.0)

```
public @NonNull ContentInfoCompat.Builder setExtras(@Nullable Bundle extras)
```

Sets additional metadata.

| Parameters |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/android/os/Bundle.html extras` | Optional bundle with additional metadata. |

| Returns |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/core/view/ContentInfoCompat.Builder` | this builder |

### setFlags

Added in [1.5.0](https://developer.android.com/jetpack/androidx/releases/core#1.5.0)

```
public @NonNull ContentInfoCompat.Builder setFlags(int flags)
```

Sets flags that control content insertion behavior.

| Parameters |
|---|---|
| `int flags` | Optional flags to configure the insertion behavior. Use 0 for default behavior. See `FLAG_` constants. |

| Returns |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/core/view/ContentInfoCompat.Builder` | this builder |

### setLinkUri

Added in [1.5.0](https://developer.android.com/jetpack/androidx/releases/core#1.5.0)

```
public @NonNull ContentInfoCompat.Builder setLinkUri(@Nullable Uri linkUri)
```

Sets the http/https URI for the content. See `https://developer.android.com/reference/android/view/inputmethod/InputContentInfo.html#getLinkUri()` for more info.

| Parameters |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/android/net/Uri.html linkUri` | Optional http/https URI for the content. |

| Returns |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/core/view/ContentInfoCompat.Builder` | this builder |

### setSource

Added in [1.5.0](https://developer.android.com/jetpack/androidx/releases/core#1.5.0)

```
public @NonNull ContentInfoCompat.Builder setSource(int source)
```

Sets the source of the operation.

| Parameters |
|---|---|
| `int source` | The source of the operation. See `SOURCE_` constants. |

| Returns |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/core/view/ContentInfoCompat.Builder` | this builder |