com.vaadin.flow.function.

Interface ValueProvider<SOURCE,TARGET>

  • Type Parameters:

    SOURCE - the type of the object used to provide the value

    TARGET - the type of the provided value

    All Superinterfaces:

    Function<SOURCE,TARGET>, Serializable, SerializableFunction<SOURCE,TARGET>

    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 interface ValueProvider<SOURCE,TARGET>
    extends SerializableFunction<SOURCE,TARGET>

    A callback interface for providing values from a given source.

    For example this interface can be implemented to simply extract a value with a getter, or to create a composite value based on the fields of the source object.

    Since:

    1.0.

    Author:

    Vaadin Ltd

    • Method Summary

      All Methods
      Modifier and Type Method and Description
      TARGET apply(SOURCE source)

      Provides a value from the given source object.

      static <T> ValueProvider<T,T> identity()

      Returns a value provider that always returns its input argument.

    • Method Detail

      • apply

        TARGET apply(SOURCE source)

        Provides a value from the given source object.

        Specified by:

        apply in interface Function<SOURCE,TARGET>

        Parameters:

        source - the source to retrieve the value from

        Returns:

        the value provided by the source