From b870095bea056a8e5b36a0a201db76457706b54f Mon Sep 17 00:00:00 2001 From: Marc Baloup Date: Mon, 6 Apr 2020 00:42:07 +0200 Subject: [PATCH] readd Suggestions.fromIntRange --- src/main/java/fr/pandacube/util/commands/Suggestions.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/main/java/fr/pandacube/util/commands/Suggestions.java b/src/main/java/fr/pandacube/util/commands/Suggestions.java index 363e804..765f0a4 100644 --- a/src/main/java/fr/pandacube/util/commands/Suggestions.java +++ b/src/main/java/fr/pandacube/util/commands/Suggestions.java @@ -7,6 +7,7 @@ import java.util.Collections; import java.util.List; import java.util.function.Predicate; import java.util.stream.Collectors; +import java.util.stream.IntStream; import java.util.stream.Stream; @FunctionalInterface @@ -73,6 +74,12 @@ public interface Suggestions { }; } + public static Suggestions fromIntRange(int min, int max) { + return (s, ti, token, a) -> { + return collectFilteredStream(IntStream.range(min, max + 1).mapToObj(Integer::toString), token); + }; + } + /**