Define the enable function in BindingsPropertiesProcessor

オープン
#114 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
2/5
見積もり時間
半日
初心者へのやさしさ
55/100
issue の種類
リファクタリング
明瞭さ
明確に書かれている
活発さ
停滞
技術スタック
java
領域
backend

調査の方向性

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時間
マージ済み PR(30日)
2

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

spring-cloud/spring-cloud-bindings のほかの issue

spring-cloud/spring-cloud-bindings の issue をすべて見る

似ている issue

Java の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。