Annotation Interface ConfigValueExtractor
Русский: Аннотация для создания классов отображения конфигурации в рамках внешних библиотек.
Впоследствии интерфейс может быть использован для внедрения как зависимость.
English: Annotation for creating configuration reflection classes within external libraries. The interface can be then used for dependency injection.
Пример / Example:
English: Annotation for creating configuration reflection classes within external libraries. The interface can be then used for dependency injection.
Пример / Example:
@ConfigValueExtractor
public interface MyConfig {
@Nullable
String user();
default String password() {
return "admin";
}
}
public interface MyModule {
default MyConfig myConfig(Config config, ConfigValueExtractor<MyConfig> ext) {
var value = config.get("path.to.config");
return ext.extract(value);
}
}
-
Optional Element Summary
Optional Elements
-
Element Details
-
mapNullAsEmptyObject
boolean mapNullAsEmptyObject- Default:
- true
-