ratpack.func.Action.append()方法的使用及代码示例

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

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

Action.append介绍

[英]Returns a new action that executes this action and then the given action.
[中]返回执行此操作的新操作,然后返回给定操作。

代码示例

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

@Override
public HttpClientSpec requestIntercept(Action<? super RequestSpec> interceptor) {
 requestInterceptor = requestInterceptor.append(interceptor);
 return this;
}

代码示例来源:origin: io.ratpack/ratpack-exec

/**
 * Returns a new action that executes the given action and then this action.
 *
 * @param action the action to execute before this action
 * @param <O> the type of object the action accepts
 * @return the newly created aggregate action
 */
default <O extends T> Action<O> prepend(Action<? super O> action) {
 return action.append(this);
}

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

@Override
public HttpClientSpec responseIntercept(Action<? super HttpResponse> interceptor) {
 responseInterceptor = responseInterceptor.append(interceptor);
 return this;
}

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

@Override
public HttpClientSpec errorIntercept(Action<? super Throwable> interceptor) {
 errorInterceptor = errorInterceptor.append(interceptor);
 return this;
}

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

@Override
public HttpClientSpec responseIntercept(Operation operation) {
 responseInterceptor = responseInterceptor.append(response -> operation.then());
 return this;
}

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

redirectConfigurer = null;
} else {
 redirectConfigurer = redirectConfigurer.append(onRedirectResult);
redirectRequestConfig = redirectConfigurer.append(redirectRequestConfig);

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

@Override
public Promise<ReceivedResponse> request(URI uri, final Action<? super RequestSpec> requestConfigurer) {
 return intercept(
  Promise.async(downstream -> new ContentAggregatingRequestAction(uri, this, 0, Execution.current(), requestConfigurer.append(spec.requestInterceptor)).connect(downstream)),
  spec.responseInterceptor,
  spec.errorInterceptor
 );
}

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

@Override
public Promise<StreamedResponse> requestStream(URI uri, Action<? super RequestSpec> requestConfigurer) {
 return intercept(
  Promise.async(downstream -> new ContentStreamingRequestAction(uri, this, 0, Execution.current(), requestConfigurer.append(spec.requestInterceptor)).connect(downstream)),
  spec.responseInterceptor,
  spec.errorInterceptor
 );
}

相关文章