group list of time series tendencies

This commit is contained in:
Anton Romanov 2023-02-27 23:20:45 +04:00
parent d4080e69c1
commit 151d44b362

View File

@ -45,7 +45,11 @@ public class TimeSeriesService {
} }
public List<TimeSeries> getGroupedTendencies(List<TimeSeries> timeSeriesList) { public List<TimeSeries> getGroupedTendencies(List<TimeSeries> timeSeriesList) {
return timeSeriesList.stream().map(this::getGroupedTendencies).collect(Collectors.toList()); return timeSeriesList
.stream()
.filter(ts -> ts.getValues() != null && ts.getLength() > 5)
.map(this::getGroupedTendencies)
.collect(Collectors.toList());
} }
public TimeSeries getGroupedTendencies(TimeSeries timeSeries) { public TimeSeries getGroupedTendencies(TimeSeries timeSeries) {