Quantcast
Channel: Active questions tagged redis+java - Stack Overflow
Viewing all articles
Browse latest Browse all 2204

How to convert RedisonListMultimap or Collection to Map

$
0
0

I've got redisson RListMultimap<String, String> type, which contains elements in strucure similar to java's Map<String, Map<String, List<String>>

https://redisson.org/glossary/java-multimap.html

https://github.com/redisson/redisson/blob/master/redisson/src/main/java/org/redisson/RedissonMultimap.java

Now I want to convert data from redisson type after calling redissonClient.getListMultimap(key1) method to standard Java Map<String, List<String>>

After calling getListMultimap I'm receiving data structure like Java's Map<String, List<String>> but it's a struture called RListMultimap

I think the best option to do it is by call entries() method on redissonClient's response which returns Collection<Map.Entry<String, String>> and then convert this from this type to Map<String, List<String>>

Is anyone know to convert between this two data types in Java or know a better way to do it?


Viewing all articles
Browse latest Browse all 2204

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>