From 151d44b3628cec4f077d21dd7955a49f7710b8db Mon Sep 17 00:00:00 2001 From: Anton Romanov Date: Mon, 27 Feb 2023 23:20:45 +0400 Subject: [PATCH] group list of time series tendencies --- src/main/java/ru/ulstu/service/TimeSeriesService.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/main/java/ru/ulstu/service/TimeSeriesService.java b/src/main/java/ru/ulstu/service/TimeSeriesService.java index e9bf4b0..d7b4920 100644 --- a/src/main/java/ru/ulstu/service/TimeSeriesService.java +++ b/src/main/java/ru/ulstu/service/TimeSeriesService.java @@ -45,7 +45,11 @@ public class TimeSeriesService { } public List getGroupedTendencies(List 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) {