Interface CacheBinding<K,​V>


  • public interface CacheBinding<K,​V>
    Configure a cache declared within a CacheModule instance.
    • Method Detail

      • maximumWeight

        CacheBinding<K,​V> maximumWeight​(long weight)
        Set the total size of the cache.
      • diskLimit

        CacheBinding<K,​V> diskLimit​(long limit)
        Set the total on-disk limit of the cache
      • expireAfterWrite

        CacheBinding<K,​V> expireAfterWrite​(long duration,
                                                 TimeUnit durationUnits)
        Set the time an element lives before being expired.
      • loader

        CacheBinding<K,​V> loader​(Class<? extends com.google.common.cache.CacheLoader<K,​V>> clazz)
        Populate the cache with items from the CacheLoader.
      • weigher

        CacheBinding<K,​V> weigher​(Class<? extends com.google.common.cache.Weigher<K,​V>> clazz)
        Algorithm to weigh an object with a method other than the unit weight 1.
      • keyType

        com.google.inject.TypeLiteral<K> keyType()
      • valueType

        com.google.inject.TypeLiteral<V> valueType()
      • maximumWeight

        long maximumWeight()
      • diskLimit

        long diskLimit()
      • expireAfterWrite

        Long expireAfterWrite​(TimeUnit unit)
      • weigher

        com.google.common.cache.Weigher<K,​V> weigher()
      • loader

        com.google.common.cache.CacheLoader<K,​V> loader()