Class CacheFactory

java.lang.Object
com.github.mjeanroy.dbunit.cache.CacheFactory

public final class CacheFactory extends Object
Factory for Cache instances.
  • Method Details

    • newCache

      public static <K,V> Cache<K,V> newCache(CacheLoader<K,V> loader)
      Create new cache. Note that:
      • If Guava is available, a Cache implemented with Guava is returned.
      • If Guava is not available, a dependency-free Cache is returned.
      Type Parameters:
      K - Type of keys in the cache.
      V - Type of values in the cache.
      Parameters:
      loader - The cache loader.
      Returns:
      The new cache instance.