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.ArgumentResolver
Create a new composedSpringFactoriesLoader.ArgumentResolver
by combining this resolver with the given type and value.and
(SpringFactoriesLoader.ArgumentResolver argumentResolver) Create a new composedSpringFactoriesLoader.ArgumentResolver
by combining this resolver with the given resolver.default <T> SpringFactoriesLoader.ArgumentResolver
andSupplied
(Class<T> type, Supplier<T> valueSupplier) Create a new composedSpringFactoriesLoader.ArgumentResolver
by combining this resolver with the given type and value.Factory method that creates a newSpringFactoriesLoader.ArgumentResolver
from a lambda friendly function.none()
Factory method that returns anSpringFactoriesLoader.ArgumentResolver
that always returnsnull
.static <T> SpringFactoriesLoader.ArgumentResolver
Factory method that can be used to create anSpringFactoriesLoader.ArgumentResolver
that resolves only the given type.static <T> SpringFactoriesLoader.ArgumentResolver
ofSupplied
(Class<T> type, Supplier<T> valueSupplier) Factory method that can be used to create anSpringFactoriesLoader.ArgumentResolver
that resolves only the given type.<T> T
Resolve 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.ArgumentResolver
by 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.ArgumentResolver
instance
-
andSupplied
default <T> SpringFactoriesLoader.ArgumentResolver andSupplied(Class<T> type, Supplier<T> valueSupplier) Create a new composedSpringFactoriesLoader.ArgumentResolver
by 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.ArgumentResolver
instance
-
and
default SpringFactoriesLoader.ArgumentResolver and(SpringFactoriesLoader.ArgumentResolver argumentResolver) Create a new composedSpringFactoriesLoader.ArgumentResolver
by combining this resolver with the given resolver.- Parameters:
argumentResolver
- the argument resolver to add- Returns:
- a new composite
SpringFactoriesLoader.ArgumentResolver
instance
-
none
Factory method that returns anSpringFactoriesLoader.ArgumentResolver
that always returnsnull
.- Returns:
- a new
SpringFactoriesLoader.ArgumentResolver
instance
-
of
Factory method that can be used to create anSpringFactoriesLoader.ArgumentResolver
that resolves only the given type.- Type Parameters:
T
- the argument type- Parameters:
type
- the argument typevalue
- the argument value- Returns:
- a new
SpringFactoriesLoader.ArgumentResolver
instance
-
ofSupplied
static <T> SpringFactoriesLoader.ArgumentResolver ofSupplied(Class<T> type, Supplier<T> valueSupplier) Factory method that can be used to create anSpringFactoriesLoader.ArgumentResolver
that resolves only the given type.- Type Parameters:
T
- the argument type- Parameters:
type
- the argument typevalueSupplier
- the argument value supplier- Returns:
- a new
SpringFactoriesLoader.ArgumentResolver
instance
-
from
Factory method that creates a newSpringFactoriesLoader.ArgumentResolver
from 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.ArgumentResolver
instance backed by the function
-