Package org.jdbi.v3.core.collector
Class JdbiCollectors
java.lang.Object
org.jdbi.v3.core.collector.JdbiCollectors
- All Implemented Interfaces:
JdbiConfig<JdbiCollectors>
Registry of collector factories.
Contains a set of collector factories, registered by the application.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionReturns a copy of this configuration object.findElementTypeFor
(Type containerType) Returns the element type for the given container type.Obtain a collector for the given type.register
(CollectorFactory factory) Register a newCollectorFactory
.registerCollector
(Type collectionType, Collector<?, ?, ?> collector) Register a newCollector
for the given type.Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.jdbi.v3.core.config.JdbiConfig
setRegistry
-
Constructor Details
-
JdbiCollectors
public JdbiCollectors()
-
-
Method Details
-
register
Register a newCollectorFactory
.- Parameters:
factory
- A collector factory- Returns:
- this
-
registerCollector
Register a newCollector
for the given type.- Parameters:
collectionType
- The type that this collector will returncollector
- ACollector
implementation- Returns:
- this
- Since:
- 3.38.0
- See Also:
-
findFor
Obtain a collector for the given type.- Parameters:
containerType
- the container type.- Returns:
- a Collector for the given container type, or empty null if no collector is registered for the given type.
-
findElementTypeFor
Returns the element type for the given container type.- Parameters:
containerType
- the container type.- Returns:
- the element type for the given container type, if available.
-
createCopy
Description copied from interface:JdbiConfig
Returns a copy of this configuration object. Changes to the copy should not modify the original, and vice-versa.- Specified by:
createCopy
in interfaceJdbiConfig<JdbiCollectors>
- Returns:
- a copy of this configuration object.
-