/** * Put the entry only if there is no entry with the key already present. If key already present then the existing * value will be returned to the handler, otherwise null. * @param k the key * @param v the value * @return * @deprecated use {@link #rxPutIfAbsent} instead */ @Deprecated() public Observable<V> putIfAbsentObservable(K k, V v) { io.vertx.rx.java.ObservableFuture<V> completionHandler = io.vertx.rx.java.RxHelper.observableFuture(); putIfAbsent(k, v, completionHandler.toHandler()); return completionHandler; }
/** * Put the entry only if there is no entry with the key already present. If key already present then the existing * value will be returned to the handler, otherwise null. * @param k the key * @param v the value * @return */ public Single<V> rxPutIfAbsent(K k, V v) { return Single.create(new io.vertx.rx.java.SingleOnSubscribeAdapter<>(fut -> { putIfAbsent(k, v, fut); })); }
/** * Put the entry only if there is no entry with the key already present. If key already present then the existing * value will be returned to the handler, otherwise null. * @param k the key * @param v the value * @return */ public Single<V> rxPutIfAbsent(K k, V v) { return Single.create(new io.vertx.rx.java.SingleOnSubscribeAdapter<>(fut -> { putIfAbsent(k, v, fut); })); }
/** * Link {@link io.vertx.rxjava.core.shareddata.AsyncMap#putIfAbsent} but specifying a time to live for the entry. Entry will expire and get evicted * after the ttl. * @param k the key * @param v the value * @param ttl The time to live (in ms) for the entry * @return * @deprecated use {@link #rxPutIfAbsent} instead */ @Deprecated() public Observable<V> putIfAbsentObservable(K k, V v, long ttl) { io.vertx.rx.java.ObservableFuture<V> completionHandler = io.vertx.rx.java.RxHelper.observableFuture(); putIfAbsent(k, v, ttl, completionHandler.toHandler()); return completionHandler; }
/** * Link {@link io.vertx.rxjava.core.shareddata.AsyncMap#putIfAbsent} but specifying a time to live for the entry. Entry will expire and get evicted * after the ttl. * @param k the key * @param v the value * @param ttl The time to live (in ms) for the entry * @return */ public Single<V> rxPutIfAbsent(K k, V v, long ttl) { return Single.create(new io.vertx.rx.java.SingleOnSubscribeAdapter<>(fut -> { putIfAbsent(k, v, ttl, fut); })); }
/** * Link {@link io.vertx.rxjava.core.shareddata.AsyncMap#putIfAbsent} but specifying a time to live for the entry. Entry will expire and get evicted * after the ttl. * @param k the key * @param v the value * @param ttl The time to live (in ms) for the entry * @return */ public Single<V> rxPutIfAbsent(K k, V v, long ttl) { return Single.create(new io.vertx.rx.java.SingleOnSubscribeAdapter<>(fut -> { putIfAbsent(k, v, ttl, fut); })); }