Update to the v10 alpha due to nullability issues in v9

This commit is contained in:
Syer10
2026-05-09 15:29:34 -04:00
parent 193dd1ee84
commit b40447c4f9
26 changed files with 122 additions and 119 deletions

View File

@@ -3,12 +3,8 @@ package suwayomi.tachidesk.graphql.cache
import org.dataloader.CacheMap
import java.util.concurrent.CompletableFuture
class CustomCacheMap<K, V> : CacheMap<K, V> {
private val cache: MutableMap<K, CompletableFuture<V>>
init {
cache = HashMap()
}
class CustomCacheMap<K : Any, V : Any> : CacheMap<K, V> {
private val cache: MutableMap<K, CompletableFuture<V>> = HashMap()
override fun containsKey(key: K): Boolean = cache.containsKey(key)
@@ -18,12 +14,12 @@ class CustomCacheMap<K, V> : CacheMap<K, V> {
override fun getAll(): Collection<CompletableFuture<V>> = cache.values
override fun set(
override fun putIfAbsentAtomically(
key: K,
value: CompletableFuture<V>,
): CacheMap<K, V> {
): CompletableFuture<V> {
cache[key] = value
return this
return value
}
override fun delete(key: K): CacheMap<K, V> {
@@ -35,4 +31,8 @@ class CustomCacheMap<K, V> : CacheMap<K, V> {
cache.clear()
return this
}
override fun size(): Int {
return cache.size
}
}