Class SuppIterator<T>

  • Type Parameters:
    T - Option type
    All Implemented Interfaces:
    Iterator<org.apache.sling.query.api.internal.Option<T>>

    public class SuppIterator<T>
    extends AbstractIterator<org.apache.sling.query.api.internal.Option<T>>
    This iterator returns all elements of the input list which are mapped to non-empty values by the input function. Name is inspired by the support of the function.
    • Constructor Detail

      • SuppIterator

        public SuppIterator​(List<org.apache.sling.query.api.internal.Option<T>> input,
                            org.apache.sling.query.api.internal.IteratorToIteratorFunction<T> function)
    • Method Detail

      • getElement

        protected org.apache.sling.query.api.internal.Option<T> getElement()
        The idea behind this method is that index of each element in the input iterator is passed to the function. One or more Option<T> items for each index will be returned. If any Option<T> item in that index set is not empty then the corresponding element in the input will be returned.
        Specified by:
        getElement in class AbstractIterator<org.apache.sling.query.api.internal.Option<T>>