Stopwatch.BuilderBase


@ExperimentalAppSearchApi
class Stopwatch.BuilderBase<T : Stopwatch.BuilderBase<T!>?> : Thing.BuilderBase

Known direct subclasses

Summary

Public constructors

BuilderBase(stopwatch: Stopwatch)

Constructor for Stopwatch.BuilderBase with all the existing values.

BuilderBase(namespace: String, id: String)

Constructor for Stopwatch.BuilderBase.

Public functions

Stopwatch

Builds the Stopwatch.

T
setAccumulatedDurationMillis(accumulatedDurationMillis: Long)

Sets the total duration in milliseconds accumulated by the Stopwatch.

T
setBaseTimeMillis(baseTimeMillis: Long)

Sets the point in time that the Stopwatch counts up from.

T
setBaseTimeMillis(
    baseTimeMillis: Long,
    baseTimeMillisInElapsedRealtime: Long,
    bootCount: Int
)

Sets the point in time that the Stopwatch counts up from.

T
setBaseTimeMillis(
    context: Context,
    baseTimeMillis: Long,
    baseTimeMillisInElapsedRealtime: Long
)

Sets the point in time that the Stopwatch counts up from.

T
setBaseTimeMillisInElapsedRealtime(
    baseTimeMillisInElapsedRealtime: Long
)

Sets the point in time that the Stopwatch counts up from.

T
setBootCount(bootCount: Int)

Sets the boot count of the device.

T

Sets all the StopwatchLap instances.

T
setStatus(status: Int)

Sets the current status.

Inherited functions

From androidx.appsearch.builtintypes.Thing.BuilderBase
T
addAlternateName(alternateName: String)

Adds an alias for the item.

T

Add a new action to the list of potential actions for this document.

T

Clears the aliases, if any, for the item.

T

Clear all the potential actions for this document.

Unit

If built, make a copy of previous data for every field so that the builder can be reused.

T
setAlternateNames(alternateNames: (Mutable)List<String!>?)

Sets a list of aliases for the item.

T
setCreationTimestampMillis(creationTimestampMillis: Long)

Sets the creation timestamp for the current AppSearch entity, in milliseconds using the currentTimeMillis time base.

T
setDescription(description: String?)

Sets the description for the item.

T
setDocumentScore(documentScore: Int)

Sets the user-provided opaque document score of the current AppSearch document, which can be used for ranking using RANKING_STRATEGY_DOCUMENT_SCORE.

T
setDocumentTtlMillis(documentTtlMillis: Long)

Sets the time-to-live (TTL) for the current AppSearch document as a duration in milliseconds.

T

Sets the URL for an image of the item.

T
setName(name: String?)

Sets the name of the item.

T

Sets a list of potential actions for this document.

T
setUrl(url: String?)

Sets the deeplink URL of the item.

Public constructors

BuilderBase

Added in 1.2.0-alpha02
BuilderBase(stopwatch: Stopwatch)

Constructor for Stopwatch.BuilderBase with all the existing values.

Parameters
stopwatch: Stopwatch

The existing Stopwatch to copy values from.

BuilderBase

BuilderBase(namespace: String, id: String)

Constructor for Stopwatch.BuilderBase.

Parameters
namespace: String

Namespace for the Document. See Document.Namespace.

id: String

Unique identifier for the Document. See Document.Id.

Public functions

build

fun build(): Stopwatch

Builds the Stopwatch.

setAccumulatedDurationMillis

Added in 1.2.0-alpha02
fun setAccumulatedDurationMillis(accumulatedDurationMillis: Long): T

Sets the total duration in milliseconds accumulated by the Stopwatch.

setBaseTimeMillis

Added in 1.2.0-alpha02
fun setBaseTimeMillis(baseTimeMillis: Long): T

Sets the point in time that the Stopwatch counts up from. In milliseconds using the currentTimeMillis time base.

setBaseTimeMillis

Added in 1.2.0-alpha02
fun setBaseTimeMillis(
    baseTimeMillis: Long,
    baseTimeMillisInElapsedRealtime: Long,
    bootCount: Int
): T

Sets the point in time that the Stopwatch counts up from.

Base time should be sampled in both the currentTimeMillis and elapsedRealtime time base. In addition, the boot count of the device is needed to check if the elapsedRealtime time base is valid.

Parameters
baseTimeMillis: Long

The base time in milliseconds using the currentTimeMillis time base.

baseTimeMillisInElapsedRealtime: Long

The base time in milliseconds using the elapsedRealtime time base.

bootCount: Int

The current boot count of the device. See BOOT_COUNT.

setBaseTimeMillis

Added in 1.2.0-alpha02
fun setBaseTimeMillis(
    context: Context,
    baseTimeMillis: Long,
    baseTimeMillisInElapsedRealtime: Long
): T

Sets the point in time that the Stopwatch counts up from.

See setBaseTimeMillis.

Parameters
context: Context

The app context used to fetch boot count.

baseTimeMillis: Long

The base time in milliseconds using the currentTimeMillis time base.

baseTimeMillisInElapsedRealtime: Long

The base time in milliseconds using the elapsedRealtime time base.

setBaseTimeMillisInElapsedRealtime

Added in 1.2.0-alpha02
fun setBaseTimeMillisInElapsedRealtime(
    baseTimeMillisInElapsedRealtime: Long
): T

Sets the point in time that the Stopwatch counts up from. In milliseconds using the elapsedRealtime time base.

setBootCount

Added in 1.2.0-alpha02
fun setBootCount(bootCount: Int): T

Sets the boot count of the device.

setLaps

Added in 1.2.0-alpha02
fun setLaps(laps: (Mutable)List<StopwatchLap!>): T

Sets all the StopwatchLap instances.

setStatus

Added in 1.2.0-alpha02
fun setStatus(status: Int): T

Sets the current status.

Status can be STATUS_UNKNOWN, STATUS_RESET, STATUS_RUNNING, or STATUS_PAUSED.