readd Suggestions.fromIntRange
This commit is contained in:
parent
057f5e8cfa
commit
b870095bea
@ -7,6 +7,7 @@ import java.util.Collections;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.function.Predicate;
|
import java.util.function.Predicate;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
import java.util.stream.IntStream;
|
||||||
import java.util.stream.Stream;
|
import java.util.stream.Stream;
|
||||||
|
|
||||||
@FunctionalInterface
|
@FunctionalInterface
|
||||||
@ -73,6 +74,12 @@ public interface Suggestions<S> {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static <S> Suggestions<S> fromIntRange(int min, int max) {
|
||||||
|
return (s, ti, token, a) -> {
|
||||||
|
return collectFilteredStream(IntStream.range(min, max + 1).mapToObj(Integer::toString), token);
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user