Builder used to create new GoalsReadRequest.
Public Constructor Summary
Builder()
|
Public Method Summary
GoalsReadRequest.Builder | |
GoalsReadRequest.Builder | |
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 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 that you'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 that you'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 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_FREQUENCY constants. |
---|
Throws
IllegalStateException | If the objectiveType is invalid. |
---|
public GoalsReadRequest build ()
Finishes building and returns the request.