本文整理了Java中reactor.core.publisher.Mono.otherwise()
方法的一些代码示例,展示了Mono.otherwise()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Mono.otherwise()
方法的具体详情如下:
包路径:reactor.core.publisher.Mono
类名称:Mono
方法名:otherwise
暂无
代码示例来源:origin: com.aol.cyclops/cyclops-reactor
/**
* @param type
* @param fallback
* @return
* @see reactor.core.publisher.Mono#otherwise(java.lang.Class, java.util.function.Function)
*/
public final <E extends Throwable> Mono<T> otherwise(Class<E> type,
Function<? super E, ? extends Mono<? extends T>> fallback) {
return boxed.otherwise(type, fallback);
}
/**
代码示例来源:origin: com.aol.cyclops/cyclops-reactor
/**
* @param predicate
* @param fallback
* @return
* @see reactor.core.publisher.Mono#otherwise(java.util.function.Predicate, java.util.function.Function)
*/
public final Mono<T> otherwise(Predicate<? super Throwable> predicate,
Function<? super Throwable, ? extends Mono<? extends T>> fallback) {
return boxed.otherwise(predicate, fallback);
}
/**
代码示例来源:origin: com.aol.cyclops/cyclops-reactor
/**
* @param fallback
* @return
* @see reactor.core.publisher.Mono#otherwise(java.util.function.Function)
*/
public final Mono<T> otherwise(Function<? super Throwable, ? extends Mono<? extends T>> fallback) {
return boxed.otherwise(fallback);
}
/**
代码示例来源:origin: org.cloudfoundry/cloudfoundry-client-spring
protected final <T> Mono<T> get(Object request, Class<T> responseType, Function<UriComponentsBuilder, UriComponentsBuilder> uriTransformer) {
return doGet(responseType, getUriAugmenter(request, uriTransformer), outbound -> outbound)
.otherwise(HttpException.class, CloudFoundryExceptionBuilder::build);
}
代码示例来源:origin: org.cloudfoundry/cloudfoundry-client-spring
protected final Mono<HttpClientResponse> get(Object request, Function<UriComponentsBuilder, UriComponentsBuilder> uriTransformer) {
return doGet(getUriAugmenter(request, uriTransformer), outbound -> outbound)
.otherwise(HttpException.class, CloudFoundryExceptionBuilder::build);
}
代码示例来源:origin: org.cloudfoundry/cloudfoundry-client-spring
protected final <T> Mono<T> put(Object request, Class<T> responseType, Function<UriComponentsBuilder, UriComponentsBuilder> uriTransformer) {
return doPut(request, responseType, getUriAugmenter(request, uriTransformer), outbound -> outbound)
.otherwise(HttpException.class, CloudFoundryExceptionBuilder::build);
}
代码示例来源:origin: org.cloudfoundry/cloudfoundry-client-spring
protected final Mono<HttpClientResponse> get(Object request, Function<UriComponentsBuilder, UriComponentsBuilder> uriTransformer,
Function<HttpClientRequest, HttpClientRequest> requestTransformer) {
return doGet(getUriAugmenter(request, uriTransformer), requestTransformer)
.otherwise(HttpException.class, CloudFoundryExceptionBuilder::build);
}
代码示例来源:origin: org.cloudfoundry/cloudfoundry-client-spring
protected final <T> Mono<T> post(Object request, Class<T> responseType, Function<UriComponentsBuilder, UriComponentsBuilder> uriTransformer,
Function<MultipartHttpClientRequest, Mono<Void>> requestTransformer) {
return doPost(responseType, getUriAugmenter(request, uriTransformer),
outbound -> requestTransformer.apply(new MultipartHttpClientRequest(this.objectMapper, outbound)))
.otherwise(HttpException.class, CloudFoundryExceptionBuilder::build);
}
代码示例来源:origin: org.cloudfoundry/cloudfoundry-client-spring
protected final <T> Mono<T> get(Object request, Class<T> responseType, Function<UriComponentsBuilder, UriComponentsBuilder> uriTransformer) {
return doGet(responseType, getUriAugmenter(request, uriTransformer), outbound -> outbound)
.otherwise(HttpException.class, CloudFoundryExceptionBuilder::build);
}
代码示例来源:origin: org.cloudfoundry/cloudfoundry-client-spring
protected final <T> Mono<T> post(Object request, Class<T> responseType, Function<UriComponentsBuilder, UriComponentsBuilder> uriTransformer) {
return doPost(request, responseType, getUriAugmenter(request, uriTransformer), outbound -> outbound)
.otherwise(HttpException.class, CloudFoundryExceptionBuilder::build);
}
代码示例来源:origin: org.cloudfoundry/cloudfoundry-client-spring
protected final <T> Mono<T> delete(Object request, Class<T> responseType, Function<UriComponentsBuilder, UriComponentsBuilder> uriTransformer) {
return doDelete(request, responseType, getUriAugmenter(request, uriTransformer), outbound -> outbound)
.otherwise(HttpException.class, CloudFoundryExceptionBuilder::build);
}
代码示例来源:origin: org.cloudfoundry/cloudfoundry-client-spring
protected final <T> Mono<T> delete(Object request, Class<T> responseType, Function<UriComponentsBuilder, UriComponentsBuilder> uriTransformer) {
return doDelete(request, responseType, getUriAugmenter(request, uriTransformer), outbound -> outbound)
.otherwise(HttpException.class, CloudFoundryExceptionBuilder::build);
}
代码示例来源:origin: org.cloudfoundry/cloudfoundry-client-spring
protected final <T> Mono<T> patch(Object request, Class<T> responseType, Function<UriComponentsBuilder, UriComponentsBuilder> uriTransformer) {
return doPatch(request, responseType, getUriAugmenter(request, uriTransformer), outbound -> outbound)
.otherwise(HttpException.class, CloudFoundryExceptionBuilder::build);
}
代码示例来源:origin: org.cloudfoundry/cloudfoundry-client-spring
protected final <T> Mono<T> put(Object request, Class<T> responseType, Function<UriComponentsBuilder, UriComponentsBuilder> uriTransformer) {
return doPut(request, responseType, getUriAugmenter(request, uriTransformer), outbound -> outbound)
.otherwise(HttpException.class, CloudFoundryExceptionBuilder::build);
}
代码示例来源:origin: org.cloudfoundry/cloudfoundry-client-spring
protected final <T> Mono<T> post(Object request, Class<T> responseType, Function<UriComponentsBuilder, UriComponentsBuilder> uriTransformer) {
return doPost(request, responseType, getUriAugmenter(request, uriTransformer), outbound -> outbound)
.otherwise(HttpException.class, CloudFoundryExceptionBuilder::build);
}
代码示例来源:origin: org.cloudfoundry/cloudfoundry-client-spring
protected final <T> Mono<T> put(Object request, Class<T> responseType, Function<UriComponentsBuilder, UriComponentsBuilder> uriTransformer,
Function<MultipartHttpClientRequest, Mono<Void>> requestTransformer) {
return doPut(responseType, getUriAugmenter(request, uriTransformer),
outbound -> requestTransformer.apply(new MultipartHttpClientRequest(this.objectMapper, outbound)))
.otherwise(HttpException.class, CloudFoundryExceptionBuilder::build);
}
代码示例来源:origin: org.cloudfoundry/cloudfoundry-client-spring
protected final <T> Mono<T> post(Object request, Class<T> responseType, Function<UriComponentsBuilder, UriComponentsBuilder> uriTransformer,
Function<MultipartHttpClientRequest, Mono<Void>> requestTransformer) {
return doPost(responseType, getUriAugmenter(request, uriTransformer),
outbound -> requestTransformer.apply(new MultipartHttpClientRequest(this.objectMapper, outbound)))
.otherwise(HttpException.class, CloudFoundryExceptionBuilder::build);
}
代码示例来源:origin: org.cloudfoundry/cloudfoundry-client-spring
@Override
public Mono<Boolean> exists(RouteExistsRequest request) {
return get(request, Boolean.class, builder -> builder.pathSegment("v2", "routes", "reserved", "domain", request.getDomainId(), "host", request.getHost()))
.defaultIfEmpty(true)
.otherwise(ExceptionUtils.statusCode(CF_NOT_FOUND), t -> Mono.just(false));
}
代码示例来源:origin: org.springframework/spring-web-reactive
private Mono<Void> handleResult(ServerWebExchange exchange, HandlerResult result) {
return getResultHandler(result).handleResult(exchange, result)
.otherwise(ex -> result.applyExceptionHandler(ex).then(exceptionResult ->
getResultHandler(exceptionResult).handleResult(exchange, exceptionResult)));
}
代码示例来源:origin: org.springframework/spring-web-reactive
@Override
public Mono<HandlerResult> handle(ServerWebExchange exchange, Object handler) {
HandlerMethod handlerMethod = (HandlerMethod) handler;
InvocableHandlerMethod invocable = new InvocableHandlerMethod(handlerMethod);
invocable.setArgumentResolvers(getArgumentResolvers());
Mono<BindingContext> bindingContextMono =
this.bindingContextFactory.createBindingContext(handlerMethod, exchange);
return bindingContextMono.then(bindingContext ->
invocable.invoke(exchange, bindingContext)
.doOnNext(result -> result.setExceptionHandler(
ex -> handleException(ex, handlerMethod, bindingContext, exchange)))
.otherwise(ex -> handleException(
ex, handlerMethod, bindingContext, exchange)));
}
内容来源于网络,如有侵权,请联系作者删除!