I want to store certain objects in a HashMap. The problem is, usually you just use a single object as a key. (You can, for example, use a String.) What I want to do it to use multiple object. For example, a Class and a String. Is there a simple and clean way to implement that?
相关问题
- Delete Messages from a Topic in Apache Kafka
- Jackson Deserialization not calling deserialize on
- How to maintain order of key-value in DataFrame sa
- StackExchange API - Deserialize Date in JSON Respo
- Difference between Types.INTEGER and Types.NULL in
Do you mean that the object will be keyed by two keys, or rather a key which consists of two things.
If you want the first case. That is, an objected keyed by two keys, say a class or an object, you need to use two maps.
In the second case you need a map of maps, so:
I tend to use a list