Package org.infinispan.stream
Class CacheCollectors
- java.lang.Object
-
- org.infinispan.stream.CacheCollectors
-
public class CacheCollectors extends Object
Helper class designed to be used to create a serializable Collector for use withCacheStream.collect(Collector)
from a supplier of a collector. The problem is that the standardCollectors
class doesn't provide Serializable Collectors and no way to extend their functionality, so this class is used instead.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <T,R>
Collector<T,?,R>collector(Supplier<Collector<T,?,R>> supplier)
Similar toserializableCollector(SerializableSupplier)
except that the supplier provided must be marshable through ISPN marshalling techniques.static <T,R>
Collector<T,?,R>serializableCollector(org.infinispan.util.function.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 Detail
-
serializableCollector
public static <T,R> Collector<T,?,R> serializableCollector(org.infinispan.util.function.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:
SerializableSupplier
-
collector
public static <T,R> Collector<T,?,R> collector(Supplier<Collector<T,?,R>> supplier)
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:
Externalizer
,AdvancedExternalizer
-
-