io.vertx.core.Future.mapEmpty()方法的使用及代码示例

x33g5p2x  于2022-01-19 转载在 其他  
字(2.4k)|赞(0)|评价(0)|浏览(114)

本文整理了Java中io.vertx.core.Future.mapEmpty()方法的一些代码示例,展示了Future.mapEmpty()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Future.mapEmpty()方法的具体详情如下:
包路径:io.vertx.core.Future
类名称:Future
方法名:mapEmpty

Future.mapEmpty介绍

[英]Map the result of a future to null.

This is a conveniency for future.map((T) null) or future.map((Void) null).

When this future succeeds, null will complete the future returned by this method call.

When this future fails, the failure will be propagated to the returned future.
[中]将未来的结果映射为空。
这对将来是一种方便。映射((T)null)或未来。映射((空)空)。
当此future成功时,null将完成此方法调用返回的future。
当此未来失败时,故障将传播到返回的未来。

代码示例

代码示例来源:origin: eclipse-vertx/vert.x

@Test
public void testMapEmpty() {
 Future<Integer> fut = Future.future();
 Future<String> mapped = fut.mapEmpty();
 Checker<String> checker = new Checker<>(mapped);
 checker.assertNotCompleted();
 fut.complete(3);
 checker.assertSucceeded(null);
}

代码示例来源:origin: io.vertx/vertx-core

@Test
public void testMapEmpty() {
 Future<Integer> fut = Future.future();
 Future<String> mapped = fut.mapEmpty();
 Checker<String> checker = new Checker<>(mapped);
 checker.assertNotCompleted();
 fut.complete(3);
 checker.assertSucceeded(null);
}

代码示例来源:origin: io.vertx/vertx-rx-java

/**
 * Map the result of a future to <code>null</code>.<p>
 *
 * This is a conveniency for <code>future.map((T) null)</code> or <code>future.map((Void) null)</code>.<p>
 *
 * When this future succeeds, <code>null</code> will complete the future returned by this method call.<p>
 *
 * When this future fails, the failure will be propagated to the returned future.
 * @return the mapped future
 */
public <V> io.vertx.rxjava.core.Future<V> mapEmpty() { 
 io.vertx.rxjava.core.Future<V> ret = io.vertx.rxjava.core.Future.newInstance(delegate.mapEmpty(), io.vertx.lang.rx.TypeArg.unknown());
 return ret;
}

代码示例来源:origin: vert-x3/vertx-rx

/**
 * Map the result of a future to <code>null</code>.<p>
 *
 * This is a conveniency for <code>future.map((T) null)</code> or <code>future.map((Void) null)</code>.<p>
 *
 * When this future succeeds, <code>null</code> will complete the future returned by this method call.<p>
 *
 * When this future fails, the failure will be propagated to the returned future.
 * @return the mapped future
 */
public <V> io.vertx.rxjava.core.Future<V> mapEmpty() { 
 io.vertx.rxjava.core.Future<V> ret = io.vertx.rxjava.core.Future.newInstance(delegate.mapEmpty(), io.vertx.lang.rx.TypeArg.unknown());
 return ret;
}

相关文章