Package org.jdbi.v3.core.collector
Interface CollectorFactory
- All Known Implementing Classes:
BuiltInCollectorFactory
public interface CollectorFactory
Factory for building Collectors to assemble containers of elements.
The collector produces only objects of the type of the container elements.
-
Method Summary
Modifier and TypeMethodDescriptionboolean
Accept aType
as a collector.Collector
<?, ?, ?> Creates a collector for a given container type.static CollectorFactory
collectorFactory
(Type containerType, Collector<?, ?, ?> collector) Creates aCollectorFactory
from a container type and a collector.static CollectorFactory
collectorFactory
(GenericType<?> containerType, Collector<?, ?, ?> collector) Creates aCollectorFactory
from a parameterized container type and a collector.elementType
(Type containerType) Returns the element type for a given container type.
-
Method Details
-
accepts
Accept aType
as a collector.- Parameters:
containerType
- the container type.- Returns:
- whether this factory can produce a collector for the given container type.
-
elementType
Returns the element type for a given container type.- Parameters:
containerType
- the container type.- Returns:
- the container element type if it can be discovered through reflection; empty otherwise.
- See Also:
-
build
Creates a collector for a given container type.- Parameters:
containerType
- the container type.- Returns:
- a
Collector
for the given container type. - See Also:
-
collectorFactory
Creates aCollectorFactory
from a parameterized container type and a collector.- Parameters:
containerType
- The parameterized container type that the factory should usecollector
- The collector to aassemble container types into a collection- Returns:
- A collection factory instance
- Since:
- 3.38.0
-
collectorFactory
Creates aCollectorFactory
from a container type and a collector.- Parameters:
containerType
- The container type that the factory should usecollector
- The collector to aassemble container types into a collection- Returns:
- A collection factory instance
- Since:
- 3.38.0
-