org.jooby.Router.map()方法的使用及代码示例

x33g5p2x  于2022-01-29 转载在 其他  
字(2.5k)|赞(0)|评价(0)|浏览(137)

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

Router.map介绍

[英]Apply the mapper to all the functional routes.

mapper((Integer v) -> v * 2);}

A call to /four outputs 4. Mapper are applied in reverse order.
[中]将映射器应用于所有功能路由

mapper((Integer v) -> v * 2);}

调用/four输出4。映射器按相反的顺序应用。

代码示例

代码示例来源:origin: jooby-project/jooby

@Override
public void configure(final Env env, final Config conf, final Binder binder) {
 env.router()
  .map(reactor(flux, mono));
}

代码示例来源:origin: jooby-project/jooby

@Override
public void configure(final Env env, final Config conf, final Binder binder) {
 // dump rx.* as system properties
 conf.getConfig("rx")
  .withoutPath("schedulers").entrySet()
  .forEach(
   e -> System.setProperty("rx." + e.getKey(), e.getValue().unwrapped().toString()));
 Map<String, Executor> executors = new HashMap<>();
 super.configure(env, conf, binder, executors::put);
 env.router()
  .map(rx(observable, single, completable));
 /**
  * Side effects of global/evil static state. Hack to turn off some of this errors.
  */
 trySchedulerHook(executors);
 // shutdown schedulers: silent shutdown in dev mode between app reloads
 env.onStop(() -> {
  try {
   Schedulers.shutdown();
  } catch (Throwable ex) {
   log.debug("Schedulers.shutdown() resulted in error", ex);
  }
 });
}

代码示例来源:origin: jooby-project/jooby

.map(mapper());

代码示例来源:origin: jooby-project/jooby

.map(new CassandraMapper());

代码示例来源:origin: org.jooby/jooby-reactor

@Override
public void configure(final Env env, final Config conf, final Binder binder) {
 env.router()
  .map(reactor(flux, mono));
}

代码示例来源:origin: org.jooby/jooby-rxjava

@Override
public void configure(final Env env, final Config conf, final Binder binder) {
 // dump rx.* as system properties
 conf.getConfig("rx")
  .withoutPath("schedulers").entrySet()
  .forEach(
   e -> System.setProperty("rx." + e.getKey(), e.getValue().unwrapped().toString()));
 Map<String, Executor> executors = new HashMap<>();
 super.configure(env, conf, binder, executors::put);
 env.router()
  .map(rx(observable, single, completable));
 /**
  * Side effects of global/evil static state. Hack to turn off some of this errors.
  */
 trySchedulerHook(executors);
 // shutdown schedulers: silent shutdown in dev mode between app reloads
 env.onStop(() -> {
  try {
   Schedulers.shutdown();
  } catch (Throwable ex) {
   log.debug("Schedulers.shutdown() resulted in error", ex);
  }
 });
}

代码示例来源:origin: org.jooby/jooby-mongodb-rx

.map(mapper());

代码示例来源:origin: org.jooby/jooby-cassandra

.map(new CassandraMapper());

相关文章

微信公众号

最新文章

更多