Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想将 Map < Integer, Map < String, Map < String, Integer >>> 类型的变量存储到 Ehcache 中。如何将这个嵌套的 Map 结构作为值存储在 Ehcache 中?
Ehcache 3 只能存储 java.io.Serializable 对象。Map 是一个不可序列化的接口,但 Map 接口的 HashMap 实例实现了 java.io.Serializable 接口。因此,您可以将缓存配置为Cache<Integer, HashMap<String, HashMap<String, Integer>>>.
Cache<Integer, HashMap<String, HashMap<String, Integer>>>