gianm commented on a change in pull request #6027: Make Parser.parseToMap() to
return a mutable Map
URL: https://github.com/apache/incubator-druid/pull/6027#discussion_r206780107
##########
File path:
java-util/src/main/java/io/druid/java/util/common/parsers/ObjectFlatteners.java
##########
@@ -165,32 +165,10 @@ public void clear()
@Override
public Set<Entry<String, Object>> entrySet()
{
- return keySet().stream()
- .map(
- field -> {
- return new Map.Entry<String, Object>()
- {
- @Override
- public String getKey()
- {
- return field;
- }
-
- @Override
- public Object getValue()
- {
- return get(field);
- }
-
- @Override
- public Object setValue(final Object value)
- {
- throw new UnsupportedOperationException();
- }
- };
- }
- )
-
.collect(Collectors.toCollection(LinkedHashSet::new));
+ return keySet()
+ .stream()
+ .map(field -> new SimpleImmutableEntry<>(field, get(field)))
Review comment:
Ah, didn't know this existed. Cool.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]