Class AsyncMap<K,​V>


  • public class AsyncMap<K,​V>
    extends Object
    An asynchronous map.

    AsyncMap does not allow null to be used as a key or value.

    NOTE: This class has been automatically generated from the original non RX-ified interface using Vert.x codegen.

    • Method Detail

      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object
      • getDelegate

        public AsyncMap getDelegate()
      • get

        public void get​(K k,
                        Handler<AsyncResult<V>> resultHandler)
        Get a value from the map, asynchronously.
        Parameters:
        k - the key
        resultHandler - - this will be called some time later with the async result.
      • get

        public void get​(K k)
        Get a value from the map, asynchronously.
        Parameters:
        k - the key
      • rxGet

        public io.reactivex.Maybe<V> rxGet​(K k)
        Get a value from the map, asynchronously.
        Parameters:
        k - the key
        Returns:
      • put

        public void put​(K k,
                        V v,
                        Handler<AsyncResult<Void>> completionHandler)
        Put a value in the map, asynchronously.
        Parameters:
        k - the key
        v - the value
        completionHandler - - this will be called some time later to signify the value has been put
      • put

        public void put​(K k,
                        V v)
        Put a value in the map, asynchronously.
        Parameters:
        k - the key
        v - the value
      • rxPut

        public io.reactivex.Completable rxPut​(K k,
                                              V v)
        Put a value in the map, asynchronously.
        Parameters:
        k - the key
        v - the value
        Returns:
      • putIfAbsent

        public void putIfAbsent​(K k,
                                V v,
                                Handler<AsyncResult<V>> 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.
        Parameters:
        k - the key
        v - the value
        completionHandler - the handler
      • putIfAbsent

        public void putIfAbsent​(K k,
                                V v)
        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
      • rxPutIfAbsent

        public io.reactivex.Maybe<V> rxPutIfAbsent​(K k,
                                                   V v)
        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
        Returns:
      • remove

        public void remove​(K k,
                           Handler<AsyncResult<V>> resultHandler)
        Remove a value from the map, asynchronously.
        Parameters:
        k - the key
        resultHandler - - this will be called some time later to signify the value has been removed
      • remove

        public void remove​(K k)
        Remove a value from the map, asynchronously.
        Parameters:
        k - the key
      • rxRemove

        public io.reactivex.Maybe<V> rxRemove​(K k)
        Remove a value from the map, asynchronously.
        Parameters:
        k - the key
        Returns:
      • removeIfPresent

        public void removeIfPresent​(K k,
                                    V v,
                                    Handler<AsyncResult<Boolean>> resultHandler)
        Remove a value from the map, only if entry already exists with same value.
        Parameters:
        k - the key
        v - the value
        resultHandler - - this will be called some time later to signify the value has been removed
      • removeIfPresent

        public void removeIfPresent​(K k,
                                    V v)
        Remove a value from the map, only if entry already exists with same value.
        Parameters:
        k - the key
        v - the value
      • rxRemoveIfPresent

        public io.reactivex.Single<Boolean> rxRemoveIfPresent​(K k,
                                                              V v)
        Remove a value from the map, only if entry already exists with same value.
        Parameters:
        k - the key
        v - the value
        Returns:
      • replace

        public void replace​(K k,
                            V v,
                            Handler<AsyncResult<V>> resultHandler)
        Replace the entry only if it is currently mapped to some value
        Parameters:
        k - the key
        v - the new value
        resultHandler - the result handler will be passed the previous value
      • replace

        public void replace​(K k,
                            V v)
        Replace the entry only if it is currently mapped to some value
        Parameters:
        k - the key
        v - the new value
      • rxReplace

        public io.reactivex.Maybe<V> rxReplace​(K k,
                                               V v)
        Replace the entry only if it is currently mapped to some value
        Parameters:
        k - the key
        v - the new value
        Returns:
      • replace

        public void replace​(K k,
                            V v,
                            long ttl,
                            Handler<AsyncResult<V>> resultHandler)
        Replace the entry only if it is currently mapped to some value
        Parameters:
        k - the key
        v - the new value
        ttl - The time to live (in ms) for the entry
        resultHandler - the result handler will be passed the previous value
      • replace

        public void replace​(K k,
                            V v,
                            long ttl)
        Replace the entry only if it is currently mapped to some value
        Parameters:
        k - the key
        v - the new value
        ttl - The time to live (in ms) for the entry
      • rxReplace

        public io.reactivex.Maybe<V> rxReplace​(K k,
                                               V v,
                                               long ttl)
        Replace the entry only if it is currently mapped to some value
        Parameters:
        k - the key
        v - the new value
        ttl - The time to live (in ms) for the entry
        Returns:
      • replaceIfPresent

        public void replaceIfPresent​(K k,
                                     V oldValue,
                                     V newValue,
                                     Handler<AsyncResult<Boolean>> resultHandler)
        Replace the entry only if it is currently mapped to a specific value
        Parameters:
        k - the key
        oldValue - the existing value
        newValue - the new value
        resultHandler - the result handler
      • replaceIfPresent

        public void replaceIfPresent​(K k,
                                     V oldValue,
                                     V newValue)
        Replace the entry only if it is currently mapped to a specific value
        Parameters:
        k - the key
        oldValue - the existing value
        newValue - the new value
      • rxReplaceIfPresent

        public io.reactivex.Single<Boolean> rxReplaceIfPresent​(K k,
                                                               V oldValue,
                                                               V newValue)
        Replace the entry only if it is currently mapped to a specific value
        Parameters:
        k - the key
        oldValue - the existing value
        newValue - the new value
        Returns:
      • replaceIfPresent

        public void replaceIfPresent​(K k,
                                     V oldValue,
                                     V newValue,
                                     long ttl,
                                     Handler<AsyncResult<Boolean>> resultHandler)
        Replace the entry only if it is currently mapped to a specific value
        Parameters:
        k - the key
        oldValue - the existing value
        newValue - the new value
        ttl - The time to live (in ms) for the entry
        resultHandler - the result handler
      • replaceIfPresent

        public void replaceIfPresent​(K k,
                                     V oldValue,
                                     V newValue,
                                     long ttl)
        Replace the entry only if it is currently mapped to a specific value
        Parameters:
        k - the key
        oldValue - the existing value
        newValue - the new value
        ttl - The time to live (in ms) for the entry
      • rxReplaceIfPresent

        public io.reactivex.Single<Boolean> rxReplaceIfPresent​(K k,
                                                               V oldValue,
                                                               V newValue,
                                                               long ttl)
        Replace the entry only if it is currently mapped to a specific value
        Parameters:
        k - the key
        oldValue - the existing value
        newValue - the new value
        ttl - The time to live (in ms) for the entry
        Returns:
      • clear

        public void clear​(Handler<AsyncResult<Void>> resultHandler)
        Clear all entries in the map
        Parameters:
        resultHandler - called on completion
      • clear

        public void clear()
        Clear all entries in the map
      • rxClear

        public io.reactivex.Completable rxClear()
        Clear all entries in the map
        Returns:
      • size

        public void size​(Handler<AsyncResult<Integer>> resultHandler)
        Provide the number of entries in the map
        Parameters:
        resultHandler - handler which will receive the number of entries
      • size

        public void size()
        Provide the number of entries in the map
      • rxSize

        public io.reactivex.Single<Integer> rxSize()
        Provide the number of entries in the map
        Returns:
      • keys

        public void keys​(Handler<AsyncResult<Set<K>>> resultHandler)
        Get the keys of the map, asynchronously.

        Use this method with care as the map may contain a large number of keys, which may not fit entirely in memory of a single node. In this case, the invocation will result in an OutOfMemoryError.

        Parameters:
        resultHandler - invoked when the operation completes
      • keys

        public void keys()
        Get the keys of the map, asynchronously.

        Use this method with care as the map may contain a large number of keys, which may not fit entirely in memory of a single node. In this case, the invocation will result in an OutOfMemoryError.

      • rxKeys

        public io.reactivex.Single<Set<K>> rxKeys()
        Get the keys of the map, asynchronously.

        Use this method with care as the map may contain a large number of keys, which may not fit entirely in memory of a single node. In this case, the invocation will result in an OutOfMemoryError.

        Returns:
      • values

        public void values​(Handler<AsyncResult<List<V>>> resultHandler)
        Get the values of the map, asynchronously.

        Use this method with care as the map may contain a large number of values, which may not fit entirely in memory of a single node. In this case, the invocation will result in an OutOfMemoryError.

        Parameters:
        resultHandler - invoked when the operation completes
      • values

        public void values()
        Get the values of the map, asynchronously.

        Use this method with care as the map may contain a large number of values, which may not fit entirely in memory of a single node. In this case, the invocation will result in an OutOfMemoryError.

      • rxValues

        public io.reactivex.Single<List<V>> rxValues()
        Get the values of the map, asynchronously.

        Use this method with care as the map may contain a large number of values, which may not fit entirely in memory of a single node. In this case, the invocation will result in an OutOfMemoryError.

        Returns:
      • newInstance

        public static <K,​V> AsyncMap<K,​V> newInstance​(AsyncMap arg)