Class NoopCacheBuilder

  • All Implemented Interfaces:
    JdbiCacheBuilder

    public final class NoopCacheBuilder
    extends java.lang.Object
    implements JdbiCacheBuilder
    Cache builder for the no op cache.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      <K,​V>
      JdbiCache<K,​V>
      build()
      Creates an cache instance from the values in the builder.
      <K,​V>
      JdbiCache<K,​V>
      buildWithLoader​(JdbiCacheLoader<K,​V> cacheLoader)
      Creates an cache instance from the values in the builder and a supplied cache loader.
      JdbiCacheBuilder maxSize​(int maxSize)
      Sets an upper boundary to the cache size.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • NoopCacheBuilder

        NoopCacheBuilder()
    • Method Detail

      • build

        public <K,​V> JdbiCache<K,​V> build()
        Description copied from interface: JdbiCacheBuilder
        Creates an cache instance from the values in the builder.
        Specified by:
        build in interface JdbiCacheBuilder
        Returns:
        A cache instance.
      • buildWithLoader

        public <K,​V> JdbiCache<K,​V> buildWithLoader​(JdbiCacheLoader<K,​V> cacheLoader)
        Description copied from interface: JdbiCacheBuilder
        Creates an cache instance from the values in the builder and a supplied cache loader.
        Specified by:
        buildWithLoader in interface JdbiCacheBuilder
        Parameters:
        cacheLoader - A JdbiCacheLoader instance that is used to create a new value if no value is currently stored in the cache.
      • maxSize

        public JdbiCacheBuilder maxSize​(int maxSize)
        Description copied from interface: JdbiCacheBuilder
        Sets an upper boundary to the cache size.
        Specified by:
        maxSize in interface JdbiCacheBuilder
        Parameters:
        maxSize - Sets the maximum size of the cache. If the value is zero or negative, the cache is unbounded.
        Returns:
        The instance of the builder itself.