public class DirectoryListCache extends Object implements GraphEngineCache<DirectoryListKey,DirectoryList>
Modifier and Type | Class and Description |
---|---|
static class |
DirectoryListCache.Invalidator
Subscribes to watchman event and invalidates internal state of a provided
DirectoryListCache |
Modifier and Type | Method and Description |
---|---|
Optional<DirectoryList> |
get(DirectoryListKey key)
Optionally returns the cached result given the key
|
DirectoryListCache.Invalidator |
getInvalidator() |
static DirectoryListCache |
of(Path rootPath)
Create a new instance of
DirectoryListCache |
void |
put(DirectoryListKey key,
DirectoryList directoryList)
Offers the given key and value for caching
|
public static DirectoryListCache of(Path rootPath)
DirectoryListCache
rootPath
- Absolute path to the root folder for which files and subfolders are cachedpublic Optional<DirectoryList> get(DirectoryListKey key)
GraphEngineCache
get
in interface GraphEngineCache<DirectoryListKey,DirectoryList>
key
- The desired keypublic void put(DirectoryListKey key, DirectoryList directoryList)
GraphEngineCache
put
in interface GraphEngineCache<DirectoryListKey,DirectoryList>
key
- the key to cachedirectoryList
- the value to cachepublic DirectoryListCache.Invalidator getInvalidator()