Make ImmutableEntry a public type
See original GitHub issueBecause ImmutableEntry
is a package-private type Maps.immutableEntry()
has to declare its return type as Map.Entry
, which (because it’s an interface) can’t be guaranteed to be immutable. This means that users of Maps.immutableEntry()
can’t express the immutability of the entry objects they’re constructing to anyone they pass them off to. Since the immutable types are intended to be “‘Interfaces’, not implementations”, I think it would make sense to expose this type publicly.
Issue Analytics
- State:
- Created 6 years ago
- Comments:8 (4 by maintainers)
Top Results From Across the Web
Java - How to create new Entry (key, value) - Stack Overflow
There's public static class AbstractMap. ... a new utility method allowing to create an immutable entry which is Map#entry(Object, Object) .
Read more >Maps (Guava: Google Core Libraries for Java 23.0 API)
Returns an immutable map instance containing the given entries. Internally, the returned map will be backed by an EnumMap .
Read more >How to Create a New Entry in a Map - Baeldung
Learn how to use Java's built-in classes, third-party libraries, and a custom implementation to create an Entry object in a Map.
Read more >Immutable Map in Java - GeeksforGeeks
ImmutableMap, as suggested by the name, is a type of Map which is immutable. It means that the content of the map are...
Read more >Example usage for com.google.common.collect Maps immutableEntry
@GwtCompatible(serializable = true) public static <K, V> Entry<K, ... Create a MongoDB update object * @param update - the generic specification * @param ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
AbstractMap.SimpleImmutableEntry is built in, so I don’t think this is necessary.
@Maaartinus true. I filed a bug report against the JDK. I’ll post the link here once it becomes public.