How to deserialize List<T> with jacksonObjectMapper in Kotlin
I am writing a generic function to retrieve data. It fetches from redis first, if there is no cache, then fetches from supplier (database).
However it returns List instead of generic type List.
fun retrieveWithCaching(
indices: List,
cacheKeyPrefix: String,
supplier: (List) -> List
): List {
if (indices.isEmpty()) {
return listOf()
}
val cacheKey = cacheKeyPrefix + indices.joinToString(",")
val cached = stringRedisTemplate.opsForValue().get(cacheKey)...