Class LayerManager.Builder<T extends BloomFilter<T>>
java.lang.Object
org.apache.commons.collections4.bloomfilter.LayerManager.Builder<T>
- Type Parameters:
T
- theBloomFilter
type.
- All Implemented Interfaces:
Supplier<LayerManager<T>>
- Enclosing class:
LayerManager<T extends BloomFilter<T>>
public static class LayerManager.Builder<T extends BloomFilter<T>>
extends Object
implements Supplier<LayerManager<T>>
Builds new instances of
LayerManager
.-
Method Summary
Modifier and TypeMethodDescriptionget()
Builds the layer manager with the specified properties.setCleanup
(Consumer<Deque<T>> cleanup) Sets the Consumer that cleans the list of Bloom filters.setExtendCheck
(Predicate<LayerManager<T>> extendCheck) Sets the extendCheck predicate.setSupplier
(Supplier<T> supplier) Sets the supplier of Bloom filters.
-
Method Details
-
get
Builds the layer manager with the specified properties.- Specified by:
get
in interfaceSupplier<T extends BloomFilter<T>>
- Returns:
- a new LayerManager.
-
setCleanup
Sets the Consumer that cleans the list of Bloom filters.- Parameters:
cleanup
- the Consumer that will modify the list of filters removing out dated or stale filters.- Returns:
this
instance.
-
setExtendCheck
Sets the extendCheck predicate. When the predicate returnstrue
a new target will be created.- Parameters:
extendCheck
- The predicate to determine if a new target should be created.- Returns:
this
instance.
-
setSupplier
Sets the supplier of Bloom filters. When extendCheck creates a new target, the supplier provides the instance of the Bloom filter.- Parameters:
supplier
- The supplier of new Bloom filter instances.- Returns:
this
instance.
-