cache4k
cache4k copied to clipboard
value is always returning null
code fun storeCredentials(value: String) { val cache = Cache.Builder<String, String>().build() cache.put(KeyConstant.userCredentials, value) val value = cache.get(KeyConstant.userCredentials) print(value) }
fun retrieveCredentials(): String? {
val cache = Cache.Builder<String, String>().build()
val creds = cache.get(KeyConstant.userCredentials)
return creds
}