Class CacheBuilder<K,​V>

  • Type Parameters:
    K - type of the cache key
    V - type of the cache value

    public class CacheBuilder<K,​V>
    extends Object
    Builder for a Microstream - JCache instance.
    • Constructor Detail

      • CacheBuilder

        protected CacheBuilder​(one.microstream.cache.types.CacheConfiguration<K,​V> configuration)
      • CacheBuilder

        protected CacheBuilder​(Class<K> keyType,
                               Class<V> valueType)
    • Method Detail

      • builder

        public static <K,​V> CacheBuilder<K,​V> builder​(one.microstream.cache.types.CacheConfiguration<K,​V> configuration,
                                                                  Class<K> keyType,
                                                                  Class<V> valueType)
        Create a new cache builder using the provided microstream cache configuration.
        Type Parameters:
        K - type of the cache key
        V - type of the cache value
        Parameters:
        configuration - CacheConfiguration
        keyType - class of the cache key
        valueType - class of the cache key
        Returns:
        cache builder
      • build

        public one.microstream.cache.types.Cache<K,​V> build​(String name)
        Set the name of the cache.
        Parameters:
        name - the cache name
        Returns:
        the new cache instance
      • create

        public static one.microstream.cache.types.Cache<?,​?> create​(String name,
                                                                          Config config,
                                                                          Class<?> keyType,
                                                                          Class<?> valueType)
        Create a named cache using the provided helidon configuration.
        Parameters:
        name - the cache name
        config - the helidon configuration
        keyType - class of the cache key
        valueType - class of the cache key
        Returns:
        the new cache instance