DataPointContainer


public final class DataPointContainer


Container that provides ease of use methods to access DataPoints in a type safe way.

Example:

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

Summary

Public constructors

DataPointContainer(
    @NonNull List<@NonNull DataPoint<@NonNull ?>> dataPointList
)

Constructs a DataPointContainer using a list of DataPoints.

Public methods

final @NonNull List<@NonNull CumulativeDataPoint<@NonNull ?>>

Returns all CumulativeDataPoints contained in this update.

final D
<T extends Number, D extends DataPoint<@NonNull T>> getData(
    @NonNull AggregateDataType<@NonNull T, @NonNull D> type
)

Returns the DataPoint object with a matching aggregate type, otherwise null if exist in this DataPointContainer.

final @NonNull List<@NonNull D>
<T extends Object, D extends DataPoint<@NonNull T>> getData(
    @NonNull DeltaDataType<@NonNull T, @NonNull D> type
)

Returns all DataPoint objects with a matching delta type.

final @NonNull Set<@NonNull DataType<@NonNull ?, @NonNull ?>>

Set of DataTypes contained within this DataPointContainer.

final @NonNull List<@NonNull IntervalDataPoint<@NonNull ?>>

Returns all IntervalDataPoints contained in this update.

final @NonNull List<@NonNull SampleDataPoint<@NonNull ?>>

Returns all SampleDataPoints contained in this update.

final @NonNull List<@NonNull StatisticalDataPoint<@NonNull ?>>

Returns all StatisticalDataPoints contained in this update.

Public constructors

DataPointContainer

public DataPointContainer(
    @NonNull List<@NonNull DataPoint<@NonNull ?>> dataPointList
)

Constructs a DataPointContainer using a list of DataPoints.

DataPointContainer

public DataPointContainer(
    @NonNull Map<@NonNull DataType<@NonNull ?, @NonNull ?>, @NonNull List<@NonNull DataPoint<@NonNull ?>>> dataPoints
)

Public methods

getCumulativeDataPoints

Added in 1.0.0
public final @NonNull List<@NonNull CumulativeDataPoint<@NonNull ?>> getCumulativeDataPoints()

Returns all CumulativeDataPoints contained in this update.

getData

Added in 1.0.0
public final D <T extends Number, D extends DataPoint<@NonNull T>> getData(
    @NonNull AggregateDataType<@NonNull T, @NonNull D> type
)

Returns the DataPoint object with a matching aggregate type, otherwise null if exist in this DataPointContainer.

getData

Added in 1.0.0
public final @NonNull List<@NonNull D> <T extends Object, D extends DataPoint<@NonNull T>> getData(
    @NonNull DeltaDataType<@NonNull T, @NonNull D> type
)

Returns all DataPoint objects with a matching delta type.

getDataTypes

Added in 1.0.0
public final @NonNull Set<@NonNull DataType<@NonNull ?, @NonNull ?>> getDataTypes()

Set of DataTypes contained within this DataPointContainer.

getIntervalDataPoints

Added in 1.0.0
public final @NonNull List<@NonNull IntervalDataPoint<@NonNull ?>> getIntervalDataPoints()

Returns all IntervalDataPoints contained in this update.

getSampleDataPoints

Added in 1.0.0
public final @NonNull List<@NonNull SampleDataPoint<@NonNull ?>> getSampleDataPoints()

Returns all SampleDataPoints contained in this update.

getStatisticalDataPoints

Added in 1.0.0
public final @NonNull List<@NonNull StatisticalDataPoint<@NonNull ?>> getStatisticalDataPoints()

Returns all StatisticalDataPoints contained in this update.