Interface EnvironmentVariables


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 Details

    • ENVIRONMENT_VARIABLES

      static final EnvironmentVariables 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

      default VariableDescriptor getEnvironmentVariableKey(String name)
      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

      default String getEnvironmentVariableValue(String name)
      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

      default String getEnvironmentVariableValue(VariableDescriptor descriptor)
      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