vertx / io.vertx.reactivex.core.shareddata / AsyncMap / putIfAbsent

putIfAbsent

open fun putIfAbsent(k: K, v: V, completionHandler: Handler<AsyncResult<V>>): Unit

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.

Parameters

k - the key

v - the value

completionHandler - the handler

open fun putIfAbsent(k: K, v: V, ttl: Long, completionHandler: Handler<AsyncResult<V>>): Unit

Link io.vertx.reactivex.core.shareddata.AsyncMap#putIfAbsent but specifying a time to live for the entry. Entry will expire and get evicted after the ttl.

Parameters

k - the key

v - the value

ttl - The time to live (in ms) for the entry

completionHandler - the handler