Class Sequences
- java.lang.Object
-
- org.apache.druid.java.util.common.guava.Sequences
-
public class Sequences extends Object
-
-
Constructor Summary
Constructors Constructor Description Sequences()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <T> Sequence<T>
concat(Iterable<Sequence<T>> sequences)
static <T> Sequence<T>
concat(Sequence<? extends Sequence<T>> sequences)
static <T> Sequence<T>
concat(Sequence<T>... sequences)
static <T> Sequence<T>
empty()
static <T> Sequence<T>
filter(Sequence<T> sequence, com.google.common.base.Predicate<? super T> pred)
static <From,To>
Sequence<To>map(Sequence<From> sequence, com.google.common.base.Function<? super From,? extends To> fn)
static <T> Sequence<T>
simple(Iterable<T> iterable)
static <T> Sequence<T>
sort(Sequence<T> sequence, Comparator<T> comparator)
Returns a sorted copy of the provided sequence.static <T> Sequence<T>
withBaggage(Sequence<T> seq, Closeable baggage)
static <T> Sequence<T>
withEffect(Sequence<T> seq, Runnable effect, Executor exec)
static <T> Sequence<T>
wrap(Sequence<T> seq, SequenceWrapper wrapper)
Allows to execute something before, after or around the processing of the given sequence.
-
-
-
Method Detail
-
empty
public static <T> Sequence<T> empty()
-
concat
@SafeVarargs public static <T> Sequence<T> concat(Sequence<T>... sequences)
-
map
public static <From,To> Sequence<To> map(Sequence<From> sequence, com.google.common.base.Function<? super From,? extends To> fn)
-
filter
public static <T> Sequence<T> filter(Sequence<T> sequence, com.google.common.base.Predicate<? super T> pred)
-
wrap
public static <T> Sequence<T> wrap(Sequence<T> seq, SequenceWrapper wrapper)
Allows to execute something before, after or around the processing of the given sequence. See documentation toSequenceWrapper
methods for some details.
-
withEffect
public static <T> Sequence<T> withEffect(Sequence<T> seq, Runnable effect, Executor exec)
-
sort
public static <T> Sequence<T> sort(Sequence<T> sequence, Comparator<T> comparator)
Returns a sorted copy of the provided sequence. This will materialize the entire sequence in memory. Use at your own risk. The sort is stable, meaning that equal elements (as determined by the comparator) will not be reordered.
-
-