Class TransformIterable<I,O>
- java.lang.Object
-
- uk.gov.gchq.gaffer.commonutil.iterable.TransformIterable<I,O>
-
- Type Parameters:
I
- The input iterable type.O
- the output iterable type.
- All Implemented Interfaces:
Closeable
,AutoCloseable
,Iterable<O>
- Direct Known Subclasses:
ValidatedElements
public abstract class TransformIterable<I,O> extends Object implements Closeable, Iterable<O>
ATransformIterable
allowsIterable
s to be lazily validated and transformed without loading the entire iterable into memory. The easiest way to use this class is to create an anonymous inner class.
-
-
Constructor Summary
Constructors Constructor Description TransformIterable(Iterable<? extends I> input)
Constructs anTransformIterable
with the given inputIterable
and no validation.TransformIterable(Iterable<? extends I> input, Validator<I> validator)
TransformIterable(Iterable<? extends I> input, Validator<I> validator, boolean skipInvalid)
TransformIterable(Iterable<? extends I> input, Validator<I> validator, boolean skipInvalid, boolean autoClose)
Constructs anTransformIterable
with the given parameters
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
Iterator<O>
iterator()
-
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
-
-
-
Constructor Detail
-
TransformIterable
public TransformIterable(Iterable<? extends I> input)
Constructs anTransformIterable
with the given inputIterable
and no validation.- Parameters:
input
- the inputIterable
-
TransformIterable
public TransformIterable(Iterable<? extends I> input, Validator<I> validator)
Constructs anTransformIterable
with the given inputIterable
andValidator
. Invalid items will throw anIllegalArgumentException
to be thrown.
-
TransformIterable
public TransformIterable(Iterable<? extends I> input, Validator<I> validator, boolean skipInvalid)
-
-