Class AbstractServiceConfig<B extends AbstractServiceConfigBuilder<B,?>>

java.lang.Object
io.floci.testcontainers.config.services.AbstractServiceConfig<B>
Type Parameters:
B - the concrete AbstractServiceConfigBuilder subtype used to build and rebuild this configuration, allowing toBuilder() to be implemented in a type-safe way by subclasses
Direct Known Subclasses:
AcmConfig, AmazonMqConfig, ApiGatewayConfig, ApiGatewayV2Config, AppConfigConfig, AppConfigDataConfig, AppSyncConfig, AthenaConfig, BackupConfig, BatchConfig, BcmDataExportsConfig, BedrockRuntimeConfig, CloudControlConfig, CloudFormationConfig, CloudFrontConfig, CloudMapConfig, CloudTrailConfig, CloudWatchLogsConfig, CloudWatchMetricsConfig, CodeBuildConfig, CodeDeployConfig, CodePipelineConfig, CognitoConfig, ConfigServiceConfig, CostExplorerConfig, CurConfig, DocumentDbConfig, DynamoDbConfig, Ec2Config, EcrConfig, EcsConfig, EksConfig, ElastiCacheConfig, ElasticBeanstalkConfig, ElbV2Config, EmrConfig, EventBridgeConfig, FirehoseConfig, GlueConfig, IamConfig, IotConfig, IotDataConfig, KinesisConfig, KmsConfig, LambdaConfig, LightsailConfig, MemoryDbConfig, MskConfig, NeptuneConfig, OpenSearchConfig, PipesConfig, PricingConfig, RdsConfig, RdsDataConfig, ResourceGroupsTaggingConfig, Route53Config, S3Config, S3VectorsConfig, SchedulerConfig, SecretsManagerConfig, SesConfig, SnsConfig, SqsConfig, SsmConfig, StepFunctionsConfig, TextractConfig, TransferFamilyConfig, WafV2Config

public abstract class AbstractServiceConfig<B extends AbstractServiceConfigBuilder<B,?>> extends Object
Base class for Floci service configurations.

Every service configuration supports an isEnabled() flag and can apply its settings to a container via applyEnvVarsToContainer(Container).

  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected static final boolean
    Default value for the isEnabled() flag.
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    protected
    AbstractServiceConfig(boolean enabled)
    Creates a new service configuration with the given enabled flag.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    applyEnvVarsToContainer(org.testcontainers.containers.Container<?> container)
    Applies this service configuration to the given container by setting the appropriate environment variables.
    void
    applyExposedPortsToContainer(org.testcontainers.containers.Container<?> container)
    Applies this service configuration to the given container by exposing the appropriate ports.
    boolean
    Returns whether this service is enabled.
    abstract B
    Returns a new builder for this configuration, initialized with the current values of this instance.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

  • Constructor Details

    • AbstractServiceConfig

      protected AbstractServiceConfig(boolean enabled)
      Creates a new service configuration with the given enabled flag.
      Parameters:
      enabled - true to enable the service
  • Method Details

    • isEnabled

      public boolean isEnabled()
      Returns whether this service is enabled.
      Returns:
      true if this service is enabled
    • toBuilder

      public abstract B toBuilder()
      Returns a new builder for this configuration, initialized with the current values of this instance. Every subclass must implement this to return its own Builder type, pre-populated via the builder's copy constructor.
      Returns:
      a new builder pre-populated with this configuration's values
    • applyEnvVarsToContainer

      public void applyEnvVarsToContainer(org.testcontainers.containers.Container<?> container)
      Applies this service configuration to the given container by setting the appropriate environment variables.
      Parameters:
      container - the container to configure
    • applyExposedPortsToContainer

      public void applyExposedPortsToContainer(org.testcontainers.containers.Container<?> container)
      Applies this service configuration to the given container by exposing the appropriate ports.
      Parameters:
      container - the container to configure