Class LazyMatchingTypeIterable<T>

  • Type Parameters:
    T - Type of element being selected
    All Implemented Interfaces:
    Iterable<T>

    public class LazyMatchingTypeIterable<T>
    extends Object
    implements Iterable<T>
    Provides a selective Iterable over values that match a specific type out of all available. The "lazy" denomination is due to the fact that the next matching value is calculated on-the-fly every time Iterator.hasNext() is called
    Author:
    Apache MINA SSHD Project
    • Constructor Detail

      • LazyMatchingTypeIterable

        public LazyMatchingTypeIterable​(Iterable<?> values,
                                        Class<T> type)
    • Method Detail

      • getValues

        public Iterable<?> getValues()
      • getType

        public Class<T> getType()
      • lazySelectMatchingTypes

        public static <T> Iterable<T> lazySelectMatchingTypes​(Iterable<?> values,
                                                              Class<T> type)
        Type Parameters:
        T - Type if iterated element
        Parameters:
        values - The source values - ignored if null
        type - The (never @code null) type of values to select - any value whose type is assignable to this type will be selected by the iterator.
        Returns:
        Iterable whose Iterator selects only values matching the specific type. Note: the matching values are not pre-calculated (hence the "lazy" denomination) - i.e., the match is performed only when Iterator.hasNext() is called.