rdblue commented on a change in pull request #3387:
URL: https://github.com/apache/iceberg/pull/3387#discussion_r749814126
##########
File path: core/src/main/java/org/apache/iceberg/util/PropertyUtil.java
##########
@@ -70,4 +70,45 @@ public static String propertyAsString(Map<String, String>
properties,
}
return defaultValue;
}
+
+ @FunctionalInterface
+ private interface PropertyResolver<A, B, C, R> {
+ R apply(A argA, B argB, C argC);
+ }
+
+ private static <T> T resolveProperty(PropertyResolver<Map<String, String>,
String, T, T> resolver,
+ Map<String, String> options, String
optionKey,
+ Map<String, String> properties, String
propertyKey, T defaultVal) {
+ return resolver.apply(options, optionKey, resolver.apply(properties,
propertyKey, defaultVal));
+ }
+
+ private static <T> T resolveProperty(PropertyResolver<Map<String, String>,
String, T, T> resolver,
+ Map<String, String> options, String
optionKey,
Review comment:
Are there better names than options, properties1, and properties2? How
about `priorityOneProps`, `priorityTwoProps` etc.? That's more readable.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]