Package org.assertj.core.api
Interface AssertFactory.ValueProvider<T>
- Type Parameters:
T
- the type of provided value.
- Enclosing interface:
AssertFactory<T,
ASSERT extends Assert<?, ?>>
- 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 AssertFactory.ValueProvider<T>
extends Function<Type,T>
A provider that provides a value compatible with a given
Type
.- Since:
- 3.26.0
-
Method Summary
-
Method Details
-
provide
Provides a value compatible with the giventype
.The compatibility definition depends on the actual
type
instance:- If
type
is aClass
, the provided value must be an instance of it. - If
type
is aParameterizedType
, the provided value must be an instance of itsraw type
.
Type
subtypes are unsupported.- Parameters:
type
- the given type, either aClass
or aParameterizedType
instance- Returns:
- the provided value
- If
-
apply
Provides a value compatible with the giventype
.- Specified by:
apply
in interfaceFunction<Type,
T> - Parameters:
type
- the given type- Returns:
- the provided value
- Throws:
IllegalArgumentException
- iftype
is neither aClass
nor aParameterizedType
instance
-