Class EnvironmentVariableResolver

java.lang.Object
org.forgerock.config.resolvers.EnvironmentVariableResolver
All Implemented Interfaces:
PropertyResolver

public class EnvironmentVariableResolver extends Object implements PropertyResolver
A property accessor that allows access to environment variables. Keys will be transformed from dot notation following these rules: 1) periods (.) are converted to under scores (_) and all character are transformed to uppercase using String.toUpperCase(Locale) where the locale is Locale.ROOT
  • Method Details

    • getProperty

      public Optional<String> getProperty(String key, boolean sensitive)
      Description copied from interface: PropertyResolver
      Returns the value of the specified property. The method returns an empty Optional if the property is not found. The resolved property has to be considered sensitive if sensitive is true and implementations are required to handle it with special attention (no logs, ...).
      Specified by:
      getProperty in interface PropertyResolver
      Parameters:
      key - The name of the requested property. The key can't be null.
      sensitive - true is the property value has to be considered a sensitive value (such as a password).
      Returns:
      An Optional string that contains the value of the requested property, or empty Optional if property is undefined.
    • toString

      public String toString()
      Overrides:
      toString in class Object