Package org.jdbi.v3.core.result
Interface ResultIterator<T>
-
- All Superinterfaces:
java.lang.AutoCloseable,java.io.Closeable,java.util.Iterator<T>
- All Known Implementing Classes:
ResultIterable.ResultIteratorDelegate,ResultSetResultIterator
public interface ResultIterator<T> extends java.util.Iterator<T>, java.io.CloseableRepresents a forward-only iterator over a result set, which will lazily iterate the results. The underlyingResultSetcan be closed by calling theclose()method.The default implementation of
ResultIteratorwill automatically close the result set after the last element has been retrieved vianext()andhasNext()is called (which will return false). This allows for iteration over the results with automagic resource cleanup.The
remove()operation is not supported in the default version, and will raise anUnsupportedOperationException
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description voidclose()Close the underlying result set.default voidforEachRemaining(java.util.function.Consumer<? super T> action)StatementContextgetContext()Returns the currentStatementContext.
-
-
-
Method Detail
-
forEachRemaining
default void forEachRemaining(java.util.function.Consumer<? super T> action)
- Specified by:
forEachRemainingin interfacejava.util.Iterator<T>
-
close
void close()
Close the underlying result set.- Specified by:
closein interfacejava.lang.AutoCloseable- Specified by:
closein interfacejava.io.Closeable
-
getContext
StatementContext getContext()
Returns the currentStatementContext.- Returns:
- the current
StatementContext.
-
-