net.ravendb.client.documents.queries.timeSeries.TimeSeriesRawResult Maven / Gradle / Ivy
package net.ravendb.client.documents.queries.timeSeries;
import com.fasterxml.jackson.annotation.JsonProperty;
import net.ravendb.client.documents.session.timeSeries.TimeSeriesEntry;
import net.ravendb.client.documents.session.timeSeries.TypedTimeSeriesEntry;
import java.util.Arrays;
public class TimeSeriesRawResult extends TimeSeriesQueryResult {
@JsonProperty("Results")
private TimeSeriesEntry[] results;
public TimeSeriesEntry[] getResults() {
return results;
}
public void setResults(TimeSeriesEntry[] results) {
this.results = results;
}
@SuppressWarnings("unchecked")
public TypedTimeSeriesRawResult asTypedResult(Class clazz) {
TypedTimeSeriesRawResult result = new TypedTimeSeriesRawResult<>();
result.setCount(getCount());
result.setResults(Arrays
.stream(results)
.map(x -> x.asTypedEntry(clazz))
.toArray(TypedTimeSeriesEntry[]::new));
return result;
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy