About the Config class

The Config() class has three methods to return the builders:

Method Description
builder() Returns a naked builder for Config objects.
parseYaml(String input) Parses the YAML content and returns a Config.Builder
parseJson(String input) Parses the JSON content and returns a Config.Builder

The following example illustrates how to use the Config.builder() method:

Config cfg = Config.parseYaml(STD_CONFIG)
  .basePath(baseUrl)
  .build();

Config cfg = Config.builder()
  .basePath(baseUrl)
  .build();
}

The configuration object utilizes builders to construct immutable objects. The Config class parses the external configuration to produce a runtime Config.Builder object that allows you to modify the configuration. After modifying the configuration, use the builder's build() method to construct the new immutable config object.