I need a key in the map, however, I found it should be multiple data. Can I put these data in one user defined class and put the whole class as a key in the map?

Will it impact the time efficiency?

What other concerns should be applied here?