# IntervalDataPoint

Artifact: [androidx.health:health-services-client](https://developer.android.com/jetpack/androidx/releases/health) [View Source](https://cs.android.com/search?q=file:androidx/health/services/client/data/IntervalDataPoint.kt+class:androidx.health.services.client.data.IntervalDataPoint) Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/health#1.0.0)

*** ** * ** ***


```
public final class IntervalDataPoint<T extends Object> extends DataPoint<@NonNull T>
```

<br />

|---|---|---|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object.html) |||
| ↳ | [androidx.health.services.client.data.DataPoint](https://developer.android.com/reference/androidx/health/services/client/data/DataPoint)\<@[NonNull](https://developer.android.com/reference/androidx/annotation/NonNull) T\> ||
|   | ↳ | [androidx.health.services.client.data.IntervalDataPoint](https://developer.android.com/reference/androidx/health/services/client/data/IntervalDataPoint) |

*** ** * ** ***

Data point that includes just the delta from the previous data point for `https://developer.android.com/reference/androidx/health/services/client/data/IntervalDataPoint#dataType()`.

## Summary

| ### Public constructors |
|---|
| `<T extends https://developer.android.com/reference/java/lang/Object.html> https://developer.android.com/reference/androidx/health/services/client/data/IntervalDataPoint#IntervalDataPoint(androidx.health.services.client.data.DataType,kotlin.Any,java.time.Duration,java.time.Duration,android.os.Bundle,androidx.health.services.client.data.DataPointAccuracy)( @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/health/services/client/data/DataType<@https://developer.android.com/reference/androidx/annotation/NonNull T, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/health/services/client/data/IntervalDataPoint<@https://developer.android.com/reference/androidx/annotation/NonNull T>> dataType, @https://developer.android.com/reference/androidx/annotation/NonNull T value, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/time/Duration.html startDurationFromBoot, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/time/Duration.html endDurationFromBoot, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/os/Bundle.html metadata, https://developer.android.com/reference/androidx/health/services/client/data/DataPointAccuracy accuracy )` |

| ### Public methods |
|---|---|
| `boolean` | `https://developer.android.com/reference/androidx/health/services/client/data/IntervalDataPoint#equals(kotlin.Any)(https://developer.android.com/reference/java/lang/Object.html other)` |
| `final https://developer.android.com/reference/androidx/health/services/client/data/DataPointAccuracy` | `https://developer.android.com/reference/androidx/health/services/client/data/IntervalDataPoint#getAccuracy()()` Accuracy of this DataPoint. |
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/health/services/client/data/DataType<@https://developer.android.com/reference/androidx/annotation/NonNull T, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/health/services/client/data/IntervalDataPoint<@https://developer.android.com/reference/androidx/annotation/NonNull T>>` | `https://developer.android.com/reference/androidx/health/services/client/data/IntervalDataPoint#getDataType()()` The `https://developer.android.com/reference/androidx/health/services/client/data/DataType` this `https://developer.android.com/reference/androidx/health/services/client/data/DataPoint` represents. |
| `final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/time/Duration.html` | `https://developer.android.com/reference/androidx/health/services/client/data/IntervalDataPoint#getEndDurationFromBoot()()` The end of the time period this `https://developer.android.com/reference/androidx/health/services/client/data/DataPoint` represents. |
| `final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/time/Instant.html` | `https://developer.android.com/reference/androidx/health/services/client/data/IntervalDataPoint#getEndInstant(java.time.Instant)(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/time/Instant.html bootInstant)` Returns the end `https://developer.android.com/reference/java/time/Instant.html` of this `https://developer.android.com/reference/androidx/health/services/client/data/DataPoint`, knowing the time at which the system booted. |
| `final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/os/Bundle.html` | `https://developer.android.com/reference/androidx/health/services/client/data/IntervalDataPoint#getMetadata()()` OEM specific data. |
| `final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/time/Duration.html` | `https://developer.android.com/reference/androidx/health/services/client/data/IntervalDataPoint#getStartDurationFromBoot()()` The beginning of the time period this `https://developer.android.com/reference/androidx/health/services/client/data/DataPoint` represents. |
| `final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/time/Instant.html` | `https://developer.android.com/reference/androidx/health/services/client/data/IntervalDataPoint#getStartInstant(java.time.Instant)(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/time/Instant.html bootInstant)` Returns the start `https://developer.android.com/reference/java/time/Instant.html` of this `https://developer.android.com/reference/androidx/health/services/client/data/DataPoint`, knowing the time at which the system booted. |
| `final @https://developer.android.com/reference/androidx/annotation/NonNull T` | `https://developer.android.com/reference/androidx/health/services/client/data/IntervalDataPoint#getValue()()` The value of this data point. |
| `int` | `https://developer.android.com/reference/androidx/health/services/client/data/IntervalDataPoint#hashCode()()` |

## 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](https://developer.android.com/jetpack/androidx/releases/health#1.0.0)

```
public final DataPointAccuracy getAccuracy()
```

Accuracy of this DataPoint.

### getDataType

```
public @NonNull DataType<@NonNull T, @NonNull IntervalDataPoint<@NonNull T>> getDataType()
```

The `https://developer.android.com/reference/androidx/health/services/client/data/DataType` this `https://developer.android.com/reference/androidx/health/services/client/data/DataPoint` represents.

### getEndDurationFromBoot

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/health#1.0.0)

```
public final @NonNull Duration getEndDurationFromBoot()
```

The end of the time period this `https://developer.android.com/reference/androidx/health/services/client/data/DataPoint` represents.

### getEndInstant

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/health#1.0.0)

```
public final @NonNull Instant getEndInstant(@NonNull Instant bootInstant)
```

Returns the end `https://developer.android.com/reference/java/time/Instant.html` of this `https://developer.android.com/reference/androidx/health/services/client/data/DataPoint`, knowing the time at which the system booted.

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/time/Instant.html bootInstant` | the `https://developer.android.com/reference/java/time/Instant.html` at which the system booted, this can be computed by `Instant.ofEpochMilli(System.currentTimeMillis() - SystemClock.elapsedRealtime())` |

### getMetadata

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/health#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](https://developer.android.com/jetpack/androidx/releases/health#1.0.0)

```
public final @NonNull Duration getStartDurationFromBoot()
```

The beginning of the time period this `https://developer.android.com/reference/androidx/health/services/client/data/DataPoint` represents.

### getStartInstant

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/health#1.0.0)

```
public final @NonNull Instant getStartInstant(@NonNull Instant bootInstant)
```

Returns the start `https://developer.android.com/reference/java/time/Instant.html` of this `https://developer.android.com/reference/androidx/health/services/client/data/DataPoint`, knowing the time at which the system booted.

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/time/Instant.html bootInstant` | the `https://developer.android.com/reference/java/time/Instant.html` at which the system booted, this can be computed by `Instant.ofEpochMilli(System.currentTimeMillis() - SystemClock.elapsedRealtime()) ` |

### getValue

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/health#1.0.0)

```
public final @NonNull T getValue()
```

The value of this data point.

### hashCode

```
public int hashCode()
```