I have a requirement when I need to map a set of configurations to a set of values, ideally denoted by a structure Map<Map<String, Object>, Map<String, Object>>.
Both the configurations and part of the values of the main map are arbitrary and, therefore, I cannot use a specific class.
Please provide some feedback on this structure. Can the Card be used as a key for another Card. After a little research, I was able to establish that the Map equals method uses all the basic keys and values to consider two Maps equal. In addition, the HashCode of the card is based on the hash codes of the card keys. This IMO must meet the minimum requirements for using the Card as a key.
I would like someone to confirm this before I proceed with the implementation. If there is a better solution / design that someone can offer, please feel free to.
EDIT
I ended up using a simple tilde ('~') and pipe ('|'), dividing String as a key, and deconstructing it whenever needed. Thanks to everyone who helped.
source
share