All Downloads are FREE. Search and download functionalities are using the official Maven repository.

net.ravendb.client.documents.queries.timeSeries.TimeSeriesAggregationResult Maven / Gradle / Ivy

There is a newer version: 6.0.1
Show newest version
package net.ravendb.client.documents.queries.timeSeries;

import com.fasterxml.jackson.annotation.JsonProperty;

import java.util.Arrays;

public class TimeSeriesAggregationResult extends TimeSeriesQueryResult {
    @JsonProperty("Results")
    private TimeSeriesRangeAggregation[] results;

    public TimeSeriesRangeAggregation[] getResults() {
        return results;
    }

    public void setResults(TimeSeriesRangeAggregation[] results) {
        this.results = results;
    }

    @SuppressWarnings("unchecked")
    public  TypedTimeSeriesAggregationResult asTypedResult(Class clazz) {
        TypedTimeSeriesAggregationResult result = new TypedTimeSeriesAggregationResult<>();
        result.setCount(getCount());

        result.setResults(Arrays.stream(results)
                .map(x -> x.asTypedEntry(clazz))
                .toArray(TypedTimeSeriesRangeAggregation[]::new));

        return result;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy