Class ConcurrentReferenceHashMap.Builder<K,V> 
java.lang.Object
org.apache.commons.collections4.map.ConcurrentReferenceHashMap.Builder<K,V> 
- Type Parameters:
- K- the type of keys.
- V- the type of values.
- All Implemented Interfaces:
- Supplier<ConcurrentReferenceHashMap<K,- V>> 
- Enclosing class:
- ConcurrentReferenceHashMap<K,- V> 
public static class ConcurrentReferenceHashMap.Builder<K,V> 
extends Object
implements Supplier<ConcurrentReferenceHashMap<K,V>> 
Builds new ConcurrentReferenceHashMap instances.
 
By default, keys are weak, and values are strong.
The default values are:
- concurrency level: 16
- initial capacity: 16
- key reference type: ConcurrentReferenceHashMap.ReferenceType.WEAK
- load factor: 0.75f
- options: null
- source map: null
- value reference type: ConcurrentReferenceHashMap.ReferenceType.STRONG
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionget()Builds a newConcurrentReferenceHashMap.setConcurrencyLevel(int concurrencyLevel) Sets the estimated number of concurrently updating threads.setInitialCapacity(int initialCapacity) Sets the initial capacity.setKeyReferenceType(ConcurrentReferenceHashMap.ReferenceType keyReferenceType) Sets the reference type to use for keys.setLoadFactor(float loadFactor) Sets the load factor factor, used to control resizing.Sets the behavioral options.setSourceMap(Map<? extends K, ? extends V> sourceMap) Sets the values to load into a new map.setValueReferenceType(ConcurrentReferenceHashMap.ReferenceType valueReferenceType) Sets the reference type to use for values.softKeys()Sets key reference type toConcurrentReferenceHashMap.ReferenceType.SOFT.Sets value reference type toConcurrentReferenceHashMap.ReferenceType.SOFT.Sets key reference type toConcurrentReferenceHashMap.ReferenceType.STRONG.Sets value reference type toConcurrentReferenceHashMap.ReferenceType.STRONG.weakKeys()Sets key reference type toConcurrentReferenceHashMap.ReferenceType.WEAK.Sets value reference type toConcurrentReferenceHashMap.ReferenceType.WEAK.
- 
Constructor Details- 
Builderpublic Builder()Constructs a new instances ofConcurrentReferenceHashMap.
 
- 
- 
Method Details- 
getBuilds a newConcurrentReferenceHashMap.By default, keys are weak, and values are strong. The default values are: - concurrency level: 16
- initial capacity: 16
- key reference type: ConcurrentReferenceHashMap.ReferenceType.WEAK
- load factor: 0.75f
- options: null
- source map: null
- value reference type: ConcurrentReferenceHashMap.ReferenceType.STRONG
 
- 
setConcurrencyLevelSets the estimated number of concurrently updating threads. The implementation performs internal sizing to try to accommodate this many threads.- Parameters:
- concurrencyLevel- estimated number of concurrently updating threads
- Returns:
- this instance.
 
- 
setInitialCapacitySets the initial capacity. The implementation performs internal sizing to accommodate this many elements.- Parameters:
- initialCapacity- the initial capacity.
- Returns:
- this instance.
 
- 
setKeyReferenceTypepublic ConcurrentReferenceHashMap.Builder<K,V> setKeyReferenceType(ConcurrentReferenceHashMap.ReferenceType keyReferenceType) Sets the reference type to use for keys.- Parameters:
- keyReferenceType- the reference type to use for keys.
- Returns:
- this instance.
 
- 
setLoadFactorSets the load factor factor, used to control resizing. Resizing may be performed when the average number of elements per bin exceeds this threshold.- Parameters:
- loadFactor- the load factor factor, used to control resizing
- Returns:
- this instance.
 
- 
setOptionspublic ConcurrentReferenceHashMap.Builder<K,V> setOptions(EnumSet<ConcurrentReferenceHashMap.Option> options) Sets the behavioral options.- Parameters:
- options- the behavioral options.
- Returns:
- this instance.
 
- 
setSourceMapSets the values to load into a new map.- Parameters:
- sourceMap- the values to load into a new map.
- Returns:
- this instance.
 
- 
setValueReferenceTypepublic ConcurrentReferenceHashMap.Builder<K,V> setValueReferenceType(ConcurrentReferenceHashMap.ReferenceType valueReferenceType) Sets the reference type to use for values.- Parameters:
- valueReferenceType- the reference type to use for values.
- Returns:
- this instance.
 
- 
softKeysSets key reference type toConcurrentReferenceHashMap.ReferenceType.SOFT.- Returns:
- this instance.
 
- 
softValuesSets value reference type toConcurrentReferenceHashMap.ReferenceType.SOFT.- Returns:
- this instance.
 
- 
strongKeysSets key reference type toConcurrentReferenceHashMap.ReferenceType.STRONG.- Returns:
- this instance.
 
- 
strongValuesSets value reference type toConcurrentReferenceHashMap.ReferenceType.STRONG.- Returns:
- this instance.
 
- 
weakKeysSets key reference type toConcurrentReferenceHashMap.ReferenceType.WEAK.- Returns:
- this instance.
 
- 
weakValuesSets value reference type toConcurrentReferenceHashMap.ReferenceType.WEAK.- Returns:
- this instance.
 
 
-