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
typeinstance:- If
typeis aClass, the provided value must be an instance of it. - If
typeis aParameterizedType, the provided value must be an instance of itsraw type.
Typesubtypes are unsupported.- Parameters:
type- the given type, either aClassor aParameterizedTypeinstance- Returns:
- the provided value
- If
-
apply
Provides a value compatible with the giventype.- Specified by:
applyin interfaceFunction<Type,T> - Parameters:
type- the given type- Returns:
- the provided value
- Throws:
IllegalArgumentException- iftypeis neither aClassnor aParameterizedTypeinstance
-