1、Java 6提供AbstractMap.SimpleEntry<K,V>和AbstractMap.SimpleImmutableEntry<K,V>
Map.Entry<String,Integer> entry1 = new AbstractMap.SimpleEntry<String, Integer>("key", 9527);
2、Apache commons-collections的KeyValue
Map.Entry<String,Integer> entry3 = new DefaultMapEntry("key", 9527) KeyValue<String,Integer> kv = new DefaultKeyValue("rkey", 9527);
3、Guava的Maps.immutableEntry
Map.Entry<String,Integer> entry2 = Maps.immutableEntry("key", 9527);
4、Apache commons-lang3的Pair
Map.Entry<String,Integer> entry4 =new ImmutablePair<String,Integer>("key", 9527);
5、Apache HttpClient的NameValuePair
NameValuePair nv = new BasicNameValuePair("key", "9527");
可以扩展Map.Entry或者封装Class。