Class 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>
    A TransformIterable allows Iterables 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 Detail

      • TransformIterable

        public TransformIterable​(Iterable<? extends I> input)
        Constructs an TransformIterable with the given input Iterable and no validation.
        Parameters:
        input - the input Iterable
      • TransformIterable

        public TransformIterable​(Iterable<? extends I> input,
                                 Validator<I> validator,
                                 boolean skipInvalid)
        Constructs an TransformIterable with the given input Iterable, Validator and a skipInvalid flag to determine whether invalid items should be skipped.
        Parameters:
        input - the input Iterable
        validator - the Validator
        skipInvalid - if true invalid items should be skipped
      • TransformIterable

        public TransformIterable​(Iterable<? extends I> input,
                                 Validator<I> validator,
                                 boolean skipInvalid,
                                 boolean autoClose)
        Constructs an TransformIterable with the given parameters
        Parameters:
        input - the input Iterable
        validator - the Validator
        skipInvalid - if true invalid items should be skipped
        autoClose - if true then the input iterable will be closed when any iterators reach the end.