com.vaadin.flow.templatemodel.

Class PathLookup<T>

  • Type Parameters:

    T - the item type


    public class PathLookup<T>
    extends Object

    A map for items that are looked up by hierarchical keys made up of period separated strings.

    Since:

    1.0

    Author:

    Vaadin Ltd

    • Method Detail

      • compose

        public PathLookup<T> compose(Map<String,T> newItems,
                                     String pathPrefix)

        Composes a new path lookup that contains all items of this path lookup and all provided items supplemented with the provided path prefix.

        Parameters:

        newItems - new items to include in the composition

        pathPrefix - the prefix to include in the key of all new items

        Returns:

        a new path lookup composition

      • empty

        public static <T> PathLookup<T> empty()

        Creates an empty path lookup.

        Type Parameters:

        T - the item type

        Returns:

        and empty path lookup

      • getItem

        public Optional<T> getItem(String fullPath)

        Gets the item for the provided full path.

        Parameters:

        fullPath - the fully qualified path for which to find an item

        Returns:

        the item corresponding to the path, or an empty optional if there is no item