Class 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 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 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.