Rename
This commit is contained in:
1 parent
b86d90021c
commit
6c0757c91b
972 files changed
+6885
-7321
No files matched your search
@@ -0,0 +1,32 @@
|
||||
package io.legato.kazusa.help
|
||||
|
||||
object IntentData {
|
||||
|
||||
private val bigData: MutableMap<String, Any> = mutableMapOf()
|
||||
|
||||
@Synchronized
|
||||
fun put(key: String, data: Any?): String {
|
||||
data?.let {
|
||||
bigData[key] = data
|
||||
}
|
||||
return key
|
||||
}
|
||||
|
||||
@Synchronized
|
||||
fun put(data: Any?): String {
|
||||
val key = System.currentTimeMillis().toString()
|
||||
data?.let {
|
||||
bigData[key] = data
|
||||
}
|
||||
return key
|
||||
}
|
||||
|
||||
@Suppress("UNCHECKED_CAST")
|
||||
@Synchronized
|
||||
fun <T> get(key: String?): T? {
|
||||
if (key == null) return null
|
||||
val data = bigData[key]
|
||||
bigData.remove(key)
|
||||
return data as? T
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user