public static class

DiskCacheConfig.Builder

extends Object
java.lang.Object
   ↳ com.facebook.cache.disk.DiskCacheConfig.Builder

Summary

Public Methods
DiskCacheConfig build()
DiskCacheConfig.Builder setBaseDirectoryName(String baseDirectoryName)
Sets the name of the directory where the cache will be located.
DiskCacheConfig.Builder setBaseDirectoryPath(File baseDirectoryPath)
Sets the path to the base directory.
DiskCacheConfig.Builder setBaseDirectoryPathSupplier(Supplier<File> baseDirectoryPathSupplier)
DiskCacheConfig.Builder setCacheErrorLogger(CacheErrorLogger cacheErrorLogger)
The logger that is used to log errors made by the cache.
DiskCacheConfig.Builder setCacheEventListener(CacheEventListener cacheEventListener)
The listener for cache events.
DiskCacheConfig.Builder setDiskTrimmableRegistry(DiskTrimmableRegistry diskTrimmableRegistry)
The class that will contain a registry of caches to be trimmed in low disk space conditions.
DiskCacheConfig.Builder setEntryEvictionComparatorSupplier(EntryEvictionComparatorSupplier supplier)
Provides the logic to determine the eviction order based on entry's access time and size
DiskCacheConfig.Builder setIndexPopulateAtStartupEnabled(boolean indexEnabled)
DiskCacheConfig.Builder setMaxCacheSize(long maxCacheSize)
This is the default maximum size of the cache.
DiskCacheConfig.Builder setMaxCacheSizeOnLowDiskSpace(long maxCacheSizeOnLowDiskSpace)
This is the maximum size of the cache that is used when the device is low on disk space.
DiskCacheConfig.Builder setMaxCacheSizeOnVeryLowDiskSpace(long maxCacheSizeOnVeryLowDiskSpace)
This is the maximum size of the cache when the device is extremely low on disk space.
DiskCacheConfig.Builder setVersion(int version)
Sets the version.
[Expand]
Inherited Methods
From class java.lang.Object

Public Methods

public DiskCacheConfig build ()

public DiskCacheConfig.Builder setBaseDirectoryName (String baseDirectoryName)

Sets the name of the directory where the cache will be located.

public DiskCacheConfig.Builder setBaseDirectoryPath (File baseDirectoryPath)

Sets the path to the base directory.

A directory with the given base directory name (see setBaseDirectoryName) will be appended to this path.

public DiskCacheConfig.Builder setBaseDirectoryPathSupplier (Supplier<File> baseDirectoryPathSupplier)

public DiskCacheConfig.Builder setCacheErrorLogger (CacheErrorLogger cacheErrorLogger)

The logger that is used to log errors made by the cache.

public DiskCacheConfig.Builder setCacheEventListener (CacheEventListener cacheEventListener)

The listener for cache events.

public DiskCacheConfig.Builder setDiskTrimmableRegistry (DiskTrimmableRegistry diskTrimmableRegistry)

The class that will contain a registry of caches to be trimmed in low disk space conditions.

See DiskTrimmableRegistry.

public DiskCacheConfig.Builder setEntryEvictionComparatorSupplier (EntryEvictionComparatorSupplier supplier)

Provides the logic to determine the eviction order based on entry's access time and size

public DiskCacheConfig.Builder setIndexPopulateAtStartupEnabled (boolean indexEnabled)

public DiskCacheConfig.Builder setMaxCacheSize (long maxCacheSize)

This is the default maximum size of the cache.

public 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().

public DiskCacheConfig.Builder setMaxCacheSizeOnVeryLowDiskSpace (long maxCacheSizeOnVeryLowDiskSpace)

This is the maximum size of the cache when the device is extremely low on disk space.

See trimToNothing().

public DiskCacheConfig.Builder setVersion (int version)

Sets the version.

The cache lives in a subdirectory identified by this version.