Class EnvVarConfigProvider
java.lang.Object
io.javaoperatorsdk.operator.config.loader.provider.EnvVarConfigProvider
- All Implemented Interfaces:
ConfigProvider
A
ConfigProvider that resolves configuration values from environment variables.
The key is converted to an environment variable name by replacing dots and hyphens with
underscores and converting to upper case (e.g. josdk.cache-sync.timeout →
JOSDK_CACHE_SYNC_TIMEOUT).
Supported value types are: String, Boolean, Integer, Long,
Double, and Duration (ISO-8601 format, e.g. PT30S).
-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
EnvVarConfigProvider
public EnvVarConfigProvider()
-
-
Method Details
-
getValue
Description copied from interface:ConfigProviderReturns the value associated withkey, converted totype, or an emptyOptionalif the key is not set.- Specified by:
getValuein interfaceConfigProvider- Type Parameters:
T- the value type- Parameters:
key- the dot-separated configuration key, e.g.josdk.cache.sync.timeouttype- the expected type of the value; supported types depend on the implementation- Returns:
- an
Optionalcontaining the typed value, or empty if the key is absent
-