public class DependencyCache<T>
extends java.lang.Object
The objects are cached when retrieved, and will not be fetched again until invalidation of the cache.
Constructor and Description |
---|
DependencyCache(ProjectFile projectFile,
java.lang.String dependencyName,
java.lang.Class<T> dependencyClass) |
Modifier and Type | Method and Description |
---|---|
java.util.List<T> |
getAll()
Gets all the dependencies of the project file which match the specified dependency name and class.
|
java.util.Optional<T> |
getFirst()
Gets the first dependency of the project file which matches the specified dependency name and class.
|
void |
invalidate()
Invalidates the cache: dependencies will be fetched again on next request.
|
public DependencyCache(ProjectFile projectFile, java.lang.String dependencyName, java.lang.Class<T> dependencyClass)
public void invalidate()
public java.util.Optional<T> getFirst()
public java.util.List<T> getAll()
Copyright © 2019. All rights reserved.