Class OptionResolver

java.lang.Object
org.pipservices3.commons.config.OptionResolver

public class OptionResolver extends Object
A helper class to parameters from "options" configuration section.

### Example ###

 
 ConfigParams config = ConfigParams.fromTuples(
   ...
   "options.param1", "ABC",
   "options.param2", 123
 );

 ConfigParams options = OptionsResolver.resolve(config, false); // Result: param1=ABC;param2=123
 
 
  • Constructor Details

    • OptionResolver

      public OptionResolver()
  • Method Details

    • resolve

      public static ConfigParams resolve(ConfigParams config, boolean configAsDefault)
      Resolves an "options" configuration section from component configuration parameters.
      Parameters:
      config - configuration parameters
      configAsDefault - (optional) When set true the method returns the entire parameter set when "options" section is not found. Default: false
      Returns:
      configuration parameters from "options" section