Builder used to create new SessionInsertRequest.
Public Constructor Summary
Builder()
|
Public Method Summary
SessionInsertRequest.Builder |
addAggregateDataPoint(DataPoint
aggregateDataPoint)
Adds the specified aggregate data point to this request.
|
SessionInsertRequest.Builder | |
SessionInsertRequest |
build()
Finishes building and returns the request.
|
SessionInsertRequest.Builder |
Inherited Method Summary
Public Constructors
public Builder ()
Public Methods
public SessionInsertRequest.Builder addAggregateDataPoint (DataPoint aggregateDataPoint)
Adds the specified aggregate data point to this request. Only one aggregate data point per data source is allowed.
Note: removing the session will not delete the data point. To remove the data that
was inserted along with a session, use
HistoryClient.deleteData(DataDeleteRequest)
.
Note: adding data via this method is no different from inserting the session and
then inserting the DataSet
via
HistoryClient.insertData(DataSet)
separately. Data is only attributed to
sessions via overlap in time, not based on the session with which it was inserted.
Throws
IllegalArgumentException | If the data point is null. |
---|---|
IllegalStateException | If an aggregate data point for this data source is already added |
IllegalArgumentException | If the aggregate data point is invalid. |
public SessionInsertRequest.Builder addDataSet (DataSet dataSet)
Adds the specified data set to this request. Only one data set per data source is allowed.
Note: removing the session will not delete the data set. To remove the data that was
inserted along with a session, use
HistoryClient.deleteData(DataDeleteRequest)
.
Note: adding data via this method is no different from inserting the session and
then inserting the DataSet
via
HistoryClient.insertData(DataSet)
separately. Data is only attributed to
sessions via overlap in time, not based on the session with which it was inserted.
Throws
IllegalArgumentException | If the data set is null or empty. |
---|---|
IllegalStateException | If data set for this data source is already added. |
public SessionInsertRequest build ()
Finishes building and returns the request.
Throws
IllegalStateException | If the builder doesn't have enough state to create a valid request |
---|
public SessionInsertRequest.Builder setSession (Session session)
Sets the session for this request.