GoalsReadRequest.Builder

public static classGoalsReadRequest.BuilderextendsObject

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

publicBuilder()

Public Methods

publicGoalsReadRequest.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 that you're querying goals for.
Throws
IllegalStateException If the activity name is invalid.

publicGoalsReadRequest.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 that you're querying goals for.
Throws
NullPointerException If the data type is null.

publicGoalsReadRequest.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 that you're querying goals for. The objective type should be one of the Goal.OBJECTIVE_TYPE_METRIC, Goal.OBJECTIVE_TYPE_DURATION, Goal.OBJECTIVE_TYPE_FREQUENCYconstants.
Throws
IllegalStateException If the objectiveType is invalid.

publicGoalsReadRequest build()

Finishes building and returns the request.