sealed для IStorageInfo
This commit is contained in:
@@ -3,7 +3,7 @@ package com.github.nullptroma.wallenc.domain.interfaces
|
||||
import kotlinx.coroutines.flow.StateFlow
|
||||
import java.util.UUID
|
||||
|
||||
interface IStorageInfo {
|
||||
sealed interface IStorageInfo {
|
||||
val size: StateFlow<Long?>
|
||||
val numberOfFiles: StateFlow<Int?>
|
||||
val uuid: UUID
|
||||
|
||||
@@ -9,9 +9,9 @@ class StorageFileManagementUseCase {
|
||||
private var _storage: IStorage? = null
|
||||
|
||||
fun setStorage(storage: IStorageInfo) {
|
||||
if(storage !is IStorage)
|
||||
throw Exception("Cannot manage storage on StorageInfo")
|
||||
_storage = storage
|
||||
//if(storage !is IStorage)
|
||||
// throw Exception("Can not manage storage on StorageInfo")
|
||||
_storage = storage as IStorage
|
||||
}
|
||||
|
||||
suspend fun getAllFiles(): List<IFile> {
|
||||
|
||||
Reference in New Issue
Block a user