copyWith<E extends DatumEntityInterface> method
DatumConfig<E>
copyWith<E extends DatumEntityInterface>({
- Duration? autoSyncInterval,
- bool? autoStartSync,
- Duration? syncTimeout,
- DatumConflictResolver<
E> ? defaultConflictResolver, - UserSwitchStrategy? defaultUserSwitchStrategy,
- Future<
String?> initialUserId()?, - bool? enableLogging,
- SyncDirection? defaultSyncDirection,
- int? schemaVersion,
- List<
Migration> ? migrations, - DatumSyncExecutionStrategy? syncExecutionStrategy,
- MigrationErrorHandler? onMigrationError,
- DatumSyncRequestStrategy? syncRequestStrategy,
- DatumErrorRecoveryStrategy? errorRecoveryStrategy,
- Duration? remoteEventDebounceTime,
- Duration? changeCacheDuration,
- DatumSyncOptions<
E> ? defaultSyncOptions, - int? maxChangeCacheSize,
- Duration? changeCacheCleanupInterval,
- int? remoteSyncBatchSize,
- int? remoteStreamBatchSize,
- int? progressEventFrequency,
- LogLevel? logLevel,
- bool? enablePerformanceLogging,
- Duration? performanceLogThreshold,
- Map<
String, LogSampler> ? logSamplers, - SyncDirectionResolver? syncDirectionResolver,
- ColdStartConfig? coldStartConfig,
- DeleteBehavior? deleteBehavior,
- Set<
String> ? excludedSyncUserIds, - bool? detectRemoteDeletions,
- bool? enableQueryCache,
- bool? enableMetadataHashCache,
- bool? enableDeltaSync,
- Duration? deltaSyncOverlap,
- int? maxQueryCacheSize,
- int? maxRelationshipQueryCacheSize,
- int? maxEntityExistenceCacheSize,
- bool? useIsolateSync,
- DatumSchema<
E> ? schema, - bool? autoMigrate,
- bool? autoMigrateDropColumns,
Implementation
DatumConfig<E> copyWith<E extends DatumEntityInterface>({
Duration? autoSyncInterval,
bool? autoStartSync,
Duration? syncTimeout,
DatumConflictResolver<E>? defaultConflictResolver,
UserSwitchStrategy? defaultUserSwitchStrategy,
Future<String?> Function()? initialUserId,
bool? enableLogging,
SyncDirection? defaultSyncDirection,
int? schemaVersion,
List<Migration>? migrations,
DatumSyncExecutionStrategy? syncExecutionStrategy,
MigrationErrorHandler? onMigrationError,
DatumSyncRequestStrategy? syncRequestStrategy,
DatumErrorRecoveryStrategy? errorRecoveryStrategy,
Duration? remoteEventDebounceTime,
Duration? changeCacheDuration,
DatumSyncOptions<E>? defaultSyncOptions,
int? maxChangeCacheSize,
Duration? changeCacheCleanupInterval,
int? remoteSyncBatchSize,
int? remoteStreamBatchSize,
int? progressEventFrequency,
LogLevel? logLevel,
bool? enablePerformanceLogging,
Duration? performanceLogThreshold,
Map<String, LogSampler>? logSamplers,
SyncDirectionResolver? syncDirectionResolver,
ColdStartConfig? coldStartConfig,
DeleteBehavior? deleteBehavior,
Set<String>? excludedSyncUserIds,
bool? detectRemoteDeletions,
bool? enableQueryCache,
bool? enableMetadataHashCache,
bool? enableDeltaSync,
Duration? deltaSyncOverlap,
int? maxQueryCacheSize,
int? maxRelationshipQueryCacheSize,
int? maxEntityExistenceCacheSize,
bool? useIsolateSync,
DatumSchema<E>? schema,
bool? autoMigrate,
bool? autoMigrateDropColumns,
}) {
return DatumConfig<E>(
autoSyncInterval: autoSyncInterval ?? this.autoSyncInterval,
autoStartSync: autoStartSync ?? this.autoStartSync,
syncTimeout: syncTimeout ?? this.syncTimeout,
// Preserve the resolver across the generic boundary. Because generics are
// invariant, a `DatumConflictResolver<T>` (e.g. a global
// `<DatumEntityInterface>` default) is not directly a
// `DatumConflictResolver<E>`; rather than dropping it to null (the old
// bug), wrap it in a [TypeAdaptedConflictResolver] when the types differ.
defaultConflictResolver: defaultConflictResolver ?? _adaptResolver<E>(),
defaultUserSwitchStrategy: defaultUserSwitchStrategy ?? this.defaultUserSwitchStrategy,
initialUserId: initialUserId ?? this.initialUserId,
enableLogging: enableLogging ?? this.enableLogging,
defaultSyncDirection: defaultSyncDirection ?? this.defaultSyncDirection,
schemaVersion: schemaVersion ?? this.schemaVersion,
migrations: migrations ?? this.migrations,
syncExecutionStrategy: syncExecutionStrategy ?? this.syncExecutionStrategy,
onMigrationError: onMigrationError ?? this.onMigrationError,
syncRequestStrategy: syncRequestStrategy ?? this.syncRequestStrategy,
errorRecoveryStrategy: errorRecoveryStrategy ?? this.errorRecoveryStrategy,
remoteEventDebounceTime: remoteEventDebounceTime ?? this.remoteEventDebounceTime,
changeCacheDuration: changeCacheDuration ?? this.changeCacheDuration,
defaultSyncOptions: defaultSyncOptions ?? (this.defaultSyncOptions is DatumSyncOptions<E> ? this.defaultSyncOptions as DatumSyncOptions<E> : null),
maxChangeCacheSize: maxChangeCacheSize ?? this.maxChangeCacheSize,
changeCacheCleanupInterval: changeCacheCleanupInterval ?? this.changeCacheCleanupInterval,
remoteSyncBatchSize: remoteSyncBatchSize ?? this.remoteSyncBatchSize,
remoteStreamBatchSize: remoteStreamBatchSize ?? this.remoteStreamBatchSize,
progressEventFrequency: progressEventFrequency ?? this.progressEventFrequency,
logLevel: logLevel ?? this.logLevel,
enablePerformanceLogging: enablePerformanceLogging ?? this.enablePerformanceLogging,
performanceLogThreshold: performanceLogThreshold ?? this.performanceLogThreshold,
logSamplers: logSamplers ?? this.logSamplers,
syncDirectionResolver: syncDirectionResolver ?? this.syncDirectionResolver,
coldStartConfig: coldStartConfig ?? this.coldStartConfig,
deleteBehavior: deleteBehavior ?? this.deleteBehavior,
excludedSyncUserIds: excludedSyncUserIds ?? this.excludedSyncUserIds,
detectRemoteDeletions: detectRemoteDeletions ?? this.detectRemoteDeletions,
enableQueryCache: enableQueryCache ?? this.enableQueryCache,
enableMetadataHashCache: enableMetadataHashCache ?? this.enableMetadataHashCache,
enableDeltaSync: enableDeltaSync ?? this.enableDeltaSync,
deltaSyncOverlap: deltaSyncOverlap ?? this.deltaSyncOverlap,
maxQueryCacheSize: maxQueryCacheSize ?? this.maxQueryCacheSize,
maxRelationshipQueryCacheSize: maxRelationshipQueryCacheSize ?? this.maxRelationshipQueryCacheSize,
maxEntityExistenceCacheSize: maxEntityExistenceCacheSize ?? this.maxEntityExistenceCacheSize,
useIsolateSync: useIsolateSync ?? this.useIsolateSync,
schema: schema ?? (this.schema is DatumSchema<E> ? this.schema as DatumSchema<E> : null),
autoMigrate: autoMigrate ?? this.autoMigrate,
autoMigrateDropColumns: autoMigrateDropColumns ?? this.autoMigrateDropColumns,
);
}