public interface EnvironmentVariables
Provides a registry of variables available for use by various components and
extension points. This enables components to reference variable names rather
than explicit values which can make configurations of those components more
portable.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final EnvironmentVariables
Provides a registry containing all environment variables and system properties. -
Method Summary
Modifier and TypeMethodDescriptiondefault VariableDescriptor
Returns the VariableDescriptor for the given key name if it exists.Provides access to a map of variable key/value pairs.default String
Gets the variable valuedefault String
getEnvironmentVariableValue
(VariableDescriptor descriptor) Gets the variable value
-
Field Details
-
ENVIRONMENT_VARIABLES
Provides a registry containing all environment variables and system properties. System properties receive precedence.
-
-
Method Details
-
getEnvironmentVariablesMap
Map<VariableDescriptor,String> getEnvironmentVariablesMap()Provides access to a map of variable key/value pairs. For variables considered to be sensitive care must be taken to ensure their values are protected whenever stored or exposed.- Returns:
- An immutable map of all variables in the registry
-
getEnvironmentVariableKey
Returns the VariableDescriptor for the given key name if it exists.- Parameters:
name
- the string name of the VariableDescriptor to lookup.- Returns:
- the variable descriptor registered for this name if it exists; null otherwise
-
getEnvironmentVariableValue
Gets the variable value- Parameters:
name
- the string name of the VariableDescriptor that is the key of the value to lookup.- Returns:
- the value associated with the given variable name if found; null otherwise
-
getEnvironmentVariableValue
Gets the variable value- Parameters:
descriptor
- the descriptor for which to lookup the variable value.- Returns:
- the variable value if the given descriptor is equivalent to one of the entries in the registry; null otherwise
-