Closed GoogleCodeExporter closed 9 years ago
Original comment by kevin...@gmail.com
on 17 Sep 2009 at 5:57
Original comment by kevin...@gmail.com
on 17 Sep 2009 at 6:02
Original comment by kevinb@google.com
on 30 Jul 2010 at 3:53
Original comment by fry@google.com
on 26 Jan 2011 at 10:41
Original comment by kevinb@google.com
on 13 Jul 2011 at 6:18
Original comment by fry@google.com
on 10 Dec 2011 at 3:38
Original comment by fry@google.com
on 16 Feb 2012 at 7:17
I'm not sure I understand how this is still relevant given the existence of
AbstractMap.SimpleEntry. Was there something AbstractMapEntry did differently?
Original comment by wasserman.louis
on 23 Feb 2012 at 7:38
As I recall, AbstractMapEntry did not require the key and value to be stored in
fields in the entry (just declared getters), where
AbstractMap.Simple[Immutable]Entry does. Not requiring these references allows
you to pick up the key/value from somewhere else, so that the entry is view
onto the underlying structure, rather than a part of the structure itself.
Last version of this in Google Collections:
http://code.google.com/p/google-collections/source/browse/trunk/src/com/google/c
ommon/collect/AbstractMapEntry.java
You can obviously just copy into a SimpleImmutableEntry when you need an entry,
but that won't support write-through of setValue().
Original comment by joe.j.kearney
on 24 Feb 2012 at 8:18
Ew. I see.
I'm tentatively pro-this, just because I'm pretty confident that our
AbstractMapEntry implementation will remain fixed -- more confident than, for
example, Multisets.AbstractEntry -- and that makes me feel like
AbstractMapEntry might deserve an exception to our general practice of not
exposing "implementation detail" abstract skeleton classes.
Original comment by wasserman.louis
on 24 Feb 2012 at 5:02
My bias is still to see this as too similar to AbstractMap$SimpleEntry to be
staking out our own claim to.
Original comment by kevinb@google.com
on 24 Feb 2012 at 9:11
I use a class like this one a lot whenever I wrap a Map like object. For
example, instead of using HttpSession directly one can use it as an
Iterable<Map.Entry<String,Object>> which uses an Entry delegating
getValue/setValue to the session.
Original comment by daniel.y...@gmail.com
on 24 Feb 2012 at 9:59
I'm convinced by Kevin's argument. Roll your own if you really need it, for
the moment.
Original comment by wasserman.louis
on 24 Feb 2012 at 10:04
Original comment by kevinb@google.com
on 30 May 2012 at 7:43
Original comment by kevinb@google.com
on 22 Jun 2012 at 6:16
Original comment by kevinb@google.com
on 7 Nov 2013 at 5:29
This issue has been migrated to GitHub.
It can be found at https://github.com/google/guava/issues/<id>
Original comment by cgdecker@google.com
on 1 Nov 2014 at 4:16
Original comment by cgdecker@google.com
on 3 Nov 2014 at 9:10
Original issue reported on code.google.com by
joe.kear...@gtempaccount.com
on 7 May 2009 at 1:22