Builder used to create new Sessions.
Public Constructor Summary
Builder()
Constructs an instance of the
Session.Builder .
|
Public Method Summary
Session |
build()
Finishes building and returns the session.
|
Session.Builder | |
Session.Builder | |
Session.Builder | |
Session.Builder | |
Session.Builder | |
Session.Builder | |
Session.Builder |
Inherited Method Summary
Public Constructors
publicBuilder()
Constructs an instance of theSession.Builder
.
Public Methods
publicSession build()
Finishes building and returns the session. Returned session will always have non-empty non-null identifier.
Throws
IllegalStateException | If the builder doesn't have enough state to create a valid request. |
---|
publicSession.Builder setActiveTime(long time, TimeUnit timeUnit)
Sets the active session period duration.
publicSession.Builder setActivity(Stringactivity)
Sets the activity associated with this session. The specified activity value should
be one of the values inFitnessActivities
.
If an unrecognized value is specified, or if not specified, the activity for the
session is set toFitnessActivities.UNKNOWN
.
publicSession.Builder setDescription(String description)
Sets a description for this session.
publicSession.Builder setEndTime(long time, TimeUnit timeUnit)
Sets the end time of the session. If end time is not specified, session is considered to be still ongoing.
Parameters
time | An end time, in the given unit since epoch, inclusive. |
---|---|
timeUnit | The unit of the timestamp. |
publicSession.Builder setIdentifier(String identifier)
Sets the identifier for this session. Must be unique for the client application.
publicSession.Builder setName(Stringname)
Sets the a human readable name of the session.
publicSession.Builder setStartTime(long time, TimeUnit timeUnit)
Sets the start time of the session.
Parameters
time | A start time, in the given unit since epoch, inclusive. |
---|---|
timeUnit | The unit of the timestamp. |