Hi, > To be sure we're talking about the same thing, your preferred > initialization looks like this? > > static final Map<TEST_TYPE, String> solrClassMap = > Collections.unmodifiableMap(Stream.of( > new SimpleEntry<>(TEST_TYPE.TINT, "solr.TrieIntField"), > > new SimpleEntry<>(TEST_TYPE.BOOL, "solr.BoolField")) > .collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue))); > > BTW, why do you consider inline lambdas horrible? Not disagreeing, > just wondering whether it's a functional problem or what to add to my > knowledge store.
Yes, that looks better... > And I assumed that this _was_ unmodifiable given it starts with > "Collections.unmodifiableMap". Sorry was on mobile phone and did not see the unmodifiableMap. We should maybe add a "TODO" at those constructs to upgrade them to the much better and elegant Map.of() once we switch master to Java 9/10/11. Uwe --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
