Package uk.co.blackpepper.bowman
Class Configuration.Builder
- java.lang.Object
-
- uk.co.blackpepper.bowman.Configuration.Builder
-
- Enclosing class:
- Configuration
public static final class Configuration.Builder extends Object
Fluent builder forConfigurationinstances.- Author:
- Ryan Pickett
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Configurationbuild()Build aConfigurationfrom the provided settings.Configuration.BuildersetBaseUri(String baseUri)Configuration.BuildersetBaseUri(URI baseUri)Set the base URI of the created configuration.Configuration.BuildersetClientHttpRequestFactory(org.springframework.http.client.ClientHttpRequestFactory clientHttpRequestFactory)Set theClientHttpRequestFactoryfor the created configuration.Configuration.BuildersetObjectMapperConfigurer(ObjectMapperConfigurer objectMapperConfigurer)Set theObjectMapperConfigurerfor the created configuration.Configuration.BuildersetRestTemplateConfigurer(RestTemplateConfigurer restTemplateConfigurer)Set theRestTemplateConfigurerfor the created configuration.
-
-
-
Method Detail
-
build
public Configuration build()
Build aConfigurationfrom the provided settings.- Returns:
- the new Configuration
-
setBaseUri
public Configuration.Builder setBaseUri(String baseUri)
- Parameters:
baseUri- the base URI as a string- Returns:
- this builder
- See Also:
setBaseUri(URI)
-
setBaseUri
public Configuration.Builder setBaseUri(URI baseUri)
Set the base URI of the created configuration.Collection resource paths specified on entity classes with
RemoteResourceannotations will be resolved relative to this URI.- Parameters:
baseUri- the base URI- Returns:
- this builder
-
setRestTemplateConfigurer
public Configuration.Builder setRestTemplateConfigurer(RestTemplateConfigurer restTemplateConfigurer)
Set theRestTemplateConfigurerfor the created configuration. Allows further configuration of the SpringRestTemplateused internally.- Parameters:
restTemplateConfigurer- theRestTemplateConfigurer- Returns:
- this builder
-
setClientHttpRequestFactory
public Configuration.Builder setClientHttpRequestFactory(org.springframework.http.client.ClientHttpRequestFactory clientHttpRequestFactory)
Set theClientHttpRequestFactoryfor the created configuration.N.B. this MUST be an implementation that throws a
HttpClientErrorExceptionwhen a HTTP 404 is returned accessing the remote resource, as this fact is used internally to distinguish between empty results and other client error conditions. The Spring implementations that satisfy this requirement areHttpComponentsClientHttpRequestFactory, and any wrapping implementations delegating to this.- Parameters:
clientHttpRequestFactory- theClientHttpRequestFactory- Returns:
- this builder
-
setObjectMapperConfigurer
public Configuration.Builder setObjectMapperConfigurer(ObjectMapperConfigurer objectMapperConfigurer)
Set theObjectMapperConfigurerfor the created configuration. Allows further configuration of the JacksonObjectMapperused internally.- Parameters:
objectMapperConfigurer- theObjectMapperConfigurer- Returns:
- this builder
-
-