Class LayerManager.Builder<T extends BloomFilter<T>>
- java.lang.Object
-
- org.apache.commons.collections4.bloomfilter.LayerManager.Builder<T>
-
- Type Parameters:
T- theBloomFiltertype.
- All Implemented Interfaces:
java.util.function.Supplier<LayerManager<T>>
- Enclosing class:
- LayerManager<T extends BloomFilter<T>>
public static class LayerManager.Builder<T extends BloomFilter<T>> extends java.lang.Object implements java.util.function.Supplier<LayerManager<T>>
Builds new instances ofLayerManager.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description LayerManager<T>get()Builds the layer manager with the specified properties.LayerManager.Builder<T>setCleanup(java.util.function.Consumer<java.util.Deque<T>> cleanup)Sets the Consumer that cleans the list of Bloom filters.LayerManager.Builder<T>setExtendCheck(java.util.function.Predicate<LayerManager<T>> extendCheck)Sets the extendCheck predicate.LayerManager.Builder<T>setSupplier(java.util.function.Supplier<T> supplier)Sets the supplier of Bloom filters.
-
-
-
Method Detail
-
get
public LayerManager<T> get()
Builds the layer manager with the specified properties.- Specified by:
getin interfacejava.util.function.Supplier<T extends BloomFilter<T>>- Returns:
- a new LayerManager.
-
setCleanup
public LayerManager.Builder<T> setCleanup(java.util.function.Consumer<java.util.Deque<T>> cleanup)
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:
thisinstance.
-
setExtendCheck
public LayerManager.Builder<T> setExtendCheck(java.util.function.Predicate<LayerManager<T>> extendCheck)
Sets the extendCheck predicate. When the predicate returnstruea new target will be created.- Parameters:
extendCheck- The predicate to determine if a new target should be created.- Returns:
thisinstance.
-
setSupplier
public LayerManager.Builder<T> setSupplier(java.util.function.Supplier<T> supplier)
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:
thisinstance.
-
-