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>
public class ImmutableCacheResultsImpl<T> extends Object implements ImmutableCacheResults<T>
Encapsulates results from cache, offering additional information about cache misses and hits.
-
-
Constructor Summary
Constructors Constructor Description ImmutableCacheResultsImpl(@NotNull Collection<T> results, @NotNull Collection<T> cacheMisses)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description @NotNull com.google.common.collect.ImmutableSet<T>
getCacheHits()
The result items that were found in the cache.@NotNull com.google.common.collect.ImmutableSet<T>
getCacheMisses()
The result items that were not found in the cache and had to be loaded from database.@NotNull com.google.common.collect.ImmutableSet<T>
getResults()
All items found either in the cache or that had to be loaded from database.@NotNull Stream<T>
stream()
Stream over all results exposed viaImmutableCacheResults.getResults()
-
-
-
Constructor Detail
-
ImmutableCacheResultsImpl
public ImmutableCacheResultsImpl(@NotNull @NotNull Collection<T> results, @NotNull @NotNull Collection<T> cacheMisses)
-
-
Method Detail
-
getCacheHits
@NotNull public @NotNull com.google.common.collect.ImmutableSet<T> 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
@NotNull public @NotNull com.google.common.collect.ImmutableSet<T> 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
@NotNull public @NotNull com.google.common.collect.ImmutableSet<T> 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
@NotNull public @NotNull Stream<T> 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.
-
-