@Override public Map<String, String[]> getParams() { ArrayListMultimap<String, String> result = ArrayListMultimap.create(multiParams); params.forEach(result::put); return result.asMap().entrySet().stream().collect(Collectors.toMap(Map.Entry::getKey, e -> e.getValue().toArray(new String[0]))); }
@Override public Map<String, String[]> getParams() { ArrayListMultimap<String, String> result = ArrayListMultimap.create(multiParams); params.forEach(result::put); return result.asMap().entrySet().stream().collect(Collectors.toMap(Map.Entry::getKey, e -> e.getValue().toArray(new String[0]))); }
.asMap().entrySet()) {
paramValues.put(next.getName(), next.getValue()); for (Map.Entry<String, Collection<String>> nextParamEntry : paramValues.asMap().entrySet()) { String[] nextValue = nextParamEntry.getValue().toArray(new String[nextParamEntry.getValue().size()]); requestDetails.addParameter(nextParamEntry.getKey(), nextValue);
paramValues.put(next.getName(), next.getValue()); for (Map.Entry<String, Collection<String>> nextParamEntry : paramValues.asMap().entrySet()) { String[] nextValue = nextParamEntry.getValue().toArray(new String[nextParamEntry.getValue().size()]); requestDetails.addParameter(nextParamEntry.getKey(), nextValue);
/** * Return the metadata map, creating one if it doesnt exist already * * @return the map of MetaData */ public Map<String, Collection<Object>> getMetaData() { return metadata.asMap(); }
public Map<String, Collection<RefDiff>> getRefDiffs() { return refDiffs.asMap(); }
public Map<String, Collection<RefDiff>> getRefDiffs() { return refDiffs.asMap(); }
@Override public String toString() { // print fields sorted by key for better human readability return new TreeMap<String, Collection<Object>>(fields.asMap()).toString(); }
@Override public String toString() { // print fields sorted by key for better human readability return new TreeMap<String, Collection<Object>>(fields.asMap()).toString(); }
private static <T, S> Map<T, Collection<S>> invert(final Map<S, T> valueByKey) { return new TreeMap<>( Multimaps.invertFrom( Multimaps.forMap(valueByKey), ArrayListMultimap.<T, S>create() ).asMap() ); }
public Map<Integer, Collection<ValidationError>> getValidationErrorsByInstanceId() { if (validationErrors == null) { return Collections.emptyMap(); } ArrayListMultimap<Integer, ValidationError> copy = ArrayListMultimap.create(); copy.putAll(validationErrors()); return copy.asMap(); }
public Map<Integer, Collection<IValidationError>> getValidationErrorsByInstanceId() { if (validationErrors == null) { return Collections.emptyMap(); } ArrayListMultimap<Integer, IValidationError> copy = ArrayListMultimap.create(); copy.putAll(validationErrors()); return copy.asMap(); }
public Map<Integer, Collection<IValidationError>> getErrorsByInstanceId() { final ArrayListMultimap<Integer, IValidationError> copy = ArrayListMultimap.create(); copy.putAll(getContextErrors()); return copy.asMap(); }
public Map<Integer, Collection<ValidationError>> getErrorsByInstanceId() { final ArrayListMultimap<Integer, ValidationError> copy = ArrayListMultimap.create(); copy.putAll(getContextErrors()); return copy.asMap(); }
public List<ViewBinding> parse(List<String> modelPathtrings, boolean idCentric) { ArrayListMultimap<String, ModelPath> viewBindings = ArrayListMultimap.create(); for (String simpleBinding : modelPathtrings) { String[] class_pathId_modelPath = toStringArray(simpleBinding, "::"); List<ModelPath> bindings = viewBindings.get(class_pathId_modelPath[0].trim()); try { bindings.add(buildPath(class_pathId_modelPath[1].trim(), class_pathId_modelPath[2].trim())); } catch (Throwable t) { t.printStackTrace(System.out); } } List<ViewBinding> viewBindingsList = Lists.newArrayList(); for (Map.Entry<String, Collection<ModelPath>> entry : viewBindings.asMap().entrySet()) { viewBindingsList.add(new ViewBinding(entry.getKey(), new ArrayList<>(entry.getValue()), false, idCentric, true, null)); } return viewBindingsList; }
private List<Contributor> contributorsGet_noTimeSpan(String organizations, Integer limit, Integer offset, String endDate, String sortBy, String q) { Date endDateDate = endDate != null ? iso8601(endDate) : new Date(); Date endDateInDb = repository.findPreviousSnapShotDate(endDateDate); ArrayListMultimap<Long, Contributor> multiMap = ArrayListMultimap.create(); orgs(organizations).values().stream().forEach(organizationId -> { List<Contributor> contributors = repository.findAllTimeTopContributors(organizationId, endDateInDb, q, null, null); contributors.stream().forEach(c -> multiMap.put(c.getKey().getId(), c)); }); List<Contributor> sorted = multiMap.asMap().values().stream().map(list -> add(list)).collect(toList()); Collections.sort(sorted, sortBy(sortBy)); return sublist(limit, offset, sorted); }
MajorFragmentReporter[] tempReporters = new MajorFragmentReporter[majors.asMap().size()]; for(Map.Entry<Integer, Collection<FragmentData>> e : majors.asMap().entrySet()) { Preconditions.checkElementIndex(e.getKey(), majors.asMap().size()); Preconditions.checkState(tempReporters[e.getKey()] == null); tempReporters[e.getKey()] = new MajorFragmentReporter(e.getKey(), e.getValue());
private List<Contributor> contributorsGet_timeSpan(String organizations, Integer limit, Integer offset, String startDate, String endDate, String sortBy, String q) { Date startDateInDb = repository.findPreviousSnapShotDate(iso8601(startDate)); Date endDateInDb = repository.findPreviousSnapShotDate(iso8601(endDate)); checkNotNull(startDateInDb); checkNotNull(endDateInDb); ArrayListMultimap<Long, Contributor> multiMap = ArrayListMultimap.create(); orgs(organizations).values().stream().forEach(organizationId -> { List<Contributor> startData = repository.findAllTimeTopContributors(organizationId, startDateInDb, q, null, null); Map<Long, Contributor> startMap = startData.stream().collect(toMap(Contributor::getId, identity())); List<Contributor> endData = repository.findAllTimeTopContributors(organizationId, endDateInDb, q, null, null); Map<Long, Contributor> endMap = endData.stream().collect(toMap(Contributor::getId, identity())); SetView<Long> contributorIds = intersection(startMap.keySet(), endMap.keySet()); contributorIds.stream() // .map(id -> diff(startMap.get(id), endMap.get(id))) // .forEach(c -> multiMap.put(c.getKey().getId(), c)); }); List<Contributor> sorted = multiMap.asMap().values().stream().map(list -> add(list)).collect(toList()); Collections.sort(sorted, sortBy(sortBy)); return sublist(limit, offset, sorted); }