Skip to content

Commit

Permalink
add parseApplicationReplacement overrides
Browse files Browse the repository at this point in the history
  • Loading branch information
bbaldino committed Sep 23, 2020
1 parent 1428ebb commit 83349ec
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions config/src/main/java/com/typesafe/config/ConfigFactory.java
Original file line number Diff line number Diff line change
Expand Up @@ -1095,6 +1095,29 @@ public static Config parseResourcesAnySyntax(String resourceBasename) {
/**
* Parse only any application replacement (specified by one of config.{resource,file,url}), returning
* an empty Config if no overrides were set.
*
* @return a {@link java.util.Optional} containing any specified replacement, or {@link Optional#empty()}
* if none was specified.
*/
public static java.util.Optional<Config> parseApplicationReplacement() {
return parseApplicationReplacement(ConfigParseOptions.defaults());
}

/**
* Like {@link #parseApplicationReplacement()} but allows you to specify a class loader
* ti yse rather than the current context class loader.
*
* @param loader the class loader
* @return a {@link java.util.Optional} containing any specified replacement, or {@link Optional#empty()}
* if none was specified.
*/
public static java.util.Optional<Config> parseApplicationReplacement(ClassLoader loader) {
return parseApplicationReplacement(ConfigParseOptions.defaults().setClassLoader(loader));
}

/**
* Like {@link #parseApplicationReplacement()} but allows you to specify parse options.
*
* @param parseOptions parse options
* @return a {@link java.util.Optional} containing any specified replacement, or {@link Optional#empty()}
* if none was specified.
Expand Down

0 comments on commit 83349ec

Please sign in to comment.