接口 BindConstructorProvider

函数接口:
这是一个函数接口, 因此可用作 lambda 表达式或方法引用的赋值目标。

@FunctionalInterface public interface BindConstructorProvider
Strategy interface used to determine a specific constructor to use when binding.
从以下版本开始:
2.2.1
作者:
Madhura Bhave
  • 字段概要

    字段
    修饰符和类型
    字段
    说明
    Default BindConstructorProvider implementation that only returns a value when there's a single constructor and when the bindable has no existing value.
  • 方法概要

    修饰符和类型
    方法
    说明
    default Constructor<?>
    getBindConstructor(Class<?> type, boolean isNestedConstructorBinding)
    Return the bind constructor to use for the given type, or null if constructor binding is not supported.
    getBindConstructor(Bindable<?> bindable, boolean isNestedConstructorBinding)
    Return the bind constructor to use for the given bindable, or null if constructor binding is not supported.
  • 字段详细资料

  • 方法详细资料

    • getBindConstructor

      default Constructor<?> getBindConstructor(Class<?> type, boolean isNestedConstructorBinding)
      Return the bind constructor to use for the given type, or null if constructor binding is not supported.
      参数:
      type - the type to check
      isNestedConstructorBinding - if this binding is nested within a constructor binding
      返回:
      the bind constructor or null
      从以下版本开始:
      3.0.0
    • getBindConstructor

      Constructor<?> getBindConstructor(Bindable<?> bindable, boolean isNestedConstructorBinding)
      Return the bind constructor to use for the given bindable, or null if constructor binding is not supported.
      参数:
      bindable - the bindable to check
      isNestedConstructorBinding - if this binding is nested within a constructor binding
      返回:
      the bind constructor or null