@Test public void testCopyOnPutIfAbsent() { testMapOperationResult((map, key) -> map.putIfAbsent(key, new ShareableObject("some other test data"))); }
assertNull(map.putIfAbsent("foo", "there")); assertNotNull(map.putIfAbsent("foo", "there")); assertEquals(map.getOrDefault("foo", "miss"), "there"); assertEquals(map.get("foo"), "there");
@Test public void testCopyOnPutIfAbsent() { testMapOperationResult((map, key) -> map.putIfAbsent(key, new ShareableObject("some other test data"))); }
@Override public void putIfAbsent(K k, V v, Handler<AsyncResult<V>> handler) { try { local.putIfAbsent(k, v); handler.handle(Future.succeededFuture()); } catch (Exception e) { handler.handle(Future.failedFuture(e)); } }
@Override public void putIfAbsent(K k, V v, Handler<AsyncResult<V>> handler) { try { local.putIfAbsent(k, v); handler.handle(Future.succeededFuture()); } catch (Exception e) { handler.handle(Future.failedFuture(e)); } }
assertNull(map.putIfAbsent("foo", "there")); assertNotNull(map.putIfAbsent("foo", "there")); assertEquals(map.getOrDefault("foo", "miss"), "there"); assertEquals(map.get("foo"), "there");
/** * Put the entry only if there is no existing entry for that key * @param key the key * @param value the value * @return the old value or null, if none */ public V putIfAbsent(K key, V value) { V ret = (V)__typeArg_1.wrap(delegate.putIfAbsent(__typeArg_0.<K>unwrap(key), __typeArg_1.<V>unwrap(value))); return ret; }
public static java.lang.Object putIfAbsent(io.vertx.core.shareddata.LocalMap<Object, Object> j_receiver, java.lang.Object key, java.lang.Object value) { return io.vertx.core.impl.ConversionHelper.fromObject(j_receiver.putIfAbsent(io.vertx.core.impl.ConversionHelper.toObject(key), io.vertx.core.impl.ConversionHelper.toObject(value))); } public static boolean removeIfPresent(io.vertx.core.shareddata.LocalMap<Object, Object> j_receiver, java.lang.Object key, java.lang.Object value) {
/** * Put the entry only if there is no existing entry for that key * @param key the key * @param value the value * @return the old value or null, if none */ public V putIfAbsent(K key, V value) { V ret = (V)__typeArg_1.wrap(delegate.putIfAbsent(__typeArg_0.<K>unwrap(key), __typeArg_1.<V>unwrap(value))); return ret; }