Class DependencyTreeCache<T>
java.lang.Object
com.vaadin.flow.component.internal.DependencyTreeCache<T>
- Type Parameters:
T
- the value type
- All Implemented Interfaces:
Serializable
A caching tree traverser for collecting and parsing dependencies.
For internal use only. May be renamed or removed in a future release.
- Since:
- 1.2
- Author:
- Vaadin Ltd
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionDependencyTreeCache
(SerializableFunction<T, Collection<T>> dependencyParser) Creates a dependency cache with the given dependency parser. -
Method Summary
Modifier and TypeMethodDescriptionvoid
clear()
Clears all the contents of the cache.getDependencies
(T node) Collects all transitive dependencies of the given node, including the node itself.
-
Constructor Details
-
DependencyTreeCache
Creates a dependency cache with the given dependency parser.- Parameters:
dependencyParser
- a potentially slow callback function that finds the direct dependencies for any given value
-
-
Method Details
-
getDependencies
Collects all transitive dependencies of the given node, including the node itself.- Parameters:
node
- the node for which to collect dependencies- Returns:
- the transitive dependencies of the given node
-
clear
public void clear()Clears all the contents of the cache. A lookup that is in progress while the cache is cleared may return a result that combines previously cached dependencies with newly parsed dependencies.
-