DataHolder.Builder | Android Developers

Quicknav Quicknav
Links

- Google Play Developer Console
- Android Developers Blog
- About Android

Android Sites

- Android.com
- Android Developers
- Android Open Source Project

Language
close

- - Get Started
  - Style
  - Patterns
  - Building Blocks
  - Downloads
  - Videos
- - Training
  - API Guides
  - Reference
  - Tools
    - Get the SDK
  - Google Services
- - Google Play
  - Publishing
  - Promoting
  - App Quality
  - Spotlight
  - Open Distribution

## Results

Loading...
Summary: Methods | Inherited Methods | [Expand All]
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<String, Object> row) Add a new row of data to the `DataHolder` this `DataHolder.Builder` will create.

[Expand] Inherited Methods
From class java.lang.Object
Object | clone()
boolean | equals(Object arg0)
void | finalize()
final Class<?> | getClass()
int | hashCode()
final void | notify()
final void | notifyAll()
String | toString()
final void | wait()
final void | wait(long arg0, int arg1)
final void | wait(long arg0)

## 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

- `DataHolder` representation of this object.

#### 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

- `DataHolder` representation of this object.

#### 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

- `DataHolder.Builder` to continue construction.

#### 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

- `DataHolder.Builder` to continue construction.

#### public DataHolder.Builder withRow (HashMap<String, Object> 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

- `DataHolder.Builder` to continue construction.