small refactorings

This commit is contained in:
2020-09-26 22:02:12 +06:00
parent 1e72a4117a
commit 29b3e6b701
7 changed files with 19 additions and 27 deletions

View File

@@ -1,5 +0,0 @@
package dev.inmo.micro_utils.repos
import com.benasher44.uuid.uuid4
fun generateId() = uuid4().toString()

View File

@@ -12,12 +12,10 @@ interface OneToManyReadKeyValueRepo<Key, Value> : Repo {
suspend fun count(): Long
}
interface OneToManyWriteKeyValueRepo<Key, Value> :
Repo {
interface OneToManyWriteKeyValueRepo<Key, Value> : Repo {
suspend fun add(k: Key, v: Value)
suspend fun remove(k: Key, v: Value)
suspend fun clear(k: Key)
}
interface OneToManyKeyValueRepo<Key, Value> : OneToManyReadKeyValueRepo<Key, Value>,
OneToManyWriteKeyValueRepo<Key, Value>
interface OneToManyKeyValueRepo<Key, Value> : OneToManyReadKeyValueRepo<Key, Value>, OneToManyWriteKeyValueRepo<Key, Value>

View File

@@ -20,5 +20,4 @@ interface StandardWriteKeyValueRepo<Key, Value> : Repo {
suspend fun unset(k: Key)
}
interface StandardKeyValueRepo<Key, Value> : StandardReadKeyValueRepo<Key, Value>,
StandardWriteKeyValueRepo<Key, Value>
interface StandardKeyValueRepo<Key, Value> : StandardReadKeyValueRepo<Key, Value>, StandardWriteKeyValueRepo<Key, Value>