, generics showstopper . , (K) (V). , , ( ).
For each class, you will need a class:
MultiKeyMap2<K1,K2,V>
MultiKeyMap3<K1,K2,K3,V>
MultiKeyMap4<K1,K2,K3,K4,V>
MultiKeyMap5<K1,K2,K3,K4,K5,V>
The main implementation basically does what you offer (using a custom class). However, he does not formally create a class for him, everything is included. This is truly an implementation detail. But for using Google collections, a custom class to perform the same action will work just as I am sure to implement hashCode () and equals ().
source
share