public interface CloseableWrappedIterable<T> extends CloseableIterable<T>, AutoCloseable
CloseableIterator but also can be closed itself. This allows us to do something like this pattern:
try (CloseableWrappedIterable<Foo> wrapperIterable = fooDao.getCloseableIterable();) {
for (Foo foo : wrapperIterable) {
...
}
}
| Modifier and Type | Method and Description |
|---|---|
void |
close()
This will close the iterator that was wrapped.
|
closeableIteratorforEach, iterator, spliteratorvoid close()
throws Exception
close in interface AutoCloseableExceptionThis documentation is licensed by Gray Watson under the Creative Commons Attribution-Share Alike 3.0 License.