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