public static class

GoalsReadRequest.Builder

extends Object
java.lang.Object
   ↳ com.google.android.gms.fitness.request.GoalsReadRequest.Builder

Class Overview

Builder used to create new GoalsReadRequest.

Summary

Public Constructors
GoalsReadRequest.Builder()
Public Methods
GoalsReadRequest.Builder addActivity(String activityName)
Adds a specific activity to this request.
GoalsReadRequest.Builder addDataType(DataType dataType)
Adds a specific data type to this request.
GoalsReadRequest.Builder addObjectiveType(int objectiveType)
Adds a objective type to this request.
GoalsReadRequest build()
Finishes building and returns the request.
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public GoalsReadRequest.Builder ()

Public Methods

public GoalsReadRequest.Builder addActivity (String activityName)

Adds a specific activity to this request.

This method can be called multiple times to add multiple activities in the request.

Parameters
activityName String: the name of the activity we're querying goals for.
Returns
GoalsReadRequest.Builder
Throws
IllegalStateException if the activity name is invalid.

public GoalsReadRequest.Builder addDataType (DataType dataType)

Adds a specific data type to this request. Goals that track the specified data types should be read. At least one specific data type should be set to build the request.

This method can be called multiple times to add multiple data types in the request.

Parameters
dataType DataType: the data type we're querying goals for.
Returns
GoalsReadRequest.Builder
Throws
NullPointerException if the data type is null

public GoalsReadRequest.Builder addObjectiveType (int objectiveType)

Adds a objective type to this request.

This method can be called multiple times to add multiple objective types in the request.

Parameters
objectiveType int: the objective type we're querying goals for. The objective type should be one of the OBJECTIVE_TYPE_METRIC, OBJECTIVE_TYPE_DURATION, OBJECTIVE_TYPE_FREQUENCY constants.
Returns
GoalsReadRequest.Builder
Throws
IllegalStateException if the objectiveType is invalid.

public GoalsReadRequest build ()

Finishes building and returns the request.

Returns
GoalsReadRequest