@Override public void forEach(BiConsumer action) { NamedList.this.forEach(action); } };
/** * Construct the tree parameters from the arguments passed to the * component. * @param args the arguments passed to the component. */ public FacetTreeParameters(NamedList<? extends Object> args) { // Find "defaults" list @SuppressWarnings({ "unchecked", "rawtypes" }) NamedList<? extends Object> defaultArgs = (NamedList) args.get(PluginInfo.DEFAULTS); if (defaultArgs != null) { // Assume all of the args are single strings for now defaultArgs.forEach(entry -> { defaults.put(entry.getKey(), (String)entry.getValue()); }); } }
@Override public void writeMap(EntryWriter ew) throws IOException { //TODO don't call toNamedList; more efficiently implement here //note: multiple values, if present, are a String[] under 1 key toNamedList().forEach((k, v) -> { if (v == null || "".equals(v)) return; try { ew.put(k, v); } catch (IOException e) { throw new RuntimeException("Error serializing", e); } }); }
}else if(NamedList.class.isAssignableFrom(suggestionResponseClass)) { suggestionsResponse = new LinkedHashMap<>(); ((NamedList<?>)responseObject.get("suggestions")).forEach( e ->suggestionsResponse.put(e.getKey(),e.getValue())); } else { log.error("Error parsing Solr suggestion response: unknown response type"); suggestion_facets = new LinkedHashMap<>(); ((NamedList<NamedList<Integer>>)suggestionsResponse.get("suggestion_facets")) .forEach( e ->suggestion_facets.put(e.getKey(),e.getValue())); } else { log.error("Error parsing Solr suggestion response: unknown response type"); fieldSuggestions.forEach(suggestion -> facetValues.add(new FacetValue<>(castForDescriptor(suggestion.getKey(), descriptor), suggestion.getValue())));