Package org.assertj.core.api
Interface AssertFactory.ValueProvider<T>
-
- Type Parameters:
T- the type of provided value.
- All Superinterfaces:
java.util.function.Function<java.lang.reflect.Type,T>
- 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 java.util.function.Function<java.lang.reflect.Type,T>A provider that provides a value compatible with a givenType.- Since:
- 3.26.0
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default Tapply(java.lang.reflect.Type type)Provides a value compatible with the giventype.Tprovide(java.lang.reflect.Type type)Provides a value compatible with the giventype.
-
-
-
Method Detail
-
provide
T provide(java.lang.reflect.Type type)
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
default T apply(java.lang.reflect.Type type)
Provides a value compatible with the giventype.- Specified by:
applyin interfacejava.util.function.Function<java.lang.reflect.Type,T>- Parameters:
type- the given type- Returns:
- the provided value
- Throws:
java.lang.IllegalArgumentException- iftypeis neither aClassnor aParameterizedTypeinstance
-
-