Class LazyMatchingTypeIterable<T>
- java.lang.Object
-
- org.apache.sshd.common.util.helper.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 selectiveIterableover 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 timeIterator.hasNext()is called- Author:
- Apache MINA SSHD Project
-
-
Constructor Summary
Constructors Constructor Description LazyMatchingTypeIterable(Iterable<?> values, Class<T> type)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Class<T>getType()Iterable<?>getValues()Iterator<T>iterator()static <T> Iterable<T>lazySelectMatchingTypes(Iterable<?> values, Class<T> type)StringtoString()-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
-
-
-
Method Detail
-
getValues
public Iterable<?> getValues()
-
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 ifnulltype- 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:
IterablewhoseIteratorselects 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 whenIterator.hasNext()is called.
-
-