MINOR: Fix Embedded ConfigDef Validator toString issue
`ConfigDef.embeddedValidator` should return an Anonymous Object instead of lambda so that we can have a useful `toString()` for methods such as `toRst`.
Reviewers: Jason Gustafson
@@ -1318,7 +1318,16 @@ public class ConfigDef {
*/
private static Validator embeddedValidator(final String keyPrefix, final Validator base) {
if (base == null) return null;
- return (name, value) -> base.ensureValid(name.substring(keyPrefix.length()), value);
+ return new Validator() {
+ public void ensureValid(String name, Object value) {
+ base.ensureValid(name.substring(keyPrefix.length()), value);
+ }
+
+ @Override
+ public String toString() {
+ return base.toString();
+ }
+ };
}
/**
