Package org.infinispan.stream
Class CacheCollectors
java.lang.Object
org.infinispan.stream.CacheCollectors
Helper class designed to be used to create a serializable Collector for use with
CacheStream.collect(Collector)
from a supplier of a collector. The problem is that the
standard Collectors
class doesn't provide Serializable Collectors and no way to extend
their functionality, so this class is used instead.-
Method Summary
Modifier and TypeMethodDescriptionstatic <T,
R> Collector <T, ?, R> Similar toserializableCollector(SerializableSupplier)
except that the supplier provided must be marshable through ISPN marshalling techniques.static <T,
R> Collector <T, ?, R> serializableCollector
(SerializableSupplier<Collector<T, ?, R>> supplier) Creates a collector that is serializable and will upon usage create a collector using the serializable supplier provided by the user.
-
Method Details
-
serializableCollector
public static <T,R> Collector<T,?, serializableCollectorR> (SerializableSupplier<Collector<T, ?, R>> supplier) Creates a collector that is serializable and will upon usage create a collector using the serializable supplier provided by the user.- Type Parameters:
T
- The input type of the collectorR
- The resulting type of the collector- Parameters:
supplier
- The supplier to crate the collector that is specifically serializable- Returns:
- the collector which is serializable
- See Also:
-
collector
Similar toserializableCollector(SerializableSupplier)
except that the supplier provided must be marshable through ISPN marshalling techniques. Note this is not detected until runtime.- Type Parameters:
T
- The input type of the collectorR
- The resulting type of the collector- Parameters:
supplier
- The marshallable supplier of collectors- Returns:
- the collector which is serializable
- See Also:
-