/** * Return a non delegating map which snapshots the data visible in this delegating map, disconnected from changes * to this and the underlying delegates. * * @return A non delegating plain-map copy of the data visible in this map */ public LinkedHashMap<K, V> flatView() { return entryStream() .collect(StreamUtils.toLinkedMap(Map.Entry::getKey, Map.Entry::getValue)); }
/** * Coerces the JobRow into a mapping from the names of JobFields to their values. * * @return A mapping from the name of each JobField to its associated value */ public Map<String, String> getRowMap() { return entrySet().stream() .collect(StreamUtils.toLinkedMap(entry -> entry.getKey().getName(), Map.Entry::getValue)); }
/** * Get DimensionRows as a map of Field Name and Value. * * @return map of fieldname,value */ public LinkedHashMap<String, String> getRowMap() { return entrySet().stream() .collect(StreamUtils.toLinkedMap(entry -> entry.getKey().getName(), Map.Entry::getValue)); } }
@Override protected Result check() throws Exception { // Gather information about what has been loaded and what hasn't Map<String, String> dimensionLastUpdated = dimensionDictionary.findAll().stream() .collect( StreamUtils.toLinkedMap( Dimension::getApiName, dim -> dim.getLastUpdated() == null ? NEVER : dim.getLastUpdated().toString() ) ); // Signal health if (dimensionLastUpdated.containsValue(NEVER)) { return Result.unhealthy( String.format( "These dimensions have not been loaded: %s", dimensionLastUpdated.entrySet().stream() .filter(entry -> NEVER.equals(entry.getValue())) .map(Map.Entry::getKey) .collect(Collectors.toSet()) ) ); } else { return Result.healthy(String.format("Dimensions have all been loaded: %s", dimensionLastUpdated)); } }
.collect(StreamUtils.toLinkedMap(Function.identity(), dimensionRow::get));
.map(stream -> stream.collect( StreamUtils.toLinkedMap( entry -> getDescriptionKey(entry.getKey().getName()), Map.Entry::getValue
.collect(StreamUtils.toLinkedMap(Pair::getLeft, Pair::getRight)); responseContext.put(ResponseContextKeys.PAGINATION_LINKS_CONTEXT_KEY.getName(), bodyLinks); responseContext.put(ResponseContextKeys.PAGINATION_CONTEXT_KEY.getName(), pages);