public static class

DataHolder.Builder

extends Object
java.lang.Object
   ↳ com.google.android.gms.common.data.DataHolder.Builder

Class Overview

Helper class to build DataHolder instances containing arbitrary data.

Note that the constructor is private; use DataHolder.builder() to create instances of this class.

Summary

Public Methods
DataHolder build(int statusCode, Bundle metadata)
Instantiate an DataHolder from this DataHolder.Builder with the given status code and metadata.
DataHolder build(int statusCode)
Instantiate an DataHolder from this DataHolder.Builder with the given status code and null metadata.
int getCount()
DataHolder.Builder sort(String sortColumn)
Sort the rows in this builder based on the standard data type comparisons for the value in the provided column.
DataHolder.Builder withRow(ContentValues values)
Add a new row of data to the DataHolder this DataHolder.Builder will create.
DataHolder.Builder withRow(HashMap<StringObject> row)
Add a new row of data to the DataHolder this DataHolder.Builder will create.
[Expand]
Inherited Methods
From class java.lang.Object

Public Methods

public DataHolder build (int statusCode, Bundle metadata)

Instantiate an DataHolder from this DataHolder.Builder with the given status code and metadata.

Parameters
statusCode The status code of this DataHolder.
metadata The metadata associated with this DataHolder (may be null).
Returns

public DataHolder build (int statusCode)

Instantiate an DataHolder from this DataHolder.Builder with the given status code and null metadata.

Parameters
statusCode The status code of this DataHolder.
Returns

public int getCount ()

Returns
  • The number of rows that the resulting DataHolder will contain.

public DataHolder.Builder sort (String sortColumn)

Sort the rows in this builder based on the standard data type comparisons for the value in the provided column. Calling this multiple times with the same column will not change the sort order of the builder. Note that any data which is added after this call will not be sorted.

Parameters
sortColumn The column to sort the rows in this builder by.
Returns

public DataHolder.Builder withRow (ContentValues values)

Add a new row of data to the DataHolder this DataHolder.Builder will create. Note that the data must contain an entry for all columns

Currently the only supported value types that are supported are String, Long, and Boolean (Integer is also accepted and will be stored as a Long).

Parameters
values ContentValues containing row data.
Returns

public DataHolder.Builder withRow (HashMap<StringObject> row)

Add a new row of data to the DataHolder this DataHolder.Builder will create.

Currently the only supported value types that are supported are String, Long, and Boolean (Integer is also accepted and will be stored as a Long).

Parameters
row Map containing row data.
Returns