简体   繁体   中英

How to store a nested Map structure in Ehcache?

I want to store a Variable of type Map < Integer, Map < String, Map < String, Integer >>> into Ehcache. How to store this nested Map structure in Ehcache as a value?

Ehcache 3 can only store java.io.Serializable objects. Map is an Interface which is not serializable but the HashMap instance of the Map interface implements java.io.Serializable interface. Thus you can configure your Cache as Cache<Integer, HashMap<String, HashMap<String, Integer>>> .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM