接口 BootstrapRegistry.InstanceSupplier<T>
- 类型参数:
T
- the instance type
- 封闭接口:
BootstrapRegistry
- 函数接口:
- 这是一个函数接口, 因此可用作 lambda 表达式或方法引用的赋值目标。
Supplier used to provide the actual instance when needed.
- 另请参阅:
-
方法概要
修饰符和类型方法说明static <T> BootstrapRegistry.InstanceSupplier
<T> Factory method that can be used to create anBootstrapRegistry.InstanceSupplier
from aSupplier
.get
(BootstrapContext context) Factory method used to create the instance when needed.default BootstrapRegistry.Scope
getScope()
Return the scope of the supplied instance.static <T> BootstrapRegistry.InstanceSupplier
<T> of
(T instance) Factory method that can be used to create anBootstrapRegistry.InstanceSupplier
for a given instance.default BootstrapRegistry.InstanceSupplier
<T> withScope
(BootstrapRegistry.Scope scope) Return a newBootstrapRegistry.InstanceSupplier
with an updatedBootstrapRegistry.Scope
.
-
方法详细资料
-
get
Factory method used to create the instance when needed.- 参数:
context
- theBootstrapContext
which may be used to obtain other bootstrap instances.- 返回:
- the instance
-
getScope
Return the scope of the supplied instance.- 返回:
- the scope
- 从以下版本开始:
- 2.4.2
-
withScope
Return a newBootstrapRegistry.InstanceSupplier
with an updatedBootstrapRegistry.Scope
.- 参数:
scope
- the new scope- 返回:
- a new
BootstrapRegistry.InstanceSupplier
instance with the new scope - 从以下版本开始:
- 2.4.2
-
of
Factory method that can be used to create anBootstrapRegistry.InstanceSupplier
for a given instance.- 类型参数:
T
- the instance type- 参数:
instance
- the instance- 返回:
- a new
BootstrapRegistry.InstanceSupplier
-
from
Factory method that can be used to create anBootstrapRegistry.InstanceSupplier
from aSupplier
.- 类型参数:
T
- the instance type- 参数:
supplier
- the supplier that will provide the instance- 返回:
- a new
BootstrapRegistry.InstanceSupplier
-