@Override public void removeIfPresent(K k, V v, Handler<AsyncResult<Boolean>> resultHandler) { delegate.removeIfPresent(k, v, resultHandler); }
@Override public void removeIfPresent(K k, V v, Handler<AsyncResult<Boolean>> resultHandler) { delegate.removeIfPresent(k, v, resultHandler); }
private <K, V> void testMapRemoveIfPresent(K k, V v, V other) { getVertx().sharedData().<K, V>getAsyncMap("foo", onSuccess(map -> { map.put(k, v, onSuccess(res -> { assertNull(res); getVertx().sharedData().<K, V>getAsyncMap("foo", onSuccess(map2 -> { map2.removeIfPresent(k, other, onSuccess(res2 -> { assertFalse(res2); map2.removeIfPresent(k, v, onSuccess(res3 -> { assertTrue(res3); testComplete(); })); })); })); })); })); await(); }
private <K, V> void testMapRemoveIfPresent(K k, V v, V other) { getVertx().sharedData().<K, V>getAsyncMap("foo", onSuccess(map -> { map.put(k, v, onSuccess(res -> { assertNull(res); getVertx().sharedData().<K, V>getAsyncMap("foo", onSuccess(map2 -> { map2.removeIfPresent(k, other, onSuccess(res2 -> { assertFalse(res2); map2.removeIfPresent(k, v, onSuccess(res3 -> { assertTrue(res3); testComplete(); })); })); })); })); })); await(); }
/** * Remove a value from the map, only if entry already exists with same value. * @param k the key * @param v the value * @param resultHandler - this will be called some time later to signify the value has been removed */ public void removeIfPresent(K k, V v, Handler<AsyncResult<Boolean>> resultHandler) { delegate.removeIfPresent(__typeArg_0.<K>unwrap(k), __typeArg_1.<V>unwrap(v), resultHandler); }
public static void removeIfPresent(io.vertx.core.shareddata.AsyncMap<Object, Object> j_receiver, java.lang.Object k, java.lang.Object v, io.vertx.core.Handler<io.vertx.core.AsyncResult<java.lang.Boolean>> resultHandler) { j_receiver.removeIfPresent(io.vertx.core.impl.ConversionHelper.toObject(k), io.vertx.core.impl.ConversionHelper.toObject(v), resultHandler != null ? new io.vertx.core.Handler<io.vertx.core.AsyncResult<java.lang.Boolean>>() { public void handle(io.vertx.core.AsyncResult<java.lang.Boolean> ar) { resultHandler.handle(ar.map(event -> event)); } } : null); } public static void replace(io.vertx.core.shareddata.AsyncMap<Object, Object> j_receiver, java.lang.Object k, java.lang.Object v, io.vertx.core.Handler<io.vertx.core.AsyncResult<java.lang.Object>> resultHandler) {
/** * Remove a value from the map, only if entry already exists with same value. * @param k the key * @param v the value * @param resultHandler - this will be called some time later to signify the value has been removed */ public void removeIfPresent(K k, V v, Handler<AsyncResult<Boolean>> resultHandler) { delegate.removeIfPresent(__typeArg_0.<K>unwrap(k), __typeArg_1.<V>unwrap(v), resultHandler); }
private void remove2(String k, String k2, StringMap smap, String val, Handler<ExtendedAsyncResult<Boolean>> fut) { if (smap.strings.isEmpty()) { list.removeIfPresent(k, val, resDel -> { if (resDel.succeeded()) { if (resDel.result()) { fut.handle(new Success<>(true)); } else { vertx.setTimer(DELAY, res -> remove(k, k2, fut)); } } else { fut.handle(new Failure<>(INTERNAL, resDel.cause())); } }); } else { // list was not empty, remove value String newVal = Json.encodePrettily(smap); list.replaceIfPresent(k, val, newVal, resPut -> { if (resPut.succeeded()) { if (resPut.result()) { fut.handle(new Success<>(false)); } else { vertx.setTimer(DELAY, res -> remove(k, k2, fut)); } } else { fut.handle(new Failure<>(INTERNAL, resPut.cause())); } }); } }