Stopwatch.Builder


@Document.BuilderProducer
public final class Stopwatch.Builder extends Stopwatch.BuilderBase


Builder for Stopwatch.

Summary

Public constructors

Constructor for Stopwatch.Builder with all the existing values.

Builder(@NonNull String namespace, @NonNull String id)

Constructor for Stopwatch.Builder.

Inherited methods

From androidx.appsearch.builtintypes.Stopwatch.BuilderBase
@NonNull Stopwatch

Builds the Stopwatch.

@NonNull T
setAccumulatedDurationMillis(long accumulatedDurationMillis)

Sets the total duration in milliseconds accumulated by the Stopwatch.

@NonNull T
setBaseTimeMillis(long baseTimeMillis)

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

@NonNull T
setBaseTimeMillis(
    long baseTimeMillis,
    long baseTimeMillisInElapsedRealtime,
    int bootCount
)

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

@NonNull T
setBaseTimeMillis(
    @NonNull Context context,
    long baseTimeMillis,
    long baseTimeMillisInElapsedRealtime
)

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

@NonNull T
setBaseTimeMillisInElapsedRealtime(
    long baseTimeMillisInElapsedRealtime
)

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

@NonNull T
setBootCount(int bootCount)

Sets the boot count of the device.

@NonNull T

Sets all the StopwatchLap instances.

@NonNull T
setStatus(int status)

Sets the current status.

From androidx.appsearch.builtintypes.Thing.BuilderBase
@NonNull T

Adds an alias for the item.

@NonNull T

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

@NonNull Thing

Builds a Thing object.

@NonNull T

Clears the aliases, if any, for the item.

@NonNull T

Clear all the potential actions for this document.

void

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

@NonNull T

Sets a list of aliases for the item.

@NonNull T
setCreationTimestampMillis(long creationTimestampMillis)

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

@NonNull T

Sets the description for the item.

@NonNull T
setDocumentScore(int documentScore)

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

@NonNull T
setDocumentTtlMillis(long documentTtlMillis)

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

@NonNull T

Sets the URL for an image of the item.

@NonNull T

Sets the name of the item.

@NonNull T

Sets a list of potential actions for this document.

@NonNull T

Sets the deeplink URL of the item.

Public constructors

Builder

Added in 1.1.0
public Builder(@NonNull Stopwatch stopwatch)

Constructor for Stopwatch.Builder with all the existing values.

Builder

Added in 1.1.0
public Builder(@NonNull String namespace, @NonNull String id)

Constructor for Stopwatch.Builder.

Parameters
@NonNull String namespace

Namespace for the Document. See Document.Namespace.

@NonNull String id

Unique identifier for the Document. See Document.Id.