Class MultiProfileConfig

java.lang.Object
cloud.opencode.base.config.advanced.MultiProfileConfig

public class MultiProfileConfig extends Object
Multi-Profile Configuration Loader 多环境配置加载器

Loads configuration with environment-specific overrides based on active profile.

根据激活的环境加载带有环境特定覆盖的配置。

Profile Sources | 环境来源:

  1. APP_PROFILE environment variable | APP_PROFILE环境变量
  2. app.profile system property | app.profile系统属性
  3. Default: "default"

Load Order (Low to High Priority) | 加载顺序(优先级从低到高):

application.properties → application-{profile}.properties →
/etc/myapp/application.properties → system properties → env vars → command line

Usage Examples | 使用示例:

// Load with profile detection
Config config = MultiProfileConfig.load(args);

// Profile-specific files:
// - application-dev.properties
// - application-prod.properties
// - application-staging.properties

Features | 主要功能:

  • Core MultiProfileConfig functionality - MultiProfileConfig核心功能

Security | 安全性:

  • Thread-safe: Yes - 线程安全: 是
  • Null-safe: Partial (validates inputs) - 空值安全: 部分(验证输入)
Since:
JDK 25, opencode-base-config V1.0.0
Author:
Leon Soo www.LeonSoo.com
See Also:
  • Constructor Details

    • MultiProfileConfig

      public MultiProfileConfig()
  • Method Details