本文整理了Java中io.vertx.core.Context.remove()
方法的一些代码示例,展示了Context.remove()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Context.remove()
方法的具体详情如下:
包路径:io.vertx.core.Context
类名称:Context
方法名:remove
[英]Remove some data from the context.
[中]从上下文中删除一些数据。
代码示例来源:origin: eclipse-vertx/vert.x
@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();
}
代码示例来源:origin: io.vertx/vertx-rx-java
/**
* 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;
}
代码示例来源:origin: vert-x3/vertx-rx
/**
* 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;
}
代码示例来源:origin: vert-x3/vertx-sync
/**
* 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);
}
}
代码示例来源:origin: io.vertx/vertx-core
@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();
}
内容来源于网络,如有侵权,请联系作者删除!