# TableResponse.Builder

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

# Builder

*** ** * ** ***

Kotlin\|[Java](https://developer.android.com/reference/android/media/tv/TableResponse.Builder "View this page in Java")  

```
class Builder
```

|---|----------------------------------------------------------------------------------------------------------------------------------|
| [kotlin.Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html)                                                   ||
| ↳ | [android.media.tv.TableResponse.Builder](https://developer.android.com/reference/kotlin/android/media/tv/TableResponse.Builder#) |

Builder for[TableResponse](https://developer.android.com/reference/kotlin/android/media/tv/TableResponse).

## Summary

|                                                                                                                                                                                                                                                                                                                                                                                 Public constructors                                                                                                                                                                                                                                                                                                                                                                                 ||
|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---|
| [Builder](https://developer.android.com/reference/kotlin/android/media/tv/TableResponse.Builder#Builder(kotlin.Int,%20kotlin.Int,%20kotlin.Int,%20kotlin.Int,%20kotlin.Int))`(`requestId:` `[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`, `sequence:` `[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`, `responseResult:` `[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`, `version:` `[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`, `size:` `[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`)` Constructs a Builder object of[TableResponse](https://developer.android.com/reference/kotlin/android/media/tv/TableResponse). |

|                                                                                                                                                                                                      Public methods                                                                                                                                                                                                      ||
|-----------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [TableResponse](https://developer.android.com/reference/kotlin/android/media/tv/TableResponse)                  | [build](https://developer.android.com/reference/kotlin/android/media/tv/TableResponse.Builder#build())`()` Builds a[TableResponse](https://developer.android.com/reference/kotlin/android/media/tv/TableResponse)object.                                                                                |
| [TableResponse.Builder](https://developer.android.com/reference/kotlin/android/media/tv/TableResponse.Builder#) | [setTableByteArray](https://developer.android.com/reference/kotlin/android/media/tv/TableResponse.Builder#setTableByteArray(kotlin.ByteArray))`(`bytes:` `[ByteArray](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-byte-array/index.html)`)` Sets table byte array.                             |
| [TableResponse.Builder](https://developer.android.com/reference/kotlin/android/media/tv/TableResponse.Builder#) | [setTableSharedMemory](https://developer.android.com/reference/kotlin/android/media/tv/TableResponse.Builder#setTableSharedMemory(android.os.SharedMemory))`(`sharedMemory:` `[SharedMemory](https://developer.android.com/reference/kotlin/android/os/SharedMemory.html#)`)` Sets table shared memory. |
| [TableResponse.Builder](https://developer.android.com/reference/kotlin/android/media/tv/TableResponse.Builder#) | [setTableUri](https://developer.android.com/reference/kotlin/android/media/tv/TableResponse.Builder#setTableUri(android.net.Uri))`(`uri:` `[Uri](https://developer.android.com/reference/kotlin/android/net/Uri.html#)`)` Sets table URI.                                                               |

## Public constructors

### Builder

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

```
Builder(
    requestId: Int, 
    sequence: Int, 
    responseResult: Int, 
    version: Int, 
    size: Int)
```

Constructs a Builder object of[TableResponse](https://developer.android.com/reference/kotlin/android/media/tv/TableResponse).

|                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          Parameters                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           ||
|------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `requestId`      | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html):The ID is used to associate the response with the request.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| `sequence`       | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html):The sequence number which indicates the order of related responses.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| `responseResult` | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html):The result for the response. It's one of[RESPONSE_RESULT_OK](https://developer.android.com/reference/kotlin/android/media/tv/BroadcastInfoResponse#RESPONSE_RESULT_OK:kotlin.Int),[RESPONSE_RESULT_CANCEL](https://developer.android.com/reference/kotlin/android/media/tv/BroadcastInfoResponse#RESPONSE_RESULT_CANCEL:kotlin.Int),[RESPONSE_RESULT_ERROR](https://developer.android.com/reference/kotlin/android/media/tv/BroadcastInfoResponse#RESPONSE_RESULT_ERROR:kotlin.Int). Value is[android.media.tv.BroadcastInfoResponse#RESPONSE_RESULT_ERROR](https://developer.android.com/reference/kotlin/android/media/tv/BroadcastInfoResponse#RESPONSE_RESULT_ERROR:kotlin.Int),[android.media.tv.BroadcastInfoResponse#RESPONSE_RESULT_OK](https://developer.android.com/reference/kotlin/android/media/tv/BroadcastInfoResponse#RESPONSE_RESULT_OK:kotlin.Int), or[android.media.tv.BroadcastInfoResponse#RESPONSE_RESULT_CANCEL](https://developer.android.com/reference/kotlin/android/media/tv/BroadcastInfoResponse#RESPONSE_RESULT_CANCEL:kotlin.Int) |
| `version`        | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html):The version number of requested table.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| `size`           | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html):The Size number of table in bytes.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |

## Public methods

### build

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

```
fun build(): TableResponse
```

Builds a[TableResponse](https://developer.android.com/reference/kotlin/android/media/tv/TableResponse)object.

|                                                           Return                                                            ||
|------------------------------------------------------------------------------------------------|-----------------------------|
| [TableResponse](https://developer.android.com/reference/kotlin/android/media/tv/TableResponse) | This value cannot be`null`. |

### setTableByteArray

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

```
fun setTableByteArray(bytes: ByteArray): TableResponse.Builder
```

Sets table byte array.

For a single builder instance, at most one of table URI, table byte array, and table shared memory can be set. If more than one are set, only the last call takes precedence and others are reset to`null`.

|                                                                                                                                                                                                Parameters                                                                                                                                                                                                ||
|---------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `bytes` | [ByteArray](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-byte-array/index.html):The byte array which stores the table in bytes. The structure and syntax of the table depends on the table name in[TableRequest.getTableName()](https://developer.android.com/reference/kotlin/android/media/tv/TableRequest#getTableName())and the corresponding standard. This value cannot be`null`. |

### setTableSharedMemory

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

```
fun setTableSharedMemory(sharedMemory: SharedMemory): TableResponse.Builder
```

Sets table shared memory.

For a single builder instance, at most one of table URI, table byte array, and table shared memory can be set. If more than one are set, only the last call takes precedence and others are reset to`null`.

|                                                                                                                                                                                                                                                                    Parameters                                                                                                                                                                                                                                                                    ||
|----------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `sharedMemory` | [SharedMemory](https://developer.android.com/reference/kotlin/android/os/SharedMemory.html#):The shared memory which stores the table. The table size can be large so using a shared memory optimizes the data communication between the table data source and the receiver. The structure syntax of the table depends on the table name in[TableRequest.getTableName()](https://developer.android.com/reference/kotlin/android/media/tv/TableRequest#getTableName())and the corresponding standard. This value cannot be`null`. |

### setTableUri

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

```
fun setTableUri(uri: Uri): TableResponse.Builder
```

Sets table URI.

For a single builder instance, at most one of table URI, table byte array, and table shared memory can be set. If more than one are set, only the last call takes precedence and others are reset to`null`.

|                                                              Parameters                                                              ||
|-------|-------------------------------------------------------------------------------------------------------------------------------|
| `uri` | [Uri](https://developer.android.com/reference/kotlin/android/net/Uri.html#):The URI of the table. This value cannot be`null`. |