For IntelliJ IDEA,
Android Studio or Eclipse



private void myMethod () {Context c =
Vertx.currentContext()
Vertx vertx;vertx.getOrCreateContext()
- Smart code suggestions by Codota
}
@Test public void testPutGetRemoveData() throws Exception { SomeObject obj = new SomeObject(); vertx.runOnContext(v -> { Context ctx = Vertx.currentContext(); ctx.put("foo", obj); ctx.runOnContext(v2 -> { assertEquals(obj, ctx.get("foo")); assertTrue(ctx.remove("foo")); ctx.runOnContext(v3 -> { assertNull(ctx.get("foo")); testComplete(); }); }); }); await(); }
/** * Remove some data from the context. * @param key the key to remove * @return true if removed successfully, false otherwise */ public boolean remove(String key) { boolean ret = delegate.remove(key); return ret; }
/** * Remove the scheduler for the current context */ @Suspendable public static void removeContextScheduler() { Context context = Vertx.currentContext(); if (context != null) { context.remove(FIBER_SCHEDULER_CONTEXT_KEY); } }
/** * Remove some data from the context. * @param key the key to remove * @return true if removed successfully, false otherwise */ public boolean remove(String key) { boolean ret = delegate.remove(key); return ret; }
/** * Remove some data from the context. * @param key the key to remove * @return true if removed successfully, false otherwise */ public boolean remove(String key) { boolean ret = delegate.remove(key); return ret; }
@Test public void testPutGetRemoveData() throws Exception { SomeObject obj = new SomeObject(); vertx.runOnContext(v -> { Context ctx = Vertx.currentContext(); ctx.put("foo", obj); ctx.runOnContext(v2 -> { assertEquals(obj, ctx.get("foo")); assertTrue(ctx.remove("foo")); ctx.runOnContext(v3 -> { assertNull(ctx.get("foo")); testComplete(); }); }); }); await(); }