Interface CuratorCacheAccessor
-
- All Known Subinterfaces:
CuratorCache,CuratorCacheBridge,CuratorCacheStorage
public interface CuratorCacheAccessorMethods to access the underlying storage
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Modifier and Type Method Description java.util.Optional<ChildData>get(java.lang.String path)Return an entry from storagestatic java.util.function.Predicate<ChildData>parentPathFilter(java.lang.String parentPath)Filter for a ChildData stream.intsize()Return the current number of entries in storagejava.util.stream.Stream<ChildData>stream()Return a stream over the storage entries.
-
-
-
Method Detail
-
get
java.util.Optional<ChildData> get(java.lang.String path)
Return an entry from storage- Parameters:
path- path to get- Returns:
- entry or
empty()
-
size
int size()
Return the current number of entries in storage- Returns:
- number of entries
-
stream
java.util.stream.Stream<ChildData> stream()
Return a stream over the storage entries. Note: for a standard storage instance, the stream behaves like a stream returned byConcurrentHashMap.entrySet()- Returns:
- stream over entries
-
parentPathFilter
static java.util.function.Predicate<ChildData> parentPathFilter(java.lang.String parentPath)
Filter for a ChildData stream. Only ChildDatas with the given parent path pass the filter. This is useful to stream one level below a given path in the cache. e.g. to stream only the first level below the root of the cache.CuratorCache cache = ... cache.stream().filter(parentPathFilter(root))... // etc
- Parameters:
parentPath- the parent path to filter on- Returns:
- filtered stream
-
-