Class PrivateMaxEntriesMap.Builder<K,V>
java.lang.Object
tools.jackson.databind.util.internal.PrivateMaxEntriesMap.Builder<K,V>
- Enclosing class:
PrivateMaxEntriesMap<K,V>
A builder that creates
PrivateMaxEntriesMap instances. It
provides a flexible approach for constructing customized instances with
a named parameter syntax. It can be used in the following manner:
ConcurrentMap<Vertex, Set<Edge>> graph = new Builder<Vertex, Set<Edge>>()
.maximumCapacity(5000)
.build();
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) long(package private) int(package private) static final int(package private) static final int(package private) int -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()Creates a newPrivateMaxEntriesMapinstance.concurrencyLevel(int concurrencyLevel) Specifies the estimated number of concurrently updating threads.initialCapacity(int initialCapacity) Specifies the initial capacity of the hash table (default16).maximumCapacity(long capacity) Specifies the maximum capacity to coerce the map to and may exceed it temporarily.
-
Field Details
-
DEFAULT_CONCURRENCY_LEVEL
static final int DEFAULT_CONCURRENCY_LEVEL- See Also:
-
DEFAULT_INITIAL_CAPACITY
static final int DEFAULT_INITIAL_CAPACITY- See Also:
-
concurrencyLevel
int concurrencyLevel -
initialCapacity
int initialCapacity -
capacity
long capacity
-
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
initialCapacity
Specifies the initial capacity of the hash table (default16). This is the number of key-value pairs that the hash table can hold before a resize operation is required.- Parameters:
initialCapacity- the initial capacity used to size the hash table to accommodate this many entries.- Throws:
IllegalArgumentException- if the initialCapacity is negative
-
maximumCapacity
Specifies the maximum capacity to coerce the map to and may exceed it temporarily.- Parameters:
capacity- the threshold to bound the map by- Throws:
IllegalArgumentException- if the maximumCapacity is negative
-
concurrencyLevel
Specifies the estimated number of concurrently updating threads. The implementation performs internal sizing to try to accommodate this many threads (default16).- Parameters:
concurrencyLevel- the estimated number of concurrently updating threads- Throws:
IllegalArgumentException- if the concurrencyLevel is less than or equal to zero
-
build
Creates a newPrivateMaxEntriesMapinstance.- Throws:
IllegalStateException- if the maximum capacity was not set
-