Interface EnvironmentVariableResolver

All Known Implementing Classes:
ConfigPropertyResolver, EnvironmentVariableResolver.Default

public interface EnvironmentVariableResolver
An abstraction that allows us to make environment variable resolution customizable.
Author:
as 2019.10.11
  • Method Details

    • getEnv

      String getEnv(String sVarName)
      Return the value of the specified environment variable.
      Parameters:
      sVarName - the name of the environment variable to return
      Returns:
      the value of the specified environment variable
    • getEnv

      default String getEnv(String sVarName, String sDefaultValue)
      Return the value of the specified environment variable, or the specified default value if the variable doesn't exist.
      Parameters:
      sVarName - the name of the environment variable to return
      sDefaultValue - the default value to return if the variable doesn't exist
      Returns:
      the value of the specified environment variable, or the specified default value if the variable doesn't exist
    • getInstance

      static EnvironmentVariableResolver getInstance()
      Return an instance of a EnvironmentVariableResolver discovered by the ServiceLoader, or a default instance if none are discovered.
      Returns:
      an instance of a EnvironmentVariableResolver