Added in [API level 35](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)   
Deprecated in [API level 37](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels) Summary: [Ctors](https://developer.android.com/reference/android/adservices/ondevicepersonalization/InferenceInput.Params.Builder#pubctors) \| [Methods](https://developer.android.com/reference/android/adservices/ondevicepersonalization/InferenceInput.Params.Builder#pubmethods) \| [Inherited Methods](https://developer.android.com/reference/android/adservices/ondevicepersonalization/InferenceInput.Params.Builder#inhmethods)

# InferenceInput.Params.Builder

*** ** * ** ***

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

|---|---|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object) ||
| ↳ | android.adservices.ondevicepersonalization.InferenceInput.Params.Builder |

<br />

*** ** * ** ***

<br />

**This class was deprecated in API level 37.**   

The ODP APIs are deprecated and will not be supported in future Android releases. There is no direct replacement API available. Developers currently integrated with these APIs must cease further integration efforts. For comprehensive details regarding this deprecation and the future roadmap of Privacy Sandbox on Android, please consult the official Privacy Sandbox developer documentation and announcements: <https://privacysandbox.google.com>

A builder for `https://developer.android.com/reference/android/adservices/ondevicepersonalization/InferenceInput.Params`

## Summary

| ### Public constructors ||
|---|---|
| ` https://developer.android.com/reference/android/adservices/ondevicepersonalization/InferenceInput.Params.Builder#Builder(android.adservices.ondevicepersonalization.KeyValueStore,%20java.lang.String)(https://developer.android.com/reference/android/adservices/ondevicepersonalization/KeyValueStore keyValueStore, https://developer.android.com/reference/java/lang/String modelKey) ` Creates a new Builder. |

| ### Public methods ||
|---|---|
| ` https://developer.android.com/reference/android/adservices/ondevicepersonalization/InferenceInput.Params` | ` https://developer.android.com/reference/android/adservices/ondevicepersonalization/InferenceInput.Params.Builder#build()() ` Builds the instance. |
| ` https://developer.android.com/reference/android/adservices/ondevicepersonalization/InferenceInput.Params.Builder` | ` https://developer.android.com/reference/android/adservices/ondevicepersonalization/InferenceInput.Params.Builder#setDelegateType(int)(int value) ` The delegate to run model inference. |
| ` https://developer.android.com/reference/android/adservices/ondevicepersonalization/InferenceInput.Params.Builder` | ` https://developer.android.com/reference/android/adservices/ondevicepersonalization/InferenceInput.Params.Builder#setKeyValueStore(android.adservices.ondevicepersonalization.KeyValueStore)(https://developer.android.com/reference/android/adservices/ondevicepersonalization/KeyValueStore value) ` A `https://developer.android.com/reference/android/adservices/ondevicepersonalization/KeyValueStore` where pre-trained model is stored. |
| ` https://developer.android.com/reference/android/adservices/ondevicepersonalization/InferenceInput.Params.Builder` | ` https://developer.android.com/reference/android/adservices/ondevicepersonalization/InferenceInput.Params.Builder#setModelKey(java.lang.String)(https://developer.android.com/reference/java/lang/String value) ` The key of the table where the corresponding value stores a pre-trained model. |
| ` https://developer.android.com/reference/android/adservices/ondevicepersonalization/InferenceInput.Params.Builder` | ` https://developer.android.com/reference/android/adservices/ondevicepersonalization/InferenceInput.Params.Builder#setModelType(int)(int value) ` The type of the pre-trained model. |
| ` https://developer.android.com/reference/android/adservices/ondevicepersonalization/InferenceInput.Params.Builder` | ` https://developer.android.com/reference/android/adservices/ondevicepersonalization/InferenceInput.Params.Builder#setRecommendedNumThreads(int)(int value) ` The number of threads used for intraop parallelism on CPU, must be positive number. |

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

```
public Builder (KeyValueStore keyValueStore, 
                String modelKey)
```

Creates a new Builder.

<br />

| Parameters ||
|---|---|
| `keyValueStore` | `KeyValueStore`: a `https://developer.android.com/reference/android/adservices/ondevicepersonalization/KeyValueStore` where pre-trained model is stored. This value cannot be `null`. <br /> |
| `modelKey` | `String`: key of the table where the corresponding value stores a pre-trained model. This value cannot be `null`. <br /> |

## Public methods

### build

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

```
public InferenceInput.Params build ()
```

Builds the instance. This builder should not be touched after calling this!

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/adservices/ondevicepersonalization/InferenceInput.Params` | This value cannot be `null`. <br /> |

### setDelegateType

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

```
public InferenceInput.Params.Builder setDelegateType (int value)
```

The delegate to run model inference. If not set, the default value is `https://developer.android.com/reference/android/adservices/ondevicepersonalization/InferenceInput.Params#DELEGATE_CPU`.

<br />

| Parameters ||
|---|---|
| `value` | `int`: Value is one of the following: - `https://developer.android.com/reference/android/adservices/ondevicepersonalization/InferenceInput.Params#DELEGATE_CPU` |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/adservices/ondevicepersonalization/InferenceInput.Params.Builder` | This value cannot be `null`. <br /> |

### setKeyValueStore

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

```
public InferenceInput.Params.Builder setKeyValueStore (KeyValueStore value)
```

A `https://developer.android.com/reference/android/adservices/ondevicepersonalization/KeyValueStore` where pre-trained model is stored.

<br />

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

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/adservices/ondevicepersonalization/InferenceInput.Params.Builder` | This value cannot be `null`. <br /> |

### setModelKey

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

```
public InferenceInput.Params.Builder setModelKey (String value)
```

The key of the table where the corresponding value stores a pre-trained model.

<br />

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

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/adservices/ondevicepersonalization/InferenceInput.Params.Builder` | This value cannot be `null`. <br /> |

### setModelType

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

```
public InferenceInput.Params.Builder setModelType (int value)
```

The type of the pre-trained model. If not set, the default value is `https://developer.android.com/reference/android/adservices/ondevicepersonalization/InferenceInput.Params#MODEL_TYPE_TENSORFLOW_LITE` .

<br />

| Parameters ||
|---|---|
| `value` | `int`: Value is one of the following: - `https://developer.android.com/reference/android/adservices/ondevicepersonalization/InferenceInput.Params#MODEL_TYPE_TENSORFLOW_LITE` - `https://developer.android.com/reference/android/adservices/ondevicepersonalization/InferenceInput.Params#MODEL_TYPE_EXECUTORCH` |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/adservices/ondevicepersonalization/InferenceInput.Params.Builder` | This value cannot be `null`. <br /> |

### setRecommendedNumThreads

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

```
public InferenceInput.Params.Builder setRecommendedNumThreads (int value)
```

The number of threads used for intraop parallelism on CPU, must be positive number. Adopters can set this field based on model architecture. The actual thread number depends on system resources and other constraints.

<br />

| Parameters ||
|---|---|
| `value` | `int`: Value is 1 or greater <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/adservices/ondevicepersonalization/InferenceInput.Params.Builder` | This value cannot be `null`. <br /> |