Class MemoryDbConfig
java.lang.Object
io.floci.testcontainers.config.services.AbstractServiceConfig<MemoryDbConfig.Builder>
io.floci.testcontainers.config.services.MemoryDbConfig
Configuration for MemoryDB-specific container settings.
Instances are created via MemoryDbConfig.Builder:
MemoryDbConfig config = MemoryDbConfig.builder()
.enabled(true)
.mock(false)
.proxyPortRange(6400, 20)
.defaultImage("valkey/valkey:8")
.build();
-
Nested Class Summary
Nested Classes -
Field Summary
Fields inherited from class io.floci.testcontainers.config.services.AbstractServiceConfig
DEFAULT_ENABLED -
Method Summary
Modifier and TypeMethodDescriptionvoidapplyEnvVarsToContainer(org.testcontainers.containers.Container<?> container) Applies this service configuration to the given container by setting the appropriate environment variables.voidapplyExposedPortsToContainer(org.testcontainers.containers.Container<?> container) Applies this service configuration to the given container by exposing the appropriate ports.static MemoryDbConfig.Builderbuilder()Returns a newMemoryDbConfig.Builderfor this configuration.Returns the default Docker image used for MemoryDB (Valkey) instances.intReturns the base port for the MemoryDB proxy port range.intReturns the maximum port for the MemoryDB proxy port range.intReturns the number of ports allocated for the MemoryDB proxy, starting fromgetProxyBasePort().booleanisMock()Returns whether MemoryDB clusters are simulated in-memory without real Docker containers.Returns a newMemoryDbConfig.Builderfor this configuration, initialized with the current values of this instance.Methods inherited from class io.floci.testcontainers.config.services.AbstractServiceConfig
isEnabled
-
Method Details
-
builder
Returns a newMemoryDbConfig.Builderfor this configuration.- Returns:
- a new builder
-
toBuilder
Returns a newMemoryDbConfig.Builderfor this configuration, initialized with the current values of this instance.- Specified by:
toBuilderin classAbstractServiceConfig<MemoryDbConfig.Builder>- Returns:
- a new builder pre-populated with this configuration's values
-
isMock
public boolean isMock()Returns whether MemoryDB clusters are simulated in-memory without real Docker containers.- Returns:
trueif mock mode is enabled
-
getProxyBasePort
public int getProxyBasePort()Returns the base port for the MemoryDB proxy port range.- Returns:
- the base port
-
getProxyPortsCount
public int getProxyPortsCount()Returns the number of ports allocated for the MemoryDB proxy, starting fromgetProxyBasePort().- Returns:
- the number of proxy ports
-
getProxyMaxPort
public int getProxyMaxPort()Returns the maximum port for the MemoryDB proxy port range.- Returns:
- the maximum port
-
getDefaultImage
Returns the default Docker image used for MemoryDB (Valkey) instances.- Returns:
- the image name
-
applyEnvVarsToContainer
public void applyEnvVarsToContainer(org.testcontainers.containers.Container<?> container) Description copied from class:AbstractServiceConfigApplies this service configuration to the given container by setting the appropriate environment variables.- Overrides:
applyEnvVarsToContainerin classAbstractServiceConfig<MemoryDbConfig.Builder>- Parameters:
container- the container to configure
-
applyExposedPortsToContainer
public void applyExposedPortsToContainer(org.testcontainers.containers.Container<?> container) Description copied from class:AbstractServiceConfigApplies this service configuration to the given container by exposing the appropriate ports.- Overrides:
applyExposedPortsToContainerin classAbstractServiceConfig<MemoryDbConfig.Builder>- Parameters:
container- the container to configure
-