Package org.springframework.boot
Interface BootstrapRegistry.InstanceSupplier<T>
- Type Parameters:
T- the instance type
- Enclosing interface:
- BootstrapRegistry
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
Supplier used to provide the actual instance when needed.
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionstatic <T> BootstrapRegistry.InstanceSupplier<T>Factory method that can be used to create anBootstrapRegistry.InstanceSupplierfrom aSupplier.get(BootstrapContext context) Factory method used to create the instance when needed.default BootstrapRegistry.ScopegetScope()Return the scope of the supplied instance.static <T> BootstrapRegistry.InstanceSupplier<T>of(T instance) Factory method that can be used to create anBootstrapRegistry.InstanceSupplierfor a given instance.default BootstrapRegistry.InstanceSupplier<T>withScope(BootstrapRegistry.Scope scope) Return a newBootstrapRegistry.InstanceSupplierwith an updatedBootstrapRegistry.Scope.
-
Method Details
-
get
Factory method used to create the instance when needed.- Parameters:
context- theBootstrapContextwhich may be used to obtain other bootstrap instances.- Returns:
- the instance
-
getScope
Return the scope of the supplied instance.- Returns:
- the scope
- Since:
- 2.4.2
-
withScope
Return a newBootstrapRegistry.InstanceSupplierwith an updatedBootstrapRegistry.Scope.- Parameters:
scope- the new scope- Returns:
- a new
BootstrapRegistry.InstanceSupplierinstance with the new scope - Since:
- 2.4.2
-
of
Factory method that can be used to create anBootstrapRegistry.InstanceSupplierfor a given instance.- Type Parameters:
T- the instance type- Parameters:
instance- the instance- Returns:
- a new
BootstrapRegistry.InstanceSupplier
-
from
Factory method that can be used to create anBootstrapRegistry.InstanceSupplierfrom aSupplier.- Type Parameters:
T- the instance type- Parameters:
supplier- the supplier that will provide the instance- Returns:
- a new
BootstrapRegistry.InstanceSupplier
-