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 Details

    • ImmutableCacheResultsImpl

      public ImmutableCacheResultsImpl(@NotNull @NotNull Collection<T> results, @NotNull @NotNull Collection<T> cacheMisses)
  • Method Details

    • 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 interface ImmutableCacheResults<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 interface ImmutableCacheResults<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 interface ImmutableCacheResults<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 via ImmutableCacheResults.getResults()
      Specified by:
      stream in interface ImmutableCacheResults<T>
      Returns:
      A stream over all results.