Class ResultReturner
java.lang.Object
org.jdbi.v3.sqlobject.statement.internal.ResultReturner
- Direct Known Subclasses:
ResultReturner.CollectedResultReturner,ResultReturner.ConsumerResultReturner,ResultReturner.IteratorReturner,ResultReturner.ResultIterableReturner,ResultReturner.ResultIteratorReturner,ResultReturner.SingleValueReturner,ResultReturner.StreamReturner,ResultReturner.VoidReturner
Helper class used by the
CustomizingStatementHandlers to assemble
the result Collection, Iterable, etc.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescription(package private) static class(package private) static class(package private) static class(package private) static class(package private) static class(package private) static class(package private) static class(package private) static class(package private) static class(package private) static class(package private) static class(package private) static class -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static ObjectcheckResult(Object result, QualifiedType<?> type) protected abstract QualifiedType<?>elementType(ConfigRegistry config) (package private) static Optional<ResultReturner>findConsumer(Method method) Inspect a Method for aConsumerto execute for each produced row.(package private) static ResultReturnerInspect a Method for its return type, and choose a ResultReturner subclass that handles any container that might wrap the results.(package private) static ResultReturnerforOptionalReturn(Class<?> extensionType, Method method) If the return type isvoid, swallow results.protected abstract ObjectmappedResult(ResultIterable<?> iterable, StatementContext ctx) protected abstract ObjectreducedResult(Stream<?> stream, StatementContext ctx) protected voidwarm(ConfigRegistry config)
-
Constructor Details
-
ResultReturner
ResultReturner()
-
-
Method Details
-
forOptionalReturn
If the return type isvoid, swallow results.- Parameters:
extensionType- The extension type to use.method- The method to use.- Returns:
- A
ResultReturner - See Also:
-
forMethod
Inspect a Method for its return type, and choose a ResultReturner subclass that handles any container that might wrap the results.- Parameters:
extensionType- the type that owns the Methodmethod- the method whose return type chooses the ResultReturner- Returns:
- an instance that takes a ResultIterable and constructs the return value. Never null.
-
findConsumer
Inspect a Method for aConsumerto execute for each produced row.- Parameters:
method- the method called- Returns:
- a ResultReturner that invokes the consumer and does not return a value
-
mappedResult
-
reducedResult
-
elementType
-
warm
-
checkResult
-