# DataPointContainer

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/DataPointContainer.kt+class:androidx.health.services.client.data.DataPointContainer) Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/health#1.0.0)

*** ** * ** ***

<br />

```
class DataPointContainer
```

<br />

*** ** * ** ***

Container that provides ease of use methods to access `https://developer.android.com/reference/kotlin/androidx/health/services/client/data/DataPoint`s in a type safe way.

Example:

```kotlin
dataPointContainer.getData(DataType.LOCATION).forEach { location ->
  Log.d(TAG, "location = ${location.latitude}, ${location.longitude}")
}
```

## Summary

| ### Public constructors |
|---|
| `https://developer.android.com/reference/kotlin/androidx/health/services/client/data/DataPointContainer#DataPointContainer(kotlin.collections.List)(dataPointList: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html<https://developer.android.com/reference/kotlin/androidx/health/services/client/data/DataPoint<*>>)` Constructs a `https://developer.android.com/reference/kotlin/androidx/health/services/client/data/DataPointContainer` using a list of `https://developer.android.com/reference/kotlin/androidx/health/services/client/data/DataPoint`s. |
| `https://developer.android.com/reference/kotlin/androidx/health/services/client/data/DataPointContainer#DataPointContainer(kotlin.collections.Map)(dataPoints: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-map/index.html<https://developer.android.com/reference/kotlin/androidx/health/services/client/data/DataType<*, *>, https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html<https://developer.android.com/reference/kotlin/androidx/health/services/client/data/DataPoint<*>>>)` |

| ### Public functions |
|---|---|
| `D?` | `<T : https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-number/index.html, D : https://developer.android.com/reference/kotlin/androidx/health/services/client/data/DataPoint<T>> https://developer.android.com/reference/kotlin/androidx/health/services/client/data/DataPointContainer#getData(androidx.health.services.client.data.AggregateDataType)(type: https://developer.android.com/reference/kotlin/androidx/health/services/client/data/AggregateDataType<T, D>)` Returns the `https://developer.android.com/reference/kotlin/androidx/health/services/client/data/DataPoint` object with a matching aggregate `https://developer.android.com/reference/kotlin/androidx/health/services/client/data/DataPointContainer#getData(androidx.health.services.client.data.AggregateDataType)`, otherwise `null` if exist in this `https://developer.android.com/reference/kotlin/androidx/health/services/client/data/DataPointContainer`. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html<D>` | `<T : https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html, D : https://developer.android.com/reference/kotlin/androidx/health/services/client/data/DataPoint<T>> https://developer.android.com/reference/kotlin/androidx/health/services/client/data/DataPointContainer#getData(androidx.health.services.client.data.DeltaDataType)(type: https://developer.android.com/reference/kotlin/androidx/health/services/client/data/DeltaDataType<T, D>)` Returns all `https://developer.android.com/reference/kotlin/androidx/health/services/client/data/DataPoint` objects with a matching delta `https://developer.android.com/reference/kotlin/androidx/health/services/client/data/DataPointContainer#getData(androidx.health.services.client.data.DeltaDataType)`. |

| ### Public properties |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html<https://developer.android.com/reference/kotlin/androidx/health/services/client/data/CumulativeDataPoint<*>>` | `https://developer.android.com/reference/kotlin/androidx/health/services/client/data/DataPointContainer#cumulativeDataPoints()` Returns all `https://developer.android.com/reference/kotlin/androidx/health/services/client/data/CumulativeDataPoint`s contained in this update. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-set/index.html<https://developer.android.com/reference/kotlin/androidx/health/services/client/data/DataType<*, *>>` | `https://developer.android.com/reference/kotlin/androidx/health/services/client/data/DataPointContainer#dataTypes()` Set of `https://developer.android.com/reference/kotlin/androidx/health/services/client/data/DataType`s contained within this `https://developer.android.com/reference/kotlin/androidx/health/services/client/data/DataPointContainer`. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html<https://developer.android.com/reference/kotlin/androidx/health/services/client/data/IntervalDataPoint<*>>` | `https://developer.android.com/reference/kotlin/androidx/health/services/client/data/DataPointContainer#intervalDataPoints()` Returns all `https://developer.android.com/reference/kotlin/androidx/health/services/client/data/IntervalDataPoint`s contained in this update. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html<https://developer.android.com/reference/kotlin/androidx/health/services/client/data/SampleDataPoint<*>>` | `https://developer.android.com/reference/kotlin/androidx/health/services/client/data/DataPointContainer#sampleDataPoints()` Returns all `https://developer.android.com/reference/kotlin/androidx/health/services/client/data/SampleDataPoint`s contained in this update. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html<https://developer.android.com/reference/kotlin/androidx/health/services/client/data/StatisticalDataPoint<*>>` | `https://developer.android.com/reference/kotlin/androidx/health/services/client/data/DataPointContainer#statisticalDataPoints()` Returns all `https://developer.android.com/reference/kotlin/androidx/health/services/client/data/StatisticalDataPoint`s contained in this update. |

## Public constructors

### DataPointContainer

```
DataPointContainer(dataPointList: List<DataPoint<*>>)
```

Constructs a `https://developer.android.com/reference/kotlin/androidx/health/services/client/data/DataPointContainer` using a list of `https://developer.android.com/reference/kotlin/androidx/health/services/client/data/DataPoint`s.

### DataPointContainer

```
DataPointContainer(dataPoints: Map<DataType<*, *>, List<DataPoint<*>>>)
```

## Public functions

### getData

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

```
fun <T : Number, D : DataPoint<T>> getData(type: AggregateDataType<T, D>): D?
```

Returns the `https://developer.android.com/reference/kotlin/androidx/health/services/client/data/DataPoint` object with a matching aggregate `https://developer.android.com/reference/kotlin/androidx/health/services/client/data/DataPointContainer#getData(androidx.health.services.client.data.AggregateDataType)`, otherwise `null` if exist in this `https://developer.android.com/reference/kotlin/androidx/health/services/client/data/DataPointContainer`.

### getData

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

```
fun <T : Any, D : DataPoint<T>> getData(type: DeltaDataType<T, D>): List<D>
```

Returns all `https://developer.android.com/reference/kotlin/androidx/health/services/client/data/DataPoint` objects with a matching delta `https://developer.android.com/reference/kotlin/androidx/health/services/client/data/DataPointContainer#getData(androidx.health.services.client.data.DeltaDataType)`.

## Public properties

### cumulativeDataPoints

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

```
val cumulativeDataPoints: List<CumulativeDataPoint<*>>
```

Returns all `https://developer.android.com/reference/kotlin/androidx/health/services/client/data/CumulativeDataPoint`s contained in this update.

### dataTypes

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

```
val dataTypes: Set<DataType<*, *>>
```

Set of `https://developer.android.com/reference/kotlin/androidx/health/services/client/data/DataType`s contained within this `https://developer.android.com/reference/kotlin/androidx/health/services/client/data/DataPointContainer`.

### intervalDataPoints

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

```
val intervalDataPoints: List<IntervalDataPoint<*>>
```

Returns all `https://developer.android.com/reference/kotlin/androidx/health/services/client/data/IntervalDataPoint`s contained in this update.

### sampleDataPoints

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

```
val sampleDataPoints: List<SampleDataPoint<*>>
```

Returns all `https://developer.android.com/reference/kotlin/androidx/health/services/client/data/SampleDataPoint`s contained in this update.

### statisticalDataPoints

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

```
val statisticalDataPoints: List<StatisticalDataPoint<*>>
```

Returns all `https://developer.android.com/reference/kotlin/androidx/health/services/client/data/StatisticalDataPoint`s contained in this update.