Class: Vertx::AsyncMap
- Inherits:
-
Object
- Object
- Vertx::AsyncMap
- Defined in:
- /Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx/async_map.rb
Overview
An asynchronous map.
AsyncMap does not allow null
to be used as a key or value.
Instance Method Summary (collapse)
-
- (void) clear(resultHandler) { ... }
Clear all entries in the map.
-
- (void) get(k, resultHandler) { ... }
Get a value from the map, asynchronously.
-
- (void) put(*args)
Like #put but specifying a time to live for the entry.
-
- (void) put_if_absent(*args)
Link #put_if_absent but specifying a time to live for the entry.
-
- (void) remove(k, resultHandler) { ... }
Remove a value from the map, asynchronously.
-
- (void) removeIfPresent(k, v, resultHandler) { ... }
Remove a value from the map, only if entry already exists with same value.
-
- (void) replace(k, v, resultHandler) { ... }
Replace the entry only if it is currently mapped to some value.
-
- (void) replaceIfPresent(k, oldValue, newValue, resultHandler) { ... }
Replace the entry only if it is currently mapped to a specific value.
-
- (void) size(resultHandler) { ... }
Provide the number of entries in the map.
Instance Method Details
- (void) clear(resultHandler) { ... }
This method returns an undefined value.
Clear all entries in the map
90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx/async_map.rb', line 90 def clear if true if (block_given?) return @j_del.java_method(:clear, [Java::IoVertxCore::Handler.java_class]).call(block_given? ? Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? nil : nil) } : promise) else promise = ::Vertx::Util::Utils.promise @j_del.java_method(:clear, [Java::IoVertxCore::Handler.java_class]).call(block_given? ? Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? nil : nil) } : promise) return ::Vertx::Util::Utils.safe_create(promise.future(),::Vertx::Future, nil) end end if defined?(super) super else raise ArgumentError, "Invalid arguments when calling clear()" end end |
- (void) get(k, resultHandler) { ... }
This method returns an undefined value.
Get a value from the map, asynchronously.
70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx/async_map.rb', line 70 def get(*args) if @j_arg_K.accept?(args[0]) && true if (block_given?) return @j_del.java_method(:get, [Java::java.lang.Object.java_class,Java::IoVertxCore::Handler.java_class]).call(@j_arg_K.unwrap(args[0]),block_given? ? Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? @j_arg_V.wrap(ar.result) : nil) } : promise) else promise = ::Vertx::Util::Utils.promise @j_del.java_method(:get, [Java::java.lang.Object.java_class,Java::IoVertxCore::Handler.java_class]).call(@j_arg_K.unwrap(args[0]),block_given? ? Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? @j_arg_V.wrap(ar.result) : nil) } : promise) return ::Vertx::Util::Utils.safe_create(promise.future(),::Vertx::Future, nil) end end if defined?(super) super else raise ArgumentError, "Invalid arguments when calling get(#{args[0]})" end end |
- (void) put(k, v, completionHandler) { ... } - (void) put(k, v, ttl, completionHandler) { ... }
This method returns an undefined value.
Like #put but specifying a time to live for the entry. Entry will expire and get evicted after the ttl.
197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx/async_map.rb', line 197 def put(*args) if @j_arg_K.accept?(args[0]) && @j_arg_V.accept?(args[1]) && true && args[2] == nil if (block_given?) return @j_del.java_method(:put, [Java::java.lang.Object.java_class,Java::java.lang.Object.java_class,Java::IoVertxCore::Handler.java_class]).call(@j_arg_K.unwrap(args[0]),@j_arg_V.unwrap(args[1]),block_given? ? Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? nil : nil) } : promise) else promise = ::Vertx::Util::Utils.promise @j_del.java_method(:put, [Java::java.lang.Object.java_class,Java::java.lang.Object.java_class,Java::IoVertxCore::Handler.java_class]).call(@j_arg_K.unwrap(args[0]),@j_arg_V.unwrap(args[1]),block_given? ? Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? nil : nil) } : promise) return ::Vertx::Util::Utils.safe_create(promise.future(),::Vertx::Future, nil) end elsif @j_arg_K.accept?(args[0]) && @j_arg_V.accept?(args[1]) && args[2].class == Fixnum && true if (block_given?) return @j_del.java_method(:put, [Java::java.lang.Object.java_class,Java::java.lang.Object.java_class,Java::long.java_class,Java::IoVertxCore::Handler.java_class]).call(@j_arg_K.unwrap(args[0]),@j_arg_V.unwrap(args[1]),args[2],block_given? ? Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? nil : nil) } : promise) else promise = ::Vertx::Util::Utils.promise @j_del.java_method(:put, [Java::java.lang.Object.java_class,Java::java.lang.Object.java_class,Java::long.java_class,Java::IoVertxCore::Handler.java_class]).call(@j_arg_K.unwrap(args[0]),@j_arg_V.unwrap(args[1]),args[2],block_given? ? Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? nil : nil) } : promise) return ::Vertx::Util::Utils.safe_create(promise.future(),::Vertx::Future, nil) end end if defined?(super) super else raise ArgumentError, "Invalid arguments when calling put(#{args[0]},#{args[1]},#{args[2]})" end end |
- (void) putIfAbsent(k, v, completionHandler) { ... } - (void) putIfAbsent(k, v, ttl, completionHandler) { ... }
This method returns an undefined value.
Link #put_if_absent but specifying a time to live for the entry. Entry will expire and get evicted after the ttl.
140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx/async_map.rb', line 140 def put_if_absent(*args) if @j_arg_K.accept?(args[0]) && @j_arg_V.accept?(args[1]) && true && args[2] == nil if (block_given?) return @j_del.java_method(:putIfAbsent, [Java::java.lang.Object.java_class,Java::java.lang.Object.java_class,Java::IoVertxCore::Handler.java_class]).call(@j_arg_K.unwrap(args[0]),@j_arg_V.unwrap(args[1]),block_given? ? Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? @j_arg_V.wrap(ar.result) : nil) } : promise) else promise = ::Vertx::Util::Utils.promise @j_del.java_method(:putIfAbsent, [Java::java.lang.Object.java_class,Java::java.lang.Object.java_class,Java::IoVertxCore::Handler.java_class]).call(@j_arg_K.unwrap(args[0]),@j_arg_V.unwrap(args[1]),block_given? ? Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? @j_arg_V.wrap(ar.result) : nil) } : promise) return ::Vertx::Util::Utils.safe_create(promise.future(),::Vertx::Future, nil) end elsif @j_arg_K.accept?(args[0]) && @j_arg_V.accept?(args[1]) && args[2].class == Fixnum && true if (block_given?) return @j_del.java_method(:putIfAbsent, [Java::java.lang.Object.java_class,Java::java.lang.Object.java_class,Java::long.java_class,Java::IoVertxCore::Handler.java_class]).call(@j_arg_K.unwrap(args[0]),@j_arg_V.unwrap(args[1]),args[2],block_given? ? Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? @j_arg_V.wrap(ar.result) : nil) } : promise) else promise = ::Vertx::Util::Utils.promise @j_del.java_method(:putIfAbsent, [Java::java.lang.Object.java_class,Java::java.lang.Object.java_class,Java::long.java_class,Java::IoVertxCore::Handler.java_class]).call(@j_arg_K.unwrap(args[0]),@j_arg_V.unwrap(args[1]),args[2],block_given? ? Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? @j_arg_V.wrap(ar.result) : nil) } : promise) return ::Vertx::Util::Utils.safe_create(promise.future(),::Vertx::Future, nil) end end if defined?(super) super else raise ArgumentError, "Invalid arguments when calling put_if_absent(#{args[0]},#{args[1]},#{args[2]})" end end |
- (void) remove(k, resultHandler) { ... }
This method returns an undefined value.
Remove a value from the map, asynchronously.
169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx/async_map.rb', line 169 def remove(*args) if @j_arg_K.accept?(args[0]) && true if (block_given?) return @j_del.java_method(:remove, [Java::java.lang.Object.java_class,Java::IoVertxCore::Handler.java_class]).call(@j_arg_K.unwrap(args[0]),block_given? ? Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? @j_arg_V.wrap(ar.result) : nil) } : promise) else promise = ::Vertx::Util::Utils.promise @j_del.java_method(:remove, [Java::java.lang.Object.java_class,Java::IoVertxCore::Handler.java_class]).call(@j_arg_K.unwrap(args[0]),block_given? ? Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? @j_arg_V.wrap(ar.result) : nil) } : promise) return ::Vertx::Util::Utils.safe_create(promise.future(),::Vertx::Future, nil) end end if defined?(super) super else raise ArgumentError, "Invalid arguments when calling remove(#{args[0]})" end end |
- (void) removeIfPresent(k, v, resultHandler) { ... }
This method returns an undefined value.
Remove a value from the map, only if entry already exists with same value.
227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx/async_map.rb', line 227 def remove_if_present(*args) if @j_arg_K.accept?(args[0]) && @j_arg_V.accept?(args[1]) && true if (block_given?) return @j_del.java_method(:removeIfPresent, [Java::java.lang.Object.java_class,Java::java.lang.Object.java_class,Java::IoVertxCore::Handler.java_class]).call(@j_arg_K.unwrap(args[0]),@j_arg_V.unwrap(args[1]),block_given? ? Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? ar.result : nil) } : promise) else promise = ::Vertx::Util::Utils.promise @j_del.java_method(:removeIfPresent, [Java::java.lang.Object.java_class,Java::java.lang.Object.java_class,Java::IoVertxCore::Handler.java_class]).call(@j_arg_K.unwrap(args[0]),@j_arg_V.unwrap(args[1]),block_given? ? Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? ar.result : nil) } : promise) return ::Vertx::Util::Utils.safe_create(promise.future(),::Vertx::Future, nil) end end if defined?(super) super else raise ArgumentError, "Invalid arguments when calling remove_if_present(#{args[0]},#{args[1]})" end end |
- (void) replace(k, v, resultHandler) { ... }
This method returns an undefined value.
Replace the entry only if it is currently mapped to some value
112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx/async_map.rb', line 112 def replace(*args) if @j_arg_K.accept?(args[0]) && @j_arg_V.accept?(args[1]) && true if (block_given?) return @j_del.java_method(:replace, [Java::java.lang.Object.java_class,Java::java.lang.Object.java_class,Java::IoVertxCore::Handler.java_class]).call(@j_arg_K.unwrap(args[0]),@j_arg_V.unwrap(args[1]),block_given? ? Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? @j_arg_V.wrap(ar.result) : nil) } : promise) else promise = ::Vertx::Util::Utils.promise @j_del.java_method(:replace, [Java::java.lang.Object.java_class,Java::java.lang.Object.java_class,Java::IoVertxCore::Handler.java_class]).call(@j_arg_K.unwrap(args[0]),@j_arg_V.unwrap(args[1]),block_given? ? Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? @j_arg_V.wrap(ar.result) : nil) } : promise) return ::Vertx::Util::Utils.safe_create(promise.future(),::Vertx::Future, nil) end end if defined?(super) super else raise ArgumentError, "Invalid arguments when calling replace(#{args[0]},#{args[1]})" end end |
- (void) replaceIfPresent(k, oldValue, newValue, resultHandler) { ... }
This method returns an undefined value.
Replace the entry only if it is currently mapped to a specific value
29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx/async_map.rb', line 29 def replace_if_present(*args) if @j_arg_K.accept?(args[0]) && @j_arg_V.accept?(args[1]) && @j_arg_V.accept?(args[2]) && true if (block_given?) return @j_del.java_method(:replaceIfPresent, [Java::java.lang.Object.java_class,Java::java.lang.Object.java_class,Java::java.lang.Object.java_class,Java::IoVertxCore::Handler.java_class]).call(@j_arg_K.unwrap(args[0]),@j_arg_V.unwrap(args[1]),@j_arg_V.unwrap(args[2]),block_given? ? Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? ar.result : nil) } : promise) else promise = ::Vertx::Util::Utils.promise @j_del.java_method(:replaceIfPresent, [Java::java.lang.Object.java_class,Java::java.lang.Object.java_class,Java::java.lang.Object.java_class,Java::IoVertxCore::Handler.java_class]).call(@j_arg_K.unwrap(args[0]),@j_arg_V.unwrap(args[1]),@j_arg_V.unwrap(args[2]),block_given? ? Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? ar.result : nil) } : promise) return ::Vertx::Util::Utils.safe_create(promise.future(),::Vertx::Future, nil) end end if defined?(super) super else raise ArgumentError, "Invalid arguments when calling replace_if_present(#{args[0]},#{args[1]},#{args[2]})" end end |
- (void) size(resultHandler) { ... }
This method returns an undefined value.
Provide the number of entries in the map
49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx/async_map.rb', line 49 def size if true if (block_given?) return @j_del.java_method(:size, [Java::IoVertxCore::Handler.java_class]).call(block_given? ? Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? ar.result : nil) } : promise) else promise = ::Vertx::Util::Utils.promise @j_del.java_method(:size, [Java::IoVertxCore::Handler.java_class]).call(block_given? ? Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? ar.result : nil) } : promise) return ::Vertx::Util::Utils.safe_create(promise.future(),::Vertx::Future, nil) end end if defined?(super) super else raise ArgumentError, "Invalid arguments when calling size()" end end |