scalecube-config
scalecube-config copied to clipboard
Support interface property instead required implementation
It will be nice to support an interface (without any implementation) as ObjectProperty, and use java8 interface features. For example, the next interface:
interface ObjectProperty {
Integer testProperty();
Optional<Integer> testOptionalProperty();
default String testDefaultProperty() {
return "DEFAULT";
}
default Optional<String> testOptionalDefaultProperty() {
return Optional.of("DEFAULT");
}
}
and then with ConfigRegistry :
ObjectConfigProperty<ObjectProperty> settings = config.objectProperty(mapping, ObjectProperty.class);
Note: mapping on interface method name