OptionsResolver

A helper class used to obtain all the parameters from the “options” configuration section.

Description

The OptionsResolver class can be use to obtain all the parameters under the section “options” from a CongifParams object. It has a single method called “resolve”.

Static methods

resolve

Resolves an “options” configuration section from component configuration parameters.

public static ConfigParams resolve(ConfigParams config, boolean configAsDefault)

  • config: ConfigParams - configuration parameters
  • configAsDefault: boolean - (optional) When set true the method returns the entire parameter set when “options” section is not found. Default: false
  • returns: ConfigParams - configuration parameters from “options” section

Examples

{
  ConfigParams config = ConfigParams.fromTuples(
    ...
    "options.param1", "ABC",
    "options.param2", 123
  );
 
  ConfigParams options = OptionsResolver.resolve(config, false); // Result: param1=ABC;param2=123
  }