-
public class DiskCacheConfig.Builder
-
-
Method Summary
Modifier and Type Method Description DiskCacheConfig.BuildersetVersion(int version)Sets the version. DiskCacheConfig.BuildersetBaseDirectoryName(String baseDirectoryName)Sets the name of the directory where the cache will be located. DiskCacheConfig.BuildersetBaseDirectoryPath(File baseDirectoryPath)Sets the path to the base directory. DiskCacheConfig.BuildersetBaseDirectoryPathSupplier(Supplier<File> baseDirectoryPathSupplier)DiskCacheConfig.BuildersetMaxCacheSize(long maxCacheSize)This is the default maximum size of the cache. DiskCacheConfig.BuildersetMaxCacheSizeOnLowDiskSpace(long maxCacheSizeOnLowDiskSpace)This is the maximum size of the cache that is used when the device is low on disk space. DiskCacheConfig.BuildersetMaxCacheSizeOnVeryLowDiskSpace(long maxCacheSizeOnVeryLowDiskSpace)This is the maximum size of the cache when the device is extremely low on disk space. DiskCacheConfig.BuildersetEntryEvictionComparatorSupplier(EntryEvictionComparatorSupplier supplier)Provides the logic to determine the eviction order based on entry's access time and size DiskCacheConfig.BuildersetCacheErrorLogger(CacheErrorLogger cacheErrorLogger)The logger that is used to log errors made by the cache. DiskCacheConfig.BuildersetCacheEventListener(CacheEventListener cacheEventListener)The listener for cache events. DiskCacheConfig.BuildersetDiskTrimmableRegistry(DiskTrimmableRegistry diskTrimmableRegistry)The class that will contain a registry of caches to be trimmed in low disk space conditions. DiskCacheConfig.BuildersetIndexPopulateAtStartupEnabled(boolean indexEnabled)DiskCacheConfigbuild()-
-
Method Detail
-
setVersion
DiskCacheConfig.Builder setVersion(int version)
Sets the version.
The cache lives in a subdirectory identified by this version.
-
setBaseDirectoryName
DiskCacheConfig.Builder setBaseDirectoryName(String baseDirectoryName)
Sets the name of the directory where the cache will be located.
-
setBaseDirectoryPath
DiskCacheConfig.Builder setBaseDirectoryPath(File baseDirectoryPath)
Sets the path to the base directory.
A directory with the given base directory name (see
{@code setBaseDirectoryName}) will beappended to this path.
-
setBaseDirectoryPathSupplier
DiskCacheConfig.Builder setBaseDirectoryPathSupplier(Supplier<File> baseDirectoryPathSupplier)
-
setMaxCacheSize
DiskCacheConfig.Builder setMaxCacheSize(long maxCacheSize)
This is the default maximum size of the cache.
-
setMaxCacheSizeOnLowDiskSpace
DiskCacheConfig.Builder setMaxCacheSizeOnLowDiskSpace(long maxCacheSizeOnLowDiskSpace)
This is the maximum size of the cache that is used when the device is low on disk space.
See trimToMinimum.
-
setMaxCacheSizeOnVeryLowDiskSpace
DiskCacheConfig.Builder setMaxCacheSizeOnVeryLowDiskSpace(long maxCacheSizeOnVeryLowDiskSpace)
This is the maximum size of the cache when the device is extremely low on disk space.
See trimToNothing.
-
setEntryEvictionComparatorSupplier
DiskCacheConfig.Builder setEntryEvictionComparatorSupplier(EntryEvictionComparatorSupplier supplier)
Provides the logic to determine the eviction order based on entry's access time and size
-
setCacheErrorLogger
DiskCacheConfig.Builder setCacheErrorLogger(CacheErrorLogger cacheErrorLogger)
The logger that is used to log errors made by the cache.
-
setCacheEventListener
DiskCacheConfig.Builder setCacheEventListener(CacheEventListener cacheEventListener)
The listener for cache events.
-
setDiskTrimmableRegistry
DiskCacheConfig.Builder setDiskTrimmableRegistry(DiskTrimmableRegistry diskTrimmableRegistry)
The class that will contain a registry of caches to be trimmed in low disk space conditions.
See DiskTrimmableRegistry.
-
setIndexPopulateAtStartupEnabled
DiskCacheConfig.Builder setIndexPopulateAtStartupEnabled(boolean indexEnabled)
-
build
DiskCacheConfig build()
-
-
-
-