IntervalDataPoint


public final class IntervalDataPoint<T extends Object> extends DataPoint


Data point that includes just the delta from the previous data point for dataType.

Summary

Public constructors

<T extends Object> IntervalDataPoint(
    @NonNull DataType<@NonNull T, @NonNull IntervalDataPoint<@NonNull T>> dataType,
    @NonNull T value,
    @NonNull Duration startDurationFromBoot,
    @NonNull Duration endDurationFromBoot,
    @NonNull Bundle metadata,
    DataPointAccuracy accuracy
)

Public methods

boolean
equals(Object other)
final DataPointAccuracy

Accuracy of this DataPoint.

@NonNull DataType<@NonNull T, @NonNull IntervalDataPoint<@NonNull T>>

The DataType this DataPoint represents.

final @NonNull Duration

The end of the time period this DataPoint represents.

final @NonNull Instant

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

final @NonNull Bundle

OEM specific data.

final @NonNull Duration

The beginning of the time period this DataPoint represents.

final @NonNull Instant

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

final @NonNull T

The value of this data point.

int

Public constructors

IntervalDataPoint

public <T extends Object> IntervalDataPoint(
    @NonNull DataType<@NonNull T, @NonNull IntervalDataPoint<@NonNull T>> dataType,
    @NonNull T value,
    @NonNull Duration startDurationFromBoot,
    @NonNull Duration endDurationFromBoot,
    @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 IntervalDataPoint<@NonNull T>> getDataType()

The DataType this DataPoint represents.

getEndDurationFromBoot

Added in 1.0.0
public final @NonNull Duration getEndDurationFromBoot()

The end of the time period this DataPoint represents.

getEndInstant

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

Returns the end 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())

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.

getStartDurationFromBoot

Added in 1.0.0
public final @NonNull Duration getStartDurationFromBoot()

The beginning of the time period this DataPoint represents.

getStartInstant

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

Returns the start 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()