public class CacheCollectors
extends java.lang.Object
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.| Modifier and Type | Method and Description |
|---|---|
static <T,R> java.util.stream.Collector<T,?,R> |
collector(java.util.function.Supplier<java.util.stream.Collector<T,?,R>> supplier)
Similar to
serializableCollector(SerializableSupplier) except that the supplier provided
must be marshable through ISPN marshalling techniques. |
static <T,R> java.util.stream.Collector<T,?,R> |
serializableCollector(SerializableSupplier<java.util.stream.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.
|
public static <T,R> java.util.stream.Collector<T,?,R> serializableCollector(SerializableSupplier<java.util.stream.Collector<T,?,R>> supplier)
T - The input type of the collectorR - The resulting type of the collectorsupplier - The supplier to crate the collector that is specifically serializableSerializableSupplierpublic static <T,R> java.util.stream.Collector<T,?,R> collector(java.util.function.Supplier<java.util.stream.Collector<T,?,R>> supplier)
serializableCollector(SerializableSupplier) except that the supplier provided
must be marshable through ISPN marshalling techniques. Note this is not detected until runtime.T - The input type of the collectorR - The resulting type of the collectorsupplier - The marshallable supplier of collectorsExternalizer,
AdvancedExternalizer