Skip to content

Commit acd0f68

Browse files
committed
3rd time is a charm
1 parent 44b6464 commit acd0f68

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ allprojects {
2121

2222
// Using Jitpack so I need the repo name in the group to match.
2323
group = 'com.stubbornjava.StubbornJava'
24-
version = '0.1.29-SNAPSHOT'
24+
version = '0.1.30-SNAPSHOT'
2525

2626
repositories {
2727
mavenLocal()

stubbornjava-common/src/main/java/com/stubbornjava/common/Configs.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
import java.io.File;
44
import java.util.Map;
5-
import java.util.function.Function;
5+
import java.util.function.BiFunction;
66
import java.util.function.Supplier;
77

88
import org.jooq.lambda.Seq;
@@ -45,16 +45,16 @@ public static Map<String, Object> asMap(Config config) {
4545
.toMap(e -> e.getKey(), e -> e.getValue().unwrapped());
4646
}
4747

48-
public static <T> T getOrDefault(Config config, String path, Function<Config, T> extractor, T defaultValue) {
48+
public static <T> T getOrDefault(Config config, String path, BiFunction<Config, String, T> extractor, T defaultValue) {
4949
if (config.hasPath(path)) {
50-
return extractor.apply(config);
50+
return extractor.apply(config, path);
5151
}
5252
return defaultValue;
5353
}
5454

55-
public static <T> T getOrDefault(Config config, String path, Function<Config, T> extractor, Supplier<T> defaultSupplier) {
55+
public static <T> T getOrDefault(Config config, String path, BiFunction<Config, String, T> extractor, Supplier<T> defaultSupplier) {
5656
if (config.hasPath(path)) {
57-
return extractor.apply(config);
57+
return extractor.apply(config, path);
5858
}
5959
return defaultSupplier.get();
6060
}

0 commit comments

Comments
 (0)