Class Configuration.Builder

  • Enclosing class:
    Configuration

    public static final class Configuration.Builder
    extends Object
    Fluent builder for Configuration instances.
    Author:
    Ryan Pickett
    • Method Detail

      • build

        public Configuration build()
        Build a Configuration from the provided settings.
        Returns:
        the new Configuration
      • setBaseUri

        public Configuration.Builder setBaseUri​(URI baseUri)
        Set the base URI of the created configuration.

        Collection resource paths specified on entity classes with RemoteResource annotations will be resolved relative to this URI.

        Parameters:
        baseUri - the base URI
        Returns:
        this builder
      • setRestTemplateConfigurer

        public Configuration.Builder setRestTemplateConfigurer​(RestTemplateConfigurer restTemplateConfigurer)
        Set the RestTemplateConfigurer for the created configuration. Allows further configuration of the Spring RestTemplate used internally.
        Parameters:
        restTemplateConfigurer - the RestTemplateConfigurer
        Returns:
        this builder
      • setClientHttpRequestFactory

        public Configuration.Builder setClientHttpRequestFactory​(org.springframework.http.client.ClientHttpRequestFactory clientHttpRequestFactory)
        Set the ClientHttpRequestFactory for the created configuration.

        N.B. this MUST be an implementation that throws a HttpClientErrorException when 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 are HttpComponentsClientHttpRequestFactory, and any wrapping implementations delegating to this.

        Parameters:
        clientHttpRequestFactory - the ClientHttpRequestFactory
        Returns:
        this builder
      • setObjectMapperConfigurer

        public Configuration.Builder setObjectMapperConfigurer​(ObjectMapperConfigurer objectMapperConfigurer)
        Set the ObjectMapperConfigurer for the created configuration. Allows further configuration of the Jackson ObjectMapper used internally.
        Parameters:
        objectMapperConfigurer - the ObjectMapperConfigurer
        Returns:
        this builder