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.

    • Constructor Summary

      Constructors 
      Constructor Description
      AsyncMap​(io.vertx.core.shareddata.AsyncMap delegate)  
      AsyncMap​(Object delegate, TypeArg<K> typeArg_0, TypeArg<V> typeArg_1)  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void clear()
      Clear all entries in the map
      void clear​(io.vertx.core.Handler<io.vertx.core.AsyncResult<Void>> resultHandler)
      Clear all entries in the map
      boolean equals​(Object o)  
      void get​(K k)
      Get a value from the map, asynchronously.
      void get​(K k, io.vertx.core.Handler<io.vertx.core.AsyncResult<V>> resultHandler)
      Get a value from the map, asynchronously.
      io.vertx.core.shareddata.AsyncMap getDelegate()  
      int hashCode()  
      void keys()
      Get the keys of the map, asynchronously.
      void keys​(io.vertx.core.Handler<io.vertx.core.AsyncResult<Set<K>>> resultHandler)
      Get the keys of the map, asynchronously.
      static <K,​V>
      AsyncMap<K,​V>
      newInstance​(io.vertx.core.shareddata.AsyncMap arg)  
      static <K,​V>
      AsyncMap<K,​V>
      newInstance​(io.vertx.core.shareddata.AsyncMap arg, TypeArg<K> __typeArg_K, TypeArg<V> __typeArg_V)  
      void put​(K k, V v)
      Put a value in the map, asynchronously.
      void put​(K k, V v, long ttl)
      Like put(K, V, io.vertx.core.Handler<io.vertx.core.AsyncResult<java.lang.Void>>) but specifying a time to live for the entry.
      void put​(K k, V v, long ttl, io.vertx.core.Handler<io.vertx.core.AsyncResult<Void>> completionHandler)
      Like put(K, V, io.vertx.core.Handler<io.vertx.core.AsyncResult<java.lang.Void>>) but specifying a time to live for the entry.
      void put​(K k, V v, io.vertx.core.Handler<io.vertx.core.AsyncResult<Void>> completionHandler)
      Put a value in the map, asynchronously.
      void putIfAbsent​(K k, V v)
      Put the entry only if there is no entry with the key already present.
      void putIfAbsent​(K k, V v, long ttl)
      Link putIfAbsent(K, V, io.vertx.core.Handler<io.vertx.core.AsyncResult<V>>) but specifying a time to live for the entry.
      void putIfAbsent​(K k, V v, long ttl, io.vertx.core.Handler<io.vertx.core.AsyncResult<V>> completionHandler)
      Link putIfAbsent(K, V, io.vertx.core.Handler<io.vertx.core.AsyncResult<V>>) but specifying a time to live for the entry.
      void putIfAbsent​(K k, V v, io.vertx.core.Handler<io.vertx.core.AsyncResult<V>> completionHandler)
      Put the entry only if there is no entry with the key already present.
      void remove​(K k)
      Remove a value from the map, asynchronously.
      void remove​(K k, io.vertx.core.Handler<io.vertx.core.AsyncResult<V>> resultHandler)
      Remove a value from the map, asynchronously.
      void removeIfPresent​(K k, V v)
      Remove a value from the map, only if entry already exists with same value.
      void removeIfPresent​(K k, V v, io.vertx.core.Handler<io.vertx.core.AsyncResult<Boolean>> resultHandler)
      Remove a value from the map, only if entry already exists with same value.
      void replace​(K k, V v)
      Replace the entry only if it is currently mapped to some value
      void replace​(K k, V v, long ttl)
      Replace the entry only if it is currently mapped to some value
      void replace​(K k, V v, long ttl, io.vertx.core.Handler<io.vertx.core.AsyncResult<V>> resultHandler)
      Replace the entry only if it is currently mapped to some value
      void replace​(K k, V v, io.vertx.core.Handler<io.vertx.core.AsyncResult<V>> resultHandler)
      Replace the entry only if it is currently mapped to some value
      void replaceIfPresent​(K k, V oldValue, V newValue)
      Replace the entry only if it is currently mapped to a specific value
      void replaceIfPresent​(K k, V oldValue, V newValue, long ttl)
      Replace the entry only if it is currently mapped to a specific value
      void replaceIfPresent​(K k, V oldValue, V newValue, long ttl, io.vertx.core.Handler<io.vertx.core.AsyncResult<Boolean>> resultHandler)
      Replace the entry only if it is currently mapped to a specific value
      void replaceIfPresent​(K k, V oldValue, V newValue, io.vertx.core.Handler<io.vertx.core.AsyncResult<Boolean>> resultHandler)
      Replace the entry only if it is currently mapped to a specific value
      io.reactivex.Completable rxClear()
      Clear all entries in the map
      io.reactivex.Maybe<V> rxGet​(K k)
      Get a value from the map, asynchronously.
      io.reactivex.Single<Set<K>> rxKeys()
      Get the keys of the map, asynchronously.
      io.reactivex.Completable rxPut​(K k, V v)
      Put a value in the map, asynchronously.
      io.reactivex.Completable rxPut​(K k, V v, long ttl)
      Like put(K, V, io.vertx.core.Handler<io.vertx.core.AsyncResult<java.lang.Void>>) but specifying a time to live for the entry.
      io.reactivex.Maybe<V> rxPutIfAbsent​(K k, V v)
      Put the entry only if there is no entry with the key already present.
      io.reactivex.Maybe<V> rxPutIfAbsent​(K k, V v, long ttl)
      Link putIfAbsent(K, V, io.vertx.core.Handler<io.vertx.core.AsyncResult<V>>) but specifying a time to live for the entry.
      io.reactivex.Maybe<V> rxRemove​(K k)
      Remove a value from the map, asynchronously.
      io.reactivex.Single<Boolean> rxRemoveIfPresent​(K k, V v)
      Remove a value from the map, only if entry already exists with same value.
      io.reactivex.Maybe<V> rxReplace​(K k, V v)
      Replace the entry only if it is currently mapped to some value
      io.reactivex.Maybe<V> rxReplace​(K k, V v, long ttl)
      Replace the entry only if it is currently mapped to some value
      io.reactivex.Single<Boolean> rxReplaceIfPresent​(K k, V oldValue, V newValue)
      Replace the entry only if it is currently mapped to a specific value
      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
      io.reactivex.Single<Integer> rxSize()
      Provide the number of entries in the map
      io.reactivex.Single<List<V>> rxValues()
      Get the values of the map, asynchronously.
      void size()
      Provide the number of entries in the map
      void size​(io.vertx.core.Handler<io.vertx.core.AsyncResult<Integer>> resultHandler)
      Provide the number of entries in the map
      String toString()  
      void values()
      Get the values of the map, asynchronously.
      void values​(io.vertx.core.Handler<io.vertx.core.AsyncResult<List<V>>> resultHandler)
      Get the values of the map, asynchronously.
    • Constructor Detail

      • AsyncMap

        public AsyncMap​(io.vertx.core.shareddata.AsyncMap delegate)
    • Method Detail

      • hashCode

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

        public io.vertx.core.shareddata.AsyncMap getDelegate()
      • get

        public void get​(K k,
                        io.vertx.core.Handler<io.vertx.core.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,
                        io.vertx.core.Handler<io.vertx.core.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:
      • put

        public void put​(K k,
                        V v,
                        long ttl,
                        io.vertx.core.Handler<io.vertx.core.AsyncResult<Void>> completionHandler)
        Like put(K, V, io.vertx.core.Handler<io.vertx.core.AsyncResult<java.lang.Void>>) 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
      • putIfAbsent

        public void putIfAbsent​(K k,
                                V v,
                                io.vertx.core.Handler<io.vertx.core.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:
      • putIfAbsent

        public void putIfAbsent​(K k,
                                V v,
                                long ttl,
                                io.vertx.core.Handler<io.vertx.core.AsyncResult<V>> completionHandler)
        Link putIfAbsent(K, V, io.vertx.core.Handler<io.vertx.core.AsyncResult<V>>) 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
      • remove

        public void remove​(K k,
                           io.vertx.core.Handler<io.vertx.core.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,
                                    io.vertx.core.Handler<io.vertx.core.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,
                            io.vertx.core.Handler<io.vertx.core.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,
                            io.vertx.core.Handler<io.vertx.core.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,
                                     io.vertx.core.Handler<io.vertx.core.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,
                                     io.vertx.core.Handler<io.vertx.core.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​(io.vertx.core.Handler<io.vertx.core.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​(io.vertx.core.Handler<io.vertx.core.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​(io.vertx.core.Handler<io.vertx.core.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​(io.vertx.core.Handler<io.vertx.core.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​(io.vertx.core.shareddata.AsyncMap arg)
      • newInstance

        public static <K,​V> AsyncMap<K,​V> newInstance​(io.vertx.core.shareddata.AsyncMap arg,
                                                                  TypeArg<K> __typeArg_K,
                                                                  TypeArg<V> __typeArg_V)