Package org.springframework.core.io.support

# 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.

@FunctionalInterface public static interface SpringFactoriesLoader.ArgumentResolver
Strategy for resolving constructor arguments based on their type.

Since:
  6.0
See Also:
  - `of(Class, Object)`
  - `ofSupplied(Class, Supplier)`
  - `from(Function)`

## Method Summary

Modifier and Type
Method
Description
`default <T> SpringFactoriesLoader.ArgumentResolver`
`and(Class<T> type, T value)`
Create a new composed `SpringFactoriesLoader.ArgumentResolver` by combining this resolver with the given type and value.
`default SpringFactoriesLoader.ArgumentResolver`
`and(SpringFactoriesLoader.ArgumentResolver argumentResolver)`
Create a new composed `SpringFactoriesLoader.ArgumentResolver` by combining this resolver with the given resolver.
`default <T> SpringFactoriesLoader.ArgumentResolver`
`andSupplied(Class<T> type, Supplier<T> valueSupplier)`
Create a new composed `SpringFactoriesLoader.ArgumentResolver` by combining this resolver with the given type and value.
`static SpringFactoriesLoader.ArgumentResolver`
`from(Function<Class<?>,Object> function)`
Factory method that creates a new `SpringFactoriesLoader.ArgumentResolver` from a lambda friendly function.
`static SpringFactoriesLoader.ArgumentResolver`
`none()`
Factory method that returns an `SpringFactoriesLoader.ArgumentResolver` that always returns `null`.
`static <T> SpringFactoriesLoader.ArgumentResolver`
`of(Class<T> type, T value)`
Factory method that can be used to create an `SpringFactoriesLoader.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 an `SpringFactoriesLoader.ArgumentResolver` that resolves only the given type.
`<T> T`
`resolve(Class<T> type)`
Resolve the given argument if possible.

## Method Details

### resolve

@Nullable <T> T resolve(Class<T> type)
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

default <T> SpringFactoriesLoader.ArgumentResolver and(Class<T> type, T value)
Create a new composed `SpringFactoriesLoader.ArgumentResolver` by combining this resolver with the given type and value.

Type Parameters:
  `T` - the argument type
Parameters:
  `type` - the argument type
  `value` - 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 composed `SpringFactoriesLoader.ArgumentResolver` by combining this resolver with the given type and value.

Type Parameters:
  `T` - the argument type
Parameters:
  `type` - the argument type
  `valueSupplier` - the argument value supplier
Returns:
  a new composite `SpringFactoriesLoader.ArgumentResolver` instance

### and

default SpringFactoriesLoader.ArgumentResolver and(SpringFactoriesLoader.ArgumentResolver argumentResolver)
Create a new composed `SpringFactoriesLoader.ArgumentResolver` by combining this resolver with the given resolver.

Parameters:
  `argumentResolver` - the argument resolver to add
Returns:
  a new composite `SpringFactoriesLoader.ArgumentResolver` instance

### none

static SpringFactoriesLoader.ArgumentResolver none()
Factory method that returns an `SpringFactoriesLoader.ArgumentResolver` that always returns `null`.

Returns:
  a new `SpringFactoriesLoader.ArgumentResolver` instance

### of

static <T> SpringFactoriesLoader.ArgumentResolver of(Class<T> type, T value)
Factory method that can be used to create an `SpringFactoriesLoader.ArgumentResolver` that resolves only the given type.

Type Parameters:
  `T` - the argument type
Parameters:
  `type` - the argument type
  `value` - 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 an `SpringFactoriesLoader.ArgumentResolver` that resolves only the given type.

Type Parameters:
  `T` - the argument type
Parameters:
  `type` - the argument type
  `valueSupplier` - the argument value supplier
Returns:
  a new `SpringFactoriesLoader.ArgumentResolver` instance

### from

static SpringFactoriesLoader.ArgumentResolver from(Function<Class<?>,Object> function)
Factory method that creates a new `SpringFactoriesLoader.ArgumentResolver` from a lambda friendly function. The given function is provided with the argument type and must provide an instance of that type or `null`.

Parameters:
  `function` - the resolver function
Returns:
  a new `SpringFactoriesLoader.ArgumentResolver` instance backed by the function