Interface AvailableVariables

Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public interface AvailableVariables
A functional interface for obtaining the value of variables given their names.
Author:
Randall Hauch
  • Method Details

    • configVariables

      static AvailableVariables configVariables(Configuration config)
      Get an AvailableVariables that returns the value of a Configuration property.
      Parameters:
      config - the configuration
      Returns:
      the available variables function that returns the configuration property value for the given property name; never null
    • systemVariables

      static AvailableVariables systemVariables(Configuration config)
      Get an AvailableVariables that returns System properties set with -Dvariable=value.

      This method does not use the configuration.

      Parameters:
      config - the configuration
      Returns:
      the available variables function that returns System properties; never null
    • environmentVariables

      static AvailableVariables environmentVariables(Configuration config)
      Get an AvailableVariables that returns System environment variables set with operating system environment variables (e.g., ${JAVA_HOME}).

      This method does not use the configuration.

      Parameters:
      config - the configuration
      Returns:
      the available variables function that returns System properties; never null
    • empty

      static AvailableVariables empty()
      Get an AvailableVariables that always returns null.
      Returns:
      the empty available variables function that always return null.
    • variableForName

      String variableForName(String varName)
      Obtain the value of a variable with the given name.
      Parameters:
      varName - the variable name; may be null
      Returns:
      the value of the variable; may be null if the named variable is not known
    • and

      Obtain an AvailableVariables function that first checks this instance and then checks the supplied instance.
      Parameters:
      next - the next AvailableVariables instance to check
      Returns:
      the new AvailableVariables function that combines both instances; never null but may be this instance if next is null or