CacheConfigurationModel class
Model representing cache configuration settings
Constructors
-
CacheConfigurationModel({required String name, int maxCacheSize = CacheConstants.defaultMaxDiskCacheSize, int maxCacheEntries = CacheConstants.defaultMaxCacheEntries, Duration defaultTtl = CacheConstants.defaultCacheTtl, CacheExpirationPolicy expirationPolicy = CacheExpirationPolicy.ttl, CacheStorageLevel storageLevel = CacheStorageLevel.multiLevel, CacheFileType fileType = CacheFileType.general, bool autoCleanupEnabled = true, double cleanupThreshold = CacheConstants.cacheCleanupThreshold, double cleanupTargetRatio = CacheConstants.cacheCleanupTargetRatio, Duration cleanupInterval = CacheConstants.cacheCleanupInterval, bool wifiOnlyMode = false, int maxConcurrentDownloads = CacheConstants.defaultMaxConcurrentDownloads, Duration networkTimeout = CacheConstants.defaultNetworkTimeout, Duration downloadTimeout = CacheConstants.defaultDownloadTimeout, int retryAttempts = CacheConstants.defaultRetryAttempts, Duration retryDelay = CacheConstants.defaultRetryDelay, bool enabled = true, bool debugMode = false, String? customCacheDirectory, Map<
String, String> customHeaders = const <String, String>{}, CachePriority priority = CachePriority.normal, bool validateIntegrity = true, bool enableCompression = false, bool enableEncryption = false, Map<String, Object?> metadata = const <String, Object?>{}}) -
Constructor for CacheConfigurationModel
const
- CacheConfigurationModel.audioConfig()
-
Create audio-specific configuration
factory
- CacheConfigurationModel.defaultConfig()
-
Create default configuration
factory
- CacheConfigurationModel.documentConfig()
-
Create document-specific configuration
factory
-
CacheConfigurationModel.fromMap(Map<
String, Object?> map) -
Create configuration from JSON map
factory
- CacheConfigurationModel.imageConfig()
-
Create image-specific configuration
factory
- CacheConfigurationModel.videoConfig()
-
Create video-specific configuration
factory
Properties
- autoCleanupEnabled → bool
-
Whether auto cleanup is enabled
final
- cleanupInterval → Duration
-
Cleanup interval
final
- cleanupTargetRatio → double
-
Target ratio after cleanup (0.0 to 1.0)
final
- cleanupThreshold → double
-
Cache cleanup threshold (0.0 to 1.0)
final
- customCacheDirectory → String?
-
Custom cache directory path
final
-
customHeaders
→ Map<
String, String> -
Custom HTTP headers for requests
final
- debugMode → bool
-
Whether debug mode is enabled
final
- defaultTtl → Duration
-
Default TTL for cache entries
final
- downloadTimeout → Duration
-
Download timeout duration
final
- enableCompression → bool
-
Whether to compress cached files
final
- enabled → bool
-
Whether cache is enabled
final
- enableEncryption → bool
-
Whether to encrypt cached files
final
- expirationPolicy → CacheExpirationPolicy
-
Cache expiration policy
final
- fileType → CacheFileType
-
Cache file type this configuration applies to
final
- formattedMaxCacheSize → String
-
Get formatted cache size
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- isValid → bool
-
Check if configuration is valid
no setter
- maxCacheEntries → int
-
Maximum number of cache entries
final
- maxCacheSize → int
-
Maximum cache size in bytes
final
- maxConcurrentDownloads → int
-
Maximum concurrent downloads
final
-
metadata
→ Map<
String, Object?> -
Custom metadata for this configuration
final
- name → String
-
Configuration name or identifier
final
- networkTimeout → Duration
-
Network timeout duration
final
- priority → CachePriority
-
Cache priority for this configuration
final
-
props
→ List<
Object?> -
The list of properties that will be used to determine whether
two instances are equal.
no setter
- retryAttempts → int
-
Number of retry attempts for failed downloads
final
- retryDelay → Duration
-
Delay between retry attempts
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- storageLevel → CacheStorageLevel
-
Cache storage level (memory, disk, or multi-level)
final
- stringify → bool?
-
If set to
true, thetoStringmethod will be overridden to output this instance'sprops.no setterinherited - validateIntegrity → bool
-
Whether to validate cache integrity
final
- wifiOnlyMode → bool
-
Whether to only download on WiFi
final
Methods
-
copyWith(
{String? name, int? maxCacheSize, int? maxCacheEntries, Duration? defaultTtl, CacheExpirationPolicy? expirationPolicy, CacheStorageLevel? storageLevel, CacheFileType? fileType, bool? autoCleanupEnabled, double? cleanupThreshold, double? cleanupTargetRatio, Duration? cleanupInterval, bool? wifiOnlyMode, int? maxConcurrentDownloads, Duration? networkTimeout, Duration? downloadTimeout, int? retryAttempts, Duration? retryDelay, bool? enabled, bool? debugMode, String? customCacheDirectory, Map< String, String> ? customHeaders, CachePriority? priority, bool? validateIntegrity, bool? enableCompression, bool? enableEncryption, Map<String, Object?> ? metadata}) → CacheConfigurationModel - Create a copy with updated values
-
fromJson(
String json) → CacheConfigurationModel -
Converts the object from a JSON string representation.
inherited
-
fromMap(
Map< String, Object?> map) → CacheConfigurationModel - Converts the object from a Map representation.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toJson(
) → String -
Converts the object to a JSON string representation.
inherited
-
toMap(
) → Map< String, Object?> -
Converts the
BaseDataModelobject to a Map representation. -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited