Java Pair<T,N> class implementation [closed]
Is there available a proven Java Pair class implementation?
I mean readily available, widely accepted and tested, maybe part of a more extensive library such as Apache Commons or Guava.
Yes, have a look at Apache Commons Pair
.
Use sparingly, if at all; left
and right
doesn't really convey anything about the content or relation between the elements.
(The Pair
class was deliberately left out of the standard Java API.)
Map.Entry
What about java.util.Map.Entry
interface?
Two concrete implementation bundled with Java 6 and later:
java.util.AbstractMap.SimpleEntry
java.util.AbstractMap.SimpleImmutableEntry