- java.lang.Object
-
- com.github.robtimus.pool.PoolConfig
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
PoolConfig.Builder
A builder forPoolConfig
objects.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static PoolConfig.Builder
custom()
Returns a new builder for creatingPoolConfig
objects.static PoolConfig
defaultConfig()
Returns a defaultPoolConfig
object.int
initialSize()
Returns the initial pool size.Optional<Duration>
maxIdleTime()
Returns the maximum time that objects can be idle.int
maxSize()
Returns the maximum pool size.Optional<Duration>
maxWaitTime()
Returns the maximum time to wait when acquiring objects.String
toString()
-
-
-
Method Detail
-
maxWaitTime
public Optional<Duration> maxWaitTime()
Returns the maximum time to wait when acquiring objects.- Returns:
- An
Optional
describing the maximum time to wait when acquiring objects, orOptional#empty()
to wait indefinitely.
-
maxIdleTime
public Optional<Duration> maxIdleTime()
Returns the maximum time that objects can be idle.- Returns:
- An
Optional
describing the maximum time that objects can be idle, orOptional.empty()
if objects can be idle indefinitely.
-
initialSize
public int initialSize()
Returns the initial pool size. This is the number of idle objects to start with.- Returns:
- The initial pool size.
-
maxSize
public int maxSize()
Returns the maximum pool size. This is the maximum number of objects, both idle and currently in use.- Returns:
- The maximum pool size.
-
defaultConfig
public static PoolConfig defaultConfig()
Returns a defaultPoolConfig
object. This has the same configuration as an object returned bycustom().build()
.- Returns:
- A default
PoolConfig
object. - See Also:
custom()
-
custom
public static PoolConfig.Builder custom()
Returns a new builder for creatingPoolConfig
objects.- Returns:
- A new builder for creating
PoolConfig
objects.
-
-