Define the enable function in BindingsPropertiesProcessor
还没有人认领这个 Issue。
评估
调研方向
Start with the BindingsPropertiesProcessor interface and its process method, then find the existing implementations that check conditions inside process. Add the default enable(Environment) method from the issue and move those checks into it. Done when the interface has the default method and the implementations use it instead of their inline checks.
由索引模型根据 Issue 内容生成。
描述
Define the enable function in BindingsPropertiesProcessor like this:
/**
* An interface for types that transform the contents of a {@link Bindings} into properties for injection into a
* {@link org.springframework.core.env.PropertySource}.
*/
@FunctionalInterface
public interface BindingsPropertiesProcessor {
/**
* Transform the currently accumulated {@link Bindings}-related properties.
*
* @param environment the {@link Environment} that the processor is executing with.
* @param bindings the {@code Bindings} exposed to the application.
* @param properties the currently accumulated properties.
*/
void process(Environment environment, Bindings bindings, Map<String, Object> properties);
/**
* Whether it is enabled the processor.
* @param environment the {@link Environment} that the processor is executing with.
* @return if true the to execute process.
*/
default boolean enable(Environment environment) {
return true;
}
}
Processing the verification operations coupled in the process through the enable function is more reasonable in design, and the implementation of subclasses will also be more elegant.
- 主要语言
- Java
- 星标
- 50
- 派生
- 33
- 平均合并
- 6 天 2 小时
- 30 天内合并 PR
- 2
环境准备
这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
spring-cloud/spring-cloud-bindings 的其他 Issue
-
难度 3/5 半天 新手友好度 45/100
spring-cloud/spring-cloud-bindings#116 · 2 条评论 · 1 个 reaction ·
-
难度 4/5 3-5 天 新手友好度 22/100
-
难度 4/5 3-5 天 新手友好度 15/100
-
难度 3/5 1-2 天 新手友好度 35/100
-
难度 4/5 3-5 天 新手友好度 15/100
查看 spring-cloud/spring-cloud-bindings 的全部 Issue
相似的 Issue
-
area:cpan-port area:performance bug
难度 2/5 1-3 小时 新手友好度 72/100
fglock/PerlOnJava#2230 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 76/100
-
难度 2/5 1-3 小时 新手友好度 82/100
federicoiosue/Omni-Notes#1044 ·
-
Bug
难度 1/5 1 小时以内 新手友好度 68/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 82/100
维护者通常 1 天内回复