A KeyValuePair in Java

maayank picture maayank · Jun 4, 2010 · Viewed 368.4k times · Source

I'm looking for a KeyValuePair class in Java.
Since java.util heavily uses interfaces there is no concrete implementation provided, only the Map.Entry interface.

Is there some canonical implementation I can import? It is one of those "plumbers programming" classes I hate to implement 100x times.

Answer

Eyal Schneider picture Eyal Schneider · Jun 4, 2010

The class AbstractMap.SimpleEntry is generic and can be useful.