T
- the Iterable generic typepublic class FilteredIterable<T> extends Object implements Iterable<T>
Iterable
.Modifier | Constructor and Description |
---|---|
protected |
FilteredIterable(Iterable<? extends T> iterable)
Create a new FilteredIterable.
|
Modifier and Type | Method and Description |
---|---|
static <T> FilteredIterable<T> |
empty()
Get an empty FilteredIterable.
|
Iterator<T> |
iterator() |
static <T> FilteredIterable<T> |
of(Iterable<T> iterable)
Get a
FilteredIterable of iterable . |
FilteredIterable<T> |
retain(Class<?>... ofType)
Retain elements of any of specified types.
|
<U> FilteredIterable<U> |
retain(Class<U> type)
Retain elements of a given type with type-safety.
|
FilteredIterable<T> |
retain(Predicate<? super T> filter)
Retain only elements matching
predicate . |
String |
toString() |
protected FilteredIterable(Iterable<? extends T> iterable)
iterable
- wrappedpublic FilteredIterable<T> retain(Predicate<? super T> filter)
predicate
.filter
- filter predicate, non-null
this
, fluentlypublic <U> FilteredIterable<U> retain(Class<U> type)
U
- the input Class generic type.type
- filter, non-null
this
public FilteredIterable<T> retain(Class<?>... ofType)
ofType
- filter, non-null
this
, fluentlypublic static <T> FilteredIterable<T> of(Iterable<T> iterable)
FilteredIterable
of iterable
. If wrapped
is null
,
result will also be null
. A FilteredIterable
argument will be passed back
directly; any other argument will be wrapped in a new FilteredIterable
object.T
- the input iterable generic typeiterable
- wrappedpublic static <T> FilteredIterable<T> empty()
T
- the expected Iterable
generic type.Copyright © 2003–2014 The Apache Software Foundation. All rights reserved.