Package com.mysql.cj.xdevapi
Class AbstractDataResult<T>
java.lang.Object
com.mysql.cj.xdevapi.AbstractDataResult<T>
- Type Parameters:
T- Result entry type
- All Implemented Interfaces:
ResultStreamer,QueryResult,Result,java.util.Iterator<T>
- Direct Known Subclasses:
DocResultImpl,RowResultImpl
public abstract class AbstractDataResult<T> extends java.lang.Object implements ResultStreamer, java.util.Iterator<T>, Result
Base class for data set results.
-
Field Summary
Fields Modifier and Type Field Description protected java.util.List<T>allList of all elements.protected java.util.function.Supplier<ProtocolEntity>completerprotected intcountprotected StatementExecuteOkokprotected intpositionprotected RowListrowsprotected ProtocolEntityFactory<T,XMessage>rowToData -
Constructor Summary
Constructors Constructor Description AbstractDataResult(RowList rows, java.util.function.Supplier<ProtocolEntity> completer, ProtocolEntityFactory<T,XMessage> rowToData)Constructor. -
Method Summary
Modifier and Type Method Description longcount()Return the number of items in this result.java.util.List<T>fetchAll()Create a list of all elements in the result forcing internal buffering.voidfinishStreaming()Finish the result streaming.longgetAffectedItemsCount()Get the count of affected items from manipulation statements.StatementExecuteOkgetStatementExecuteOk()Get StatementExecuteOk object finalizing the result transfer.java.util.Iterator<Warning>getWarnings()Get warnings generated during statement execution.intgetWarningsCount()Get the number of warnings generated during statement execution.booleanhasNext()Tnext()
-
Field Details
-
Constructor Details
-
AbstractDataResult
public AbstractDataResult(RowList rows, java.util.function.Supplier<ProtocolEntity> completer, ProtocolEntityFactory<T,XMessage> rowToData)Constructor.- Parameters:
rows-RowListobjectcompleter- Supplier for StatementExecuteOk objectrowToData-ProtocolEntityFactory
-
-
Method Details
-
next
- Specified by:
nextin interfacejava.util.Iterator<T>
-
fetchAll
Create a list of all elements in the result forcing internal buffering.- Returns:
- list of result elements
-
count
public long count()Return the number of items in this result. Forces internal buffering of the entire result.- Returns:
- number of elements in result
-
hasNext
public boolean hasNext()- Specified by:
hasNextin interfacejava.util.Iterator<T>
-
getStatementExecuteOk
Get StatementExecuteOk object finalizing the result transfer. Forces internal buffering of the entire result.- Returns:
- StatementExecuteOk object
-
finishStreaming
public void finishStreaming()Description copied from interface:ResultStreamerFinish the result streaming. This happens if a new command is started or the warnings/etc are requested. This is safe to call multiple times and only has an effect the first time.- Specified by:
finishStreamingin interfaceResultStreamer
-
getAffectedItemsCount
public long getAffectedItemsCount()Description copied from interface:ResultGet the count of affected items from manipulation statements. This method forces internal buffering of the result.- Specified by:
getAffectedItemsCountin interfaceResult- Returns:
- count
-
getWarningsCount
public int getWarningsCount()Description copied from interface:ResultGet the number of warnings generated during statement execution. This method forces internal buffering of the result.- Specified by:
getWarningsCountin interfaceResult- Returns:
- number of warnings
-
getWarnings
Description copied from interface:ResultGet warnings generated during statement execution. This method forces internal buffering of the result.- Specified by:
getWarningsin interfaceResult- Returns:
- iterator over warnings
-