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

# ContentInfo.Builder

*** ** * ** ***

` public static final class ContentInfo.Builder `   
` extends https://developer.android.com/reference/java/lang/Object ` ` `

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

<br />

*** ** * ** ***

Builder for `https://developer.android.com/reference/android/view/ContentInfo`.

## Summary

| ### Public constructors ||
|---|---|
| ` https://developer.android.com/reference/android/view/ContentInfo.Builder#Builder(android.content.ClipData,%20int)(https://developer.android.com/reference/android/content/ClipData clip, int source) ` Creates a new builder. |
| ` https://developer.android.com/reference/android/view/ContentInfo.Builder#Builder(android.view.ContentInfo)(https://developer.android.com/reference/android/view/ContentInfo other) ` Creates a new builder initialized with the data from the given builder. |

| ### Public methods ||
|---|---|
| ` https://developer.android.com/reference/android/view/ContentInfo` | ` https://developer.android.com/reference/android/view/ContentInfo.Builder#build()() ` |
| ` https://developer.android.com/reference/android/view/ContentInfo.Builder` | ` https://developer.android.com/reference/android/view/ContentInfo.Builder#setClip(android.content.ClipData)(https://developer.android.com/reference/android/content/ClipData clip) ` Sets the data to be inserted. |
| ` https://developer.android.com/reference/android/view/ContentInfo.Builder` | ` https://developer.android.com/reference/android/view/ContentInfo.Builder#setExtras(android.os.Bundle)(https://developer.android.com/reference/android/os/Bundle extras) ` Sets additional metadata. |
| ` https://developer.android.com/reference/android/view/ContentInfo.Builder` | ` https://developer.android.com/reference/android/view/ContentInfo.Builder#setFlags(int)(int flags) ` Sets flags that control content insertion behavior. |
| ` https://developer.android.com/reference/android/view/ContentInfo.Builder` | ` https://developer.android.com/reference/android/view/ContentInfo.Builder#setLinkUri(android.net.Uri)(https://developer.android.com/reference/android/net/Uri linkUri) ` Sets the http/https URI for the content. |
| ` https://developer.android.com/reference/android/view/ContentInfo.Builder` | ` https://developer.android.com/reference/android/view/ContentInfo.Builder#setSource(int)(int source) ` Sets the source of the operation. |

### 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 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

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

Creates a new builder.

<br />

| Parameters ||
|---|---|
| `clip` | `ClipData`: The data to insert. This value cannot be `null`. <br /> |
| `source` | `int`: The source of the operation. See `SOURCE_` constants. Value is one of the following: - `https://developer.android.com/reference/android/view/ContentInfo#SOURCE_APP` - `https://developer.android.com/reference/android/view/ContentInfo#SOURCE_CLIPBOARD` - `https://developer.android.com/reference/android/view/ContentInfo#SOURCE_INPUT_METHOD` - `https://developer.android.com/reference/android/view/ContentInfo#SOURCE_DRAG_AND_DROP` - `https://developer.android.com/reference/android/view/ContentInfo#SOURCE_AUTOFILL` - `https://developer.android.com/reference/android/view/ContentInfo#SOURCE_PROCESS_TEXT` |

### Builder

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

```
public Builder (ContentInfo other)
```

Creates a new builder initialized with the data from the given builder.

<br />

| Parameters ||
|---|---|
| `other` | `ContentInfo`: This value cannot be `null`. <br /> |

## Public methods

### build

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

```
public ContentInfo build ()
```

<br />

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/view/ContentInfo` | A new `https://developer.android.com/reference/android/view/ContentInfo` instance with the data from this builder. This value cannot be `null`. <br /> |

### setClip

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

```
public ContentInfo.Builder setClip (ClipData clip)
```

Sets the data to be inserted.

<br />

| Parameters ||
|---|---|
| `clip` | `ClipData`: The data to insert. This value cannot be `null`. <br /> |

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

### setExtras

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

```
public ContentInfo.Builder setExtras (Bundle extras)
```

Sets additional metadata.

<br />

| Parameters ||
|---|---|
| `extras` | `Bundle`: Optional bundle with additional metadata. This value may be `null`. <br /> |

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

### setFlags

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

```
public ContentInfo.Builder setFlags (int flags)
```

Sets flags that control content insertion behavior.

<br />

| Parameters ||
|---|---|
| `flags` | `int`: Optional flags to configure the insertion behavior. Use 0 for default behavior. See `FLAG_` constants. Value is either `0` or - `https://developer.android.com/reference/android/view/ContentInfo#FLAG_CONVERT_TO_PLAIN_TEXT` |

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

### setLinkUri

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

```
public ContentInfo.Builder setLinkUri (Uri linkUri)
```

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

<br />

| Parameters ||
|---|---|
| `linkUri` | `Uri`: Optional http/https URI for the content. This value may be `null`. <br /> |

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

### setSource

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

```
public ContentInfo.Builder setSource (int source)
```

Sets the source of the operation.

<br />

| Parameters ||
|---|---|
| `source` | `int`: The source of the operation. See `SOURCE_` constants. Value is one of the following: - `https://developer.android.com/reference/android/view/ContentInfo#SOURCE_APP` - `https://developer.android.com/reference/android/view/ContentInfo#SOURCE_CLIPBOARD` - `https://developer.android.com/reference/android/view/ContentInfo#SOURCE_INPUT_METHOD` - `https://developer.android.com/reference/android/view/ContentInfo#SOURCE_DRAG_AND_DROP` - `https://developer.android.com/reference/android/view/ContentInfo#SOURCE_AUTOFILL` - `https://developer.android.com/reference/android/view/ContentInfo#SOURCE_PROCESS_TEXT` |

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