@Override public void forEach(BiConsumer<? super K, ? super V> action) { synchronized (mutex) { delegate().forEach(action); } }
@Override public void forEach(BiConsumer<? super K, ? super V> action) { synchronized (mutex) { delegate().forEach(action); } }
public void testForEach() { List<Entry<K, V>> entries = new ArrayList<>(); multimap().forEach((k, v) -> entries.add(mapEntry(k, v))); assertEqualIgnoringOrder(getSampleElements(), multimap().entries()); }
@CollectionFeature.Require(KNOWN_ORDER) public void testForEachOrder() { List<Entry<K, V>> entries = new ArrayList<>(); multimap().forEach((k, v) -> entries.add(mapEntry(k, v))); assertEqualIgnoringOrder(getSampleElements(), multimap().entries()); } }
initialSplits.putAll(sourceSplits); sourceTasks.forEach((planNodeId, task) -> { TaskStatus status = task.getTaskStatus(); if (status.getState() != TaskState.FINISHED) {
/** * Opens a new client, completing the provided future only once the client has been opened. * * @param future the future to be completed once the client is opened */ private void openProxy(CompletableFuture<SessionClient> future) { log.debug("Opening proxy session"); proxyFactory.get().thenCompose(proxy -> proxy.connect()).whenComplete((proxy, error) -> { if (error == null) { synchronized (this) { this.log = ContextualLoggerFactory.getLogger(getClass(), LoggerContext.builder(SessionClient.class) .addValue(proxy.sessionId()) .add("type", proxy.type()) .add("name", proxy.name()) .build()); this.session = proxy; proxy.addStateChangeListener(this::onStateChange); eventListeners.forEach(proxy::addEventListener); onStateChange(PrimitiveState.CONNECTED); } future.complete(this); } else { recoverTask = context.schedule(Duration.ofSeconds(1), () -> openProxy(future)); } }); }
@Override public void forEach(BiConsumer<? super K, ? super V> action) { synchronized (mutex) { delegate().forEach(action); } }
public static void init() { done = true; MAP.forEach((t, s) -> OreDictionary.registerOre(s, t.toItemStack())); MAP.clear(); // No need to keep this stuff around }
@Override public void forEach(BiConsumer<? super K, ? super V> action) { synchronized (mutex) { delegate().forEach(action); } }
public static void dump(Multimap<String, CharSource> sources, PrintStream out) { sources.forEach((tag, source) -> { out.format("%n================================================================================%n"); out.format("%n==== start %-16s ================================================%n", tag); out.format("%n================================================================================%n"); try { source.copyTo(out); } catch (IOException e) { System.err.println(e.toString()); } out.format("%n================================================================================%n"); out.format("%n==== end %-16s ================================================%n", tag); out.format("%n================================================================================%n"); }); }
public NanoHTTPD.Response build() { NanoHTTPD.Response response = NanoHTTPD.newFixedLengthResponse(status, contentType.toString(), content.get(), contentLength); headers.forEach(response::addHeader); return response; }
public void testForEach() { List<Entry<K, V>> entries = new ArrayList<>(); multimap().forEach((k, v) -> entries.add(mapEntry(k, v))); assertEqualIgnoringOrder(getSampleElements(), multimap().entries()); }
@CollectionFeature.Require(KNOWN_ORDER) public void testForEachOrder() { List<Entry<K, V>> entries = new ArrayList<>(); multimap().forEach((k, v) -> entries.add(mapEntry(k, v))); assertEqualIgnoringOrder(getSampleElements(), multimap().entries()); } }
@Override public TableAnswerElement answer() { ParseVendorConfigurationAnswerElement pvcae = _batfish.loadParseVendorConfigurationAnswerElement(); Map<String, ParseStatus> statusMap = pvcae.getParseStatus(); Rows rows = new Rows(); Multimap<String, String> fileToHost = TreeMultimap.create(); pvcae.getFileMap().forEach((hostname, filename) -> fileToHost.put(filename, hostname)); statusMap.forEach( (filename, status) -> rows.add(getRow(filename, status, fileToHost.get(filename)))); TableAnswerElement answerElement = new TableAnswerElement(TABLE_METADATA); answerElement.postProcessAnswer(_question, rows.getData()); return answerElement; }
initialSplits.putAll(sourceSplits); sourceTasks.forEach((planNodeId, task) -> { TaskStatus status = task.getTaskStatus(); if (status.getState() != TaskState.FINISHED) {
initialSplits.putAll(sourceSplits); sourceTasks.forEach((planNodeId, task) -> { TaskStatus status = task.getTaskStatus(); if (status.getState() != TaskState.FINISHED) {
_interfacesBySecurityLevel.forEach( (level, iface) -> { String zoneName = computeSecurityLevelZoneName(level);