GoalsReadRequest.Builder

public static class GoalsReadRequest.Builder extends Object

Builder used to create new GoalsReadRequest.

Public Constructor Summary

Public Method Summary

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.

Inherited Method Summary

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 the name of the activity we're querying goals for.
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 the data type we're querying goals for.
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 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.
Throws
IllegalStateException if the objectiveType is invalid.

public GoalsReadRequest build ()

Finishes building and returns the request.