RussellSpitzer commented on code in PR #433:
URL: https://github.com/apache/polaris/pull/433#discussion_r1857408643
##########
polaris-core/src/main/java/org/apache/polaris/core/PolarisConfiguration.java:
##########
@@ -30,15 +31,23 @@ public class PolarisConfiguration<T> {
public final T defaultValue;
private final Optional<String> catalogConfigImpl;
private final Class<T> typ;
+ private final Optional<Function<T, Boolean>> validation;
@SuppressWarnings("unchecked")
public PolarisConfiguration(
- String key, String description, T defaultValue, Optional<String>
catalogConfig) {
+ String key,
+ String description,
+ T defaultValue,
+ Optional<String> catalogConfig,
+ Optional<Function<T, Boolean>> validation) {
this.key = key;
this.description = description;
this.defaultValue = defaultValue;
this.catalogConfigImpl = catalogConfig;
this.typ = (Class<T>) defaultValue.getClass();
+ this.validation = validation;
+
+ validate(cast(defaultValue));
Review Comment:
Is this just a safety check? Feels like this shouldn't happen right?
--
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]