
com.github.bingoohuang.springrestclient.utils.RestReqBuilder Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of spring-rest-client Show documentation
Show all versions of spring-rest-client Show documentation
convenient spring rest client for rest services
package com.github.bingoohuang.springrestclient.utils;
import com.github.bingoohuang.springrestclient.annotations.SuccInResponseJSONProperty;
import com.github.bingoohuang.springrestclient.provider.BaseUrlProvider;
import com.github.bingoohuang.springrestclient.provider.SignProvider;
import org.springframework.context.ApplicationContext;
import java.util.Map;
public class RestReqBuilder {
SuccInResponseJSONProperty succInResponseJSONProperty;
Map fixedRequestParams;
Map> statusExceptionMapping;
Class> apiClass;
BaseUrlProvider baseUrlProvider;
String prefix;
Map routeParams;
Map requestParams;
Map cookies;
boolean async;
SignProvider signProvider;
ApplicationContext appContext;
String firstConsume; // consumes = {"application/xml"}
public RestReqBuilder firstConsume(String firstConsume) {
this.firstConsume = firstConsume;
return this;
}
public RestReqBuilder appContext(ApplicationContext appContext) {
this.appContext = appContext;
return this;
}
public RestReqBuilder signProvider(SignProvider signProvider) {
this.signProvider = signProvider;
return this;
}
public RestReqBuilder async(boolean async) {
this.async = async;
return this;
}
public RestReqBuilder prefix(String prefix) {
this.prefix = prefix;
return this;
}
public RestReqBuilder fixedRequestParams(Map fixedRequestParams) {
this.fixedRequestParams = fixedRequestParams;
return this;
}
public RestReqBuilder statusExceptionMappings(Map> statusExceptionMapping) {
this.statusExceptionMapping = statusExceptionMapping;
return this;
}
public RestReqBuilder apiClass(Class> apiClass) {
this.apiClass = apiClass;
return this;
}
public RestReqBuilder baseUrlProvider(BaseUrlProvider baseUrlProvider) {
this.baseUrlProvider = baseUrlProvider;
return this;
}
public RestReqBuilder requestParams(Map requestParams) {
this.requestParams = requestParams;
return this;
}
public RestReqBuilder routeParams(Map routeParams) {
this.routeParams = routeParams;
return this;
}
public RestReqBuilder cookies(Map cookies) {
this.cookies = cookies;
return this;
}
public RestReqBuilder succInResponseJSONProperty(SuccInResponseJSONProperty succInResponseJSONProperty) {
this.succInResponseJSONProperty = succInResponseJSONProperty;
return this;
}
public RestReq build() {
return new RestReq(
firstConsume,
succInResponseJSONProperty,
fixedRequestParams,
statusExceptionMapping,
apiClass,
baseUrlProvider,
prefix,
routeParams,
requestParams,
cookies,
async,
signProvider,
appContext);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy