インターフェース InstanceSupplier<T>

型パラメーター:
T - このサプライヤーが提供するインスタンスの型
すべてのスーパーインターフェース:
SupplierSE<T>ThrowingSupplier<T>
すべての既知の実装クラス:
BeanInstanceSupplier
関数インターフェース:
これは関数インターフェースであるため、ラムダ式またはメソッド参照の割り当てターゲットとして使用できます。

@FunctionalInterfaceSE public interface InstanceSupplier<T> extends ThrowingSupplier<T>
インスタンスを提供するために registered bean に関する詳細が必要な場合に、BeanDefinition に設定できる特殊な SupplierSE
導入:
6.0
作成者:
Phillip Webb, Stephane Nicoll
関連事項:
  • メソッドの詳細

    • getWithException

      default T getWithException()
      インターフェースからコピーされた説明: ThrowingSupplier
      結果を取得し、場合によってはチェック例外をスローします。
      次で指定:
      インターフェース ThrowingSupplier<T>getWithException 
      戻り値:
      結果
    • get

      T get(RegisteredBean registeredBean) throws ExceptionSE
      提供されたインスタンスを取得します。
      パラメーター:
      registeredBean - インスタンスをリクエストする登録済みの Bean
      戻り値:
      提供されたインスタンス
      例外:
      ExceptionSE - エラー時
    • getFactoryMethod

      @Nullable default MethodSE getFactoryMethod()
      このサプライヤーがインスタンスの作成に使用するファクトリメソッドを返します。不明な場合、またはこのサプライヤーが別の手段を使用する場合は null を返します。
      戻り値:
      インスタンスの作成に使用されるファクトリメソッド、または null
    • andThen

      default <V> InstanceSupplier<V> andThen(ThrowingBiFunction<RegisteredBean,? super T,? extends V> after)
      最初にこのサプライヤーからインスタンスを取得し、次に after 関数を適用して結果を取得する合成インスタンスサプライヤーを返します。
      型パラメーター:
      V - after 関数および合成関数の出力の型
      パラメーター:
      after - インスタンス取得後に適用する関数
      戻り値:
      構成されたインスタンスサプライヤー
    • using

      static <T> InstanceSupplier<T> using(ThrowingSupplier<T> supplier)
      ThrowingSupplier から InstanceSupplier を作成するファクトリメソッド。
      型パラメーター:
      T - このサプライヤーが提供するインスタンスの型
      パラメーター:
      supplier - ソースサプライヤー
      戻り値:
      新しい InstanceSupplier
    • using

      static <T> InstanceSupplier<T> using(@Nullable MethodSE factoryMethod, ThrowingSupplier<T> supplier)
      ThrowingSupplier から InstanceSupplier を作成するファクトリメソッド。
      型パラメーター:
      T - このサプライヤーが提供するインスタンスの型
      パラメーター:
      factoryMethod - 使用されているファクトリメソッド
      supplier - ソースサプライヤー
      戻り値:
      新しい InstanceSupplier
    • of

      static <T> InstanceSupplier<T> of(InstanceSupplier<T> instanceSupplier)
      1 回の呼び出しで InstanceSupplier を作成し、ポストプロセッサーを追加するために使用できるラムダフレンドリなメソッド。例: InstanceSupplier.of(registeredBean ->...).andThen(...)
      型パラメーター:
      T - このサプライヤーが提供するインスタンスの型
      パラメーター:
      instanceSupplier - ソースインスタンスサプライヤー
      戻り値:
      新しい InstanceSupplier