Package io.debezium.util
Class Iterators
java.lang.Object
io.debezium.util.Iterators
A utility for creating iterators.
- Author:
- Randall Hauch
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic interface
A read only iterator that is able to preview the next value without consuming it or altering the behavior or semantics of the normalIterator
methods.static interface
An iterator that is able to transform its contents to another type. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic <T,
U, V> Iterator<V> around
(Iterable<? extends T> first, Iterable<? extends U> second, BiFunction<T, U, V> conversion) static <V,
T> Iterator<T> static <T,
U, V> Iterator<V> around
(Iterator<? extends T> first, Iterator<? extends U> second, BiFunction<T, U, V> combineFirstAndSecond) static <V,
T> Iterator<T> static <T> Iterable<T>
static <T> Iterator<T>
empty()
static <T> Iterator<T>
static <T> Iterator<T>
static <T> Iterator<T>
static <T> Iterator<T>
static <T> Iterator<T>
static <T> Iterator<T>
static <T> Iterators.PreviewIterator<T>
Get a read-only iterator that can peek at the next value before it is retrieved withIterator.next()
.static <T> Iterator<T>
static <V,
T> Iterator<T> static <V,
T> Iterator<T> static <T> Iterator<T>
static <V,
T> Iterable<T> readOnlyIterable
(Iterable<? extends V> iterable, Function<V, T> conversion) static <T> Iterable<T>
readOnlyIterable
(Iterable<T> iterable) static <T> Iterable<T>
toIterable
(Iterator<T> iterator) static <F,
T> Iterator<T> Transform an iterator from a given type to super types.static <T> Iterator<T>
with
(T value) static <T> Iterator<T>
with
(T[] values) static <T> Iterator<T>
with
(T value1, T value2) static <T> Iterator<T>
with
(T value1, T value2, T value3) static <T> Iterator<T>
with
(T value1, T value2, T value3, T... additional)
-
Constructor Details
-
Iterators
public Iterators()
-
-
Method Details
-
empty
-
with
-
with
-
with
-
with
-
with
-
around
public static <T,U, Iterator<V> aroundV> (Iterable<? extends T> first, Iterable<? extends U> second, BiFunction<T, U, V> conversion) -
around
public static <T,U, Iterator<V> aroundV> (Iterator<? extends T> first, Iterator<? extends U> second, BiFunction<T, U, V> combineFirstAndSecond) -
around
-
around
-
around
-
readOnly
-
readOnly
-
readOnly
-
readOnly
-
readOnlyIterable
-
readOnlyIterable
-
join
-
join
-
join
-
join
-
join
-
join
-
toIterable
- Type Parameters:
T
- the iterator type- Parameters:
iterator
- the source iterator- Returns:
- the iterable
-
transform
public static <F,T> Iterator<T> transform(Iterator<F> fromIterator, Function<? super F, ? extends T> function) Transform an iterator from a given type to super types.- Type Parameters:
F
- the source transform typeT
- the destination transform type- Parameters:
fromIterator
- the source iteratorfunction
- the function to be applied when performing element transformation- Returns:
- the transformed iterator
-
preview
Get a read-only iterator that can peek at the next value before it is retrieved withIterator.next()
.- Parameters:
iter
- the original iterator- Returns:
- the peeking iterator; may be null if
iter
is null
-