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 TypeMethodDescriptionbooleanAccept aTypeas a collector.Collector<?, ?, ?> Creates a collector for a given container type.static CollectorFactorycollectorFactory(Type containerType, Collector<?, ?, ?> collector) Creates aCollectorFactoryfrom a container type and a collector.static CollectorFactorycollectorFactory(GenericType<?> containerType, Collector<?, ?, ?> collector) Creates aCollectorFactoryfrom a parameterized container type and a collector.elementType(Type containerType) Returns the element type for a given container type.
-
Method Details
-
accepts
-
elementType
-
build
-
collectorFactory
Creates aCollectorFactoryfrom 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 aCollectorFactoryfrom 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
-