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 given Type.
    Since:
    3.26.0
    • Method Summary

      All Methods Instance Methods Abstract Methods Default Methods 
      Modifier and Type Method Description
      default T apply​(java.lang.reflect.Type type)
      Provides a value compatible with the given type.
      T provide​(java.lang.reflect.Type type)
      Provides a value compatible with the given type.
      • Methods inherited from interface java.util.function.Function

        andThen, compose
    • Method Detail

      • provide

        T provide​(java.lang.reflect.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​(java.lang.reflect.Type type)
        Provides a value compatible with the given type.
        Specified by:
        apply in interface java.util.function.Function<java.lang.reflect.Type,​T>
        Parameters:
        type - the given type
        Returns:
        the provided value
        Throws:
        java.lang.IllegalArgumentException - if type is neither a Class nor a ParameterizedType instance