SampleDataPoint


public final class SampleDataPoint<T extends Object> extends DataPoint


Data point that represents a piece of data that was valid at a single point in time, for example heart rate or speed.

Summary

Public constructors

<T extends Object> SampleDataPoint(
    @NonNull DataType<@NonNull T, @NonNull SampleDataPoint<@NonNull T>> dataType,
    @NonNull T value,
    @NonNull Duration timeDurationFromBoot,
    @NonNull Bundle metadata,
    DataPointAccuracy accuracy
)

Public methods

boolean
equals(Object other)
final DataPointAccuracy

Accuracy of this DataPoint.

@NonNull DataType<@NonNull T, @NonNull SampleDataPoint<@NonNull T>>

The DataType this DataPoint represents.

final @NonNull Bundle

OEM specific data.

final @NonNull Duration

The time this DataPoint represents.

final @NonNull Instant

Returns the time Instant of this DataPoint, knowing the time at which the system booted.

final @NonNull T

The value of this data point.

int

Public constructors

SampleDataPoint

public <T extends Object> SampleDataPoint(
    @NonNull DataType<@NonNull T, @NonNull SampleDataPoint<@NonNull T>> dataType,
    @NonNull T value,
    @NonNull Duration timeDurationFromBoot,
    @NonNull Bundle metadata,
    DataPointAccuracy accuracy
)

Public methods

equals

public boolean equals(Object other)

getAccuracy

Added in 1.0.0
public final DataPointAccuracy getAccuracy()

Accuracy of this DataPoint.

getDataType

Added in 1.1.0-alpha04
public @NonNull DataType<@NonNull T, @NonNull SampleDataPoint<@NonNull T>> getDataType()

The DataType this DataPoint represents.

getMetadata

Added in 1.0.0
public final @NonNull Bundle getMetadata()

OEM specific data. In general, this should not be relied upon by non-preloaded apps.

getTimeDurationFromBoot

Added in 1.0.0
public final @NonNull Duration getTimeDurationFromBoot()

The time this DataPoint represents.

getTimeInstant

Added in 1.0.0
public final @NonNull Instant getTimeInstant(@NonNull Instant bootInstant)

Returns the time Instant of this DataPoint, knowing the time at which the system booted.

Parameters
@NonNull Instant bootInstant

the Instant at which the system booted, this can be computed by Instant.ofEpochMilli(System.currentTimeMillis() - SystemClock.elapsedRealtime())

getValue

Added in 1.0.0
public final @NonNullgetValue()

The value of this data point.

hashCode

public int hashCode()