Interface AssertFactory.ValueProvider<T>

Type Parameters:
T - the type of provided value.
All Superinterfaces:
Function<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 Function<Type,T>
A provider that provides a value compatible with a given Type.
Since:
3.26.0
  • Method Summary

    Modifier and Type
    Method
    Description
    default T
    apply(Type type)
    Provides a value compatible with the given type.
    provide(Type type)
    Provides a value compatible with the given type.

    Methods inherited from interface java.util.function.Function

    andThen, compose
  • Method Details

    • provide

      T provide(Type type)
      Provides a value compatible with the given type.

      The compatibility definition depends on the actual type instance:

      • If type is a Class, the provided value must be an instance of it.
      • If type is a ParameterizedType, the provided value must be an instance of its raw type.
      All other Type subtypes are unsupported.
      Parameters:
      type - the given type, either a Class or a ParameterizedType instance
      Returns:
      the provided value
    • apply

      default T apply(Type type)
      Provides a value compatible with the given type.
      Specified by:
      apply in interface Function<Type,T>
      Parameters:
      type - the given type
      Returns:
      the provided value
      Throws:
      IllegalArgumentException - if type is neither a Class nor a ParameterizedType instance