How to store a nested Map structure in Ehcache?

2.6k Views Asked by At

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?

1

There are 1 best solutions below

2
On BEST ANSWER

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>>>.