Interface SpringFactoriesLoader.ArgumentResolver
- Enclosing class:
- SpringFactoriesLoader
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
Strategy for resolving constructor arguments based on their type.
- Since:
- 6.0
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptiondefault <T> SpringFactoriesLoader.ArgumentResolverCreate a new composedSpringFactoriesLoader.ArgumentResolverby combining this resolver with the given type and value.and(SpringFactoriesLoader.ArgumentResolver argumentResolver) Create a new composedSpringFactoriesLoader.ArgumentResolverby combining this resolver with the given resolver.default <T> SpringFactoriesLoader.ArgumentResolverandSupplied(Class<T> type, Supplier<T> valueSupplier) Create a new composedSpringFactoriesLoader.ArgumentResolverby combining this resolver with the given type and value.Factory method that creates a newSpringFactoriesLoader.ArgumentResolverfrom a lambda friendly function.none()Factory method that returns aSpringFactoriesLoader.ArgumentResolverthat always returnsnull.static <T> SpringFactoriesLoader.ArgumentResolverFactory method that can be used to create aSpringFactoriesLoader.ArgumentResolverthat resolves only the given type.static <T> SpringFactoriesLoader.ArgumentResolverofSupplied(Class<T> type, Supplier<T> valueSupplier) Factory method that can be used to create aSpringFactoriesLoader.ArgumentResolverthat resolves only the given type.<T> TResolve the given argument if possible.
-
Method Details
-
resolve
Resolve the given argument if possible.- Type Parameters:
T- the argument type- Parameters:
type- the argument type- Returns:
- the resolved argument value or
null
-
and
Create a new composedSpringFactoriesLoader.ArgumentResolverby combining this resolver with the given type and value.- Type Parameters:
T- the argument type- Parameters:
type- the argument typevalue- the argument value- Returns:
- a new composite
SpringFactoriesLoader.ArgumentResolverinstance
-
andSupplied
default <T> SpringFactoriesLoader.ArgumentResolver andSupplied(Class<T> type, Supplier<T> valueSupplier) Create a new composedSpringFactoriesLoader.ArgumentResolverby combining this resolver with the given type and value.- Type Parameters:
T- the argument type- Parameters:
type- the argument typevalueSupplier- the argument value supplier- Returns:
- a new composite
SpringFactoriesLoader.ArgumentResolverinstance
-
and
default SpringFactoriesLoader.ArgumentResolver and(SpringFactoriesLoader.ArgumentResolver argumentResolver) Create a new composedSpringFactoriesLoader.ArgumentResolverby combining this resolver with the given resolver.- Parameters:
argumentResolver- the argument resolver to add- Returns:
- a new composite
SpringFactoriesLoader.ArgumentResolverinstance
-
none
Factory method that returns aSpringFactoriesLoader.ArgumentResolverthat always returnsnull.- Returns:
- a new
SpringFactoriesLoader.ArgumentResolverinstance
-
of
Factory method that can be used to create aSpringFactoriesLoader.ArgumentResolverthat resolves only the given type.- Type Parameters:
T- the argument type- Parameters:
type- the argument typevalue- the argument value- Returns:
- a new
SpringFactoriesLoader.ArgumentResolverinstance
-
ofSupplied
static <T> SpringFactoriesLoader.ArgumentResolver ofSupplied(Class<T> type, Supplier<T> valueSupplier) Factory method that can be used to create aSpringFactoriesLoader.ArgumentResolverthat resolves only the given type.- Type Parameters:
T- the argument type- Parameters:
type- the argument typevalueSupplier- the argument value supplier- Returns:
- a new
SpringFactoriesLoader.ArgumentResolverinstance
-
from
Factory method that creates a newSpringFactoriesLoader.ArgumentResolverfrom a lambda friendly function. The given function is provided with the argument type and must provide an instance of that type ornull.- Parameters:
function- the resolver function- Returns:
- a new
SpringFactoriesLoader.ArgumentResolverinstance backed by the function
-