TableResponse.Builder


public static final class TableResponse.Builder
extends Object

java.lang.Object
   ↳ android.media.tv.TableResponse.Builder


Builder for TableResponse.

Summary

Public constructors

Builder(int requestId, int sequence, int responseResult, int version, int size)

Constructs a Builder object of TableResponse.

Public methods

TableResponse build()

Builds a TableResponse object.

TableResponse.Builder setTableByteArray(byte[] bytes)

Sets table byte array.

TableResponse.Builder setTableSharedMemory(SharedMemory sharedMemory)

Sets table shared memory.

TableResponse.Builder setTableUri(Uri uri)

Sets table URI.

Inherited methods

Public constructors

Builder

Added in API level 34
public Builder (int requestId, 
                int sequence, 
                int responseResult, 
                int version, 
                int size)

Constructs a Builder object of TableResponse.

Parameters
requestId int: The ID is used to associate the response with the request.

sequence int: The sequence number which indicates the order of related responses.

responseResult int: The result for the response. It's one of BroadcastInfoResponse.RESPONSE_RESULT_OK, BroadcastInfoResponse.RESPONSE_RESULT_CANCEL, BroadcastInfoResponse.RESPONSE_RESULT_ERROR. Value is BroadcastInfoResponse.RESPONSE_RESULT_ERROR, BroadcastInfoResponse.RESPONSE_RESULT_OK, or BroadcastInfoResponse.RESPONSE_RESULT_CANCEL

version int: The version number of requested table.

size int: The Size number of table in bytes.

Public methods

build

Added in API level 34
public TableResponse build ()

Builds a TableResponse object.

Returns
TableResponse This value cannot be null.

setTableByteArray

Added in API level 34
public TableResponse.Builder setTableByteArray (byte[] bytes)

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 byte: The byte array which stores the table in bytes. The structure and syntax of the table depends on the table name in TableRequest.getTableName() and the corresponding standard. This value cannot be null.

Returns
TableResponse.Builder

setTableSharedMemory

Added in API level 34
public TableResponse.Builder setTableSharedMemory (SharedMemory sharedMemory)

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: 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() and the corresponding standard. This value cannot be null.

Returns
TableResponse.Builder

setTableUri

Added in API level 34
public TableResponse.Builder setTableUri (Uri uri)

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: The URI of the table. This value cannot be null.

Returns
TableResponse.Builder