Package com.vaadin.ui

Interface ItemCaptionGenerator<T>

  • Type Parameters:
    T - item type
    All Superinterfaces:
    java.util.function.Function<T,​java.lang.String>, java.io.Serializable, SerializableFunction<T,​java.lang.String>
    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 ItemCaptionGenerator<T>
    extends SerializableFunction<T,​java.lang.String>
    ItemCaptionGenerator can be used to customize the string shown to the user for an item.
    Since:
    8.0
    Author:
    Vaadin Ltd
    See Also:
    ComboBox.setItemCaptionGenerator(ItemCaptionGenerator)
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      java.lang.String apply​(T item)
      Gets a caption for the item.
      • Methods inherited from interface java.util.function.Function

        andThen, compose
    • Method Detail

      • apply

        java.lang.String apply​(T item)
        Gets a caption for the item.
        Specified by:
        apply in interface java.util.function.Function<T,​java.lang.String>
        Parameters:
        item - the item to get caption for
        Returns:
        the caption of the item; null will be shown as an empty string