Package com.atlassian.bamboo.plan.cache
Class ImmutableCacheResultsImpl<T>
java.lang.Object
com.atlassian.bamboo.plan.cache.ImmutableCacheResultsImpl<T>
- Type Parameters:
T
-
- All Implemented Interfaces:
ImmutableCacheResults<T>
Encapsulates results from cache, offering additional information about cache misses and hits.
-
Constructor Summary
ConstructorDescriptionImmutableCacheResultsImpl
(@NotNull Collection<T> results, @NotNull Collection<T> cacheMisses) -
Method Summary
Modifier and TypeMethodDescription@NotNull com.google.common.collect.ImmutableSet<T>
The result items that were found in the cache.@NotNull com.google.common.collect.ImmutableSet<T>
The result items that were not found in the cache and had to be loaded from database.@NotNull com.google.common.collect.ImmutableSet<T>
All items found either in the cache or that had to be loaded from database.stream()
Stream over all results exposed viaImmutableCacheResults.getResults()
-
Constructor Details
-
ImmutableCacheResultsImpl
public ImmutableCacheResultsImpl(@NotNull @NotNull Collection<T> results, @NotNull @NotNull Collection<T> cacheMisses)
-
-
Method Details
-
getCacheHits
Description copied from interface:ImmutableCacheResults
The result items that were found in the cache.- Specified by:
getCacheHits
in interfaceImmutableCacheResults<T>
- Returns:
- The result items that were found in the cache.
-
getCacheMisses
Description copied from interface:ImmutableCacheResults
The result items that were not found in the cache and had to be loaded from database.- Specified by:
getCacheMisses
in interfaceImmutableCacheResults<T>
- Returns:
- The result items that were not found in the cache and had to be loaded from database.
-
getResults
Description copied from interface:ImmutableCacheResults
All items found either in the cache or that had to be loaded from database.- Specified by:
getResults
in interfaceImmutableCacheResults<T>
- Returns:
- All items found either in the cache or that had to be loaded from database.
-
stream
Description copied from interface:ImmutableCacheResults
Stream over all results exposed viaImmutableCacheResults.getResults()
- Specified by:
stream
in interfaceImmutableCacheResults<T>
- Returns:
- A stream over all results.
-