Class SystemPropertiesConfigSource
java.lang.Object
cloud.opencode.base.config.source.SystemPropertiesConfigSource
- All Implemented Interfaces:
ConfigSource
System Properties Configuration Source
系统属性配置源
Loads configuration from Java system properties (System.getProperties()).
从Java系统属性加载配置(System.getProperties())。
Features | 主要功能:
- Java system properties access - Java系统属性访问
- JVM arguments support (-Dkey=value) - JVM参数支持
- Medium priority (50) - 中等优先级(50)
Usage Examples | 使用示例:
// Create source
ConfigSource source = new SystemPropertiesConfigSource();
// Set via JVM args
// java -Dapp.name=MyApp -Dserver.port=8080 Main
// Or programmatically
System.setProperty("app.name", "MyApp");
Performance | 性能特性:
- Time complexity: O(n) for loading - 时间复杂度: 加载为O(n)
- Properties snapshot at creation - 创建时的属性快照
Security | 安全性:
- Thread-safe: Yes - 线程安全: 是
- Immutable snapshot - 不可变快照
- Since:
- JDK 25, opencode-base-config V1.0.0
- Author:
- Leon Soo www.LeonSoo.com
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionCreate system properties config source 创建系统属性配置源 -
Method Summary
Modifier and TypeMethodDescriptiongetName()Get configuration source name 获取配置源名称intGet configuration source priority (higher number = higher priority) 获取配置源优先级(数值越大优先级越高)Get all configuration properties 获取所有配置属性Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface ConfigSource
getProperty, reload, supportsReload
-
Constructor Details
-
SystemPropertiesConfigSource
public SystemPropertiesConfigSource()Create system properties config source 创建系统属性配置源
-
-
Method Details
-
getName
Description copied from interface:ConfigSourceGet configuration source name 获取配置源名称- Specified by:
getNamein interfaceConfigSource- Returns:
- source name | 源名称
-
getProperties
Description copied from interface:ConfigSourceGet all configuration properties 获取所有配置属性Performance | 性能:
This method should return a cached immutable map for best performance.
此方法应返回缓存的不可变映射以获得最佳性能。
- Specified by:
getPropertiesin interfaceConfigSource- Returns:
- configuration properties map | 配置属性映射
-
getPriority
public int getPriority()Description copied from interface:ConfigSourceGet configuration source priority (higher number = higher priority) 获取配置源优先级(数值越大优先级越高)Default Priorities | 默认优先级:
- CommandLine: 200
- Environment: 100
- Properties/YAML: 50
- InMemory: 10
- Specified by:
getPriorityin interfaceConfigSource- Returns:
- priority value | 优先级值
-