public class RestClientBuilder extends BeanContextBuilder
RestClient
class.
Instances of this class are created by the following methods:
RestClient.create()
- Create from scratch.
RestClient.create(Serializer,Parser)
- Create from scratch using specified serializer/parser.
RestClient.create(Class,Class)
- Create from scratch using specified serializer/parser classes.
RestClient.builder()
- Copy settings from an existing client.
psb
Modifier | Constructor and Description |
---|---|
protected |
RestClientBuilder(PropertyStore ps,
org.apache.http.impl.client.HttpClientBuilder httpClientBuilder)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
RestClientBuilder |
accept(Object value)
Sets the value for the
|
RestClientBuilder |
acceptCharset(Object value)
Sets the value for the
|
RestClientBuilder |
acceptEncoding(Object value)
Sets the value for the
|
RestClientBuilder |
acceptLanguage(Object value)
Sets the value for the
|
RestClientBuilder |
add(Map<String,Object> properties)
Adds multiple configuration properties on this object.
|
RestClientBuilder |
addBeanTypes()
Configuration property: Add
|
RestClientBuilder |
addBeanTypes(boolean value)
Configuration property: Add
|
RestClientBuilder |
addInterceptorFirst(org.apache.http.HttpRequestInterceptor itcp) |
RestClientBuilder |
addInterceptorFirst(org.apache.http.HttpResponseInterceptor itcp) |
RestClientBuilder |
addInterceptorLast(org.apache.http.HttpRequestInterceptor itcp) |
RestClientBuilder |
addInterceptorLast(org.apache.http.HttpResponseInterceptor itcp) |
RestClientBuilder |
addRootType()
Configuration property: Add type attribute to root nodes.
|
RestClientBuilder |
addRootType(boolean value)
Configuration property: Add type attribute to root nodes.
|
RestClientBuilder |
addTo(String name,
Object value)
Adds a value to a SET or LIST property.
|
RestClientBuilder |
addTo(String name,
String key,
Object value)
Adds or overwrites a value to a SET, LIST, or MAP property.
|
RestClientBuilder |
apply(PropertyStore copyFrom)
Copies the settings from the specified property store into this builder.
|
RestClientBuilder |
applyAnnotations(AnnotationList al,
VarResolverSession vrs)
Applies a set of annotations to this property store.
|
RestClientBuilder |
applyAnnotations(Class<?> fromClass)
Applies any of the various
|
RestClientBuilder |
applyAnnotations(Method fromMethod)
Applies any of the various
|
RestClientBuilder |
authorization(Object value)
Sets the value for the
|
RestClientBuilder |
autoCloseStreams()
Configuration property: Auto-close streams.
|
RestClientBuilder |
autoCloseStreams(boolean value)
Configuration property: Auto-close streams.
|
RestClientBuilder |
backoffManager(org.apache.http.client.BackoffManager backoffManager) |
RestClientBuilder |
basicAuth(String host,
int port,
String user,
String pw)
Set up this client to use BASIC auth.
|
RestClientBuilder |
beanClassVisibility(Visibility value)
Configuration property: Minimum bean class visibility.
|
RestClientBuilder |
beanConstructorVisibility(Visibility value)
Configuration property: Minimum bean constructor visibility.
|
RestClientBuilder |
beanDictionary(Class<?>... values)
Configuration property: Bean dictionary.
|
RestClientBuilder |
beanDictionary(Object... values)
Configuration property: Bean dictionary.
|
RestClientBuilder |
beanDictionaryRemove(Class<?>... values)
Configuration property: Bean dictionary.
|
RestClientBuilder |
beanDictionaryRemove(Object... values)
Configuration property: Bean dictionary.
|
RestClientBuilder |
beanDictionaryReplace(Class<?>... values)
Configuration property: Bean dictionary.
|
RestClientBuilder |
beanDictionaryReplace(Object... values)
Configuration property: Bean dictionary.
|
RestClientBuilder |
beanFieldVisibility(Visibility value)
Configuration property: Minimum bean field visibility.
|
RestClientBuilder |
beanFilters(Class<?>... values)
Configuration property: Bean filters.
|
RestClientBuilder |
beanFilters(Object... values)
Configuration property: Bean filters.
|
RestClientBuilder |
beanFiltersRemove(Class<?>... values)
Configuration property: Bean filters.
|
RestClientBuilder |
beanFiltersRemove(Object... values)
Configuration property: Bean filters.
|
RestClientBuilder |
beanFiltersReplace(Class<?>... values)
Configuration property: Bean filters.
|
RestClientBuilder |
beanFiltersReplace(Object... values)
Configuration property: Bean filters.
|
RestClientBuilder |
beanMapPutReturnsOldValue()
Configuration property: BeanMap.put() returns old property value.
|
RestClientBuilder |
beanMapPutReturnsOldValue(boolean value)
Configuration property: BeanMap.put() returns old property value.
|
RestClientBuilder |
beanMethodVisibility(Visibility value)
Configuration property: Minimum bean method visibility.
|
RestClientBuilder |
beansRequireDefaultConstructor()
Configuration property: Beans require no-arg constructors.
|
RestClientBuilder |
beansRequireDefaultConstructor(boolean value)
Configuration property: Beans require no-arg constructors.
|
RestClientBuilder |
beansRequireSerializable()
Configuration property: Beans require Serializable interface.
|
RestClientBuilder |
beansRequireSerializable(boolean value)
Configuration property: Beans require Serializable interface.
|
RestClientBuilder |
beansRequireSettersForGetters()
Configuration property: Beans require setters for getters.
|
RestClientBuilder |
beansRequireSettersForGetters(boolean value)
Configuration property: Beans require setters for getters.
|
RestClientBuilder |
beansRequireSomeProperties(boolean value)
Configuration property: Beans require at least one property.
|
RestClientBuilder |
beanTypePropertyName(String value)
Configuration property: Bean type property name.
|
RestClientBuilder |
binaryInputFormat(BinaryFormat value)
Configuration property: Binary input format.
|
RestClientBuilder |
binaryOutputFormat(BinaryFormat value)
Configuration property: Binary string format.
|
RestClient |
build()
Build the object.
|
RestClientBuilder |
cacheControl(Object value)
Sets the value for the
|
RestClientBuilder |
cipherSuites(String... cipherSuites)
Supported cipher suites.
|
RestClientBuilder |
clientVersion(String version)
Sets the client version by setting the value for the
|
RestClientBuilder |
connection(Object value)
Sets the value for the
|
RestClientBuilder |
connectionBackoffStrategy(org.apache.http.client.ConnectionBackoffStrategy connectionBackoffStrategy) |
RestClientBuilder |
connectionManager(org.apache.http.conn.HttpClientConnectionManager connManager) |
RestClientBuilder |
connectionManagerShared(boolean shared) |
RestClientBuilder |
connectionReuseStrategy(org.apache.http.ConnectionReuseStrategy reuseStrategy) |
RestClientBuilder |
connectionTimeToLive(long connTimeToLive,
TimeUnit connTimeToLiveTimeUnit) |
RestClientBuilder |
contentDecoderRegistry(Map<String,org.apache.http.client.entity.InputStreamFactory> contentDecoderMap) |
RestClientBuilder |
contentLength(Object value)
Sets the value for the
|
RestClientBuilder |
contentType(Object value)
Sets the value for the
|
protected org.apache.http.conn.HttpClientConnectionManager |
createConnectionManager()
Creates the
HttpClientConnectionManager returned by createConnectionManager() . |
protected org.apache.http.impl.client.CloseableHttpClient |
createHttpClient()
Creates an instance of an
HttpClient to be used to handle all HTTP communications with the target server. |
protected org.apache.http.impl.client.HttpClientBuilder |
createHttpClientBuilder()
Creates an instance of an
HttpClientBuilder to be used to create the HttpClient . |
RestClientBuilder |
date(Object value)
Sets the value for the
|
RestClientBuilder |
debug()
Configuration property: Debug mode.
|
RestClientBuilder |
debug(boolean value)
Configuration property: Debug mode.
|
RestClientBuilder |
debugOutputLines(int value)
Configuration property: Debug output lines.
|
RestClientBuilder |
defaultAuthSchemeRegistry(org.apache.http.config.Lookup<org.apache.http.auth.AuthSchemeProvider> authSchemeRegistry) |
RestClientBuilder |
defaultConnectionConfig(org.apache.http.config.ConnectionConfig config) |
RestClientBuilder |
defaultCookieSpecRegistry(org.apache.http.config.Lookup<org.apache.http.cookie.CookieSpecProvider> cookieSpecRegistry) |
RestClientBuilder |
defaultCookieStore(org.apache.http.client.CookieStore cookieStore) |
RestClientBuilder |
defaultCredentialsProvider(org.apache.http.client.CredentialsProvider credentialsProvider) |
RestClientBuilder |
defaultHeaders(Collection<? extends org.apache.http.Header> defaultHeaders) |
RestClientBuilder |
defaultRequestConfig(org.apache.http.client.config.RequestConfig config) |
RestClientBuilder |
defaultSocketConfig(org.apache.http.config.SocketConfig config) |
RestClientBuilder |
detectRecursions()
Configuration property: Automatically detect POJO recursions.
|
RestClientBuilder |
detectRecursions(boolean value)
Configuration property: Automatically detect POJO recursions.
|
RestClientBuilder |
disableAuthCaching() |
RestClientBuilder |
disableAutomaticRetries() |
RestClientBuilder |
disableConnectionState() |
RestClientBuilder |
disableContentCompression() |
RestClientBuilder |
disableCookieManagement() |
RestClientBuilder |
disableRedirectHandling() |
RestClientBuilder |
enableLaxSSL()
Enable LARestClientBuilder SSL support.
|
RestClientBuilder |
enableSSL()
Enable SSL support on this client.
|
RestClientBuilder |
evictExpiredConnections() |
RestClientBuilder |
evictIdleConnections(long maxIdleTime,
TimeUnit maxIdleTimeUnit) |
<T> RestClientBuilder |
example(Class<T> c,
T o)
Configuration property: POJO example.
|
<T> RestClientBuilder |
exampleJson(Class<T> c,
String value)
Configuration property: POJO example.
|
RestClientBuilder |
executorService(ExecutorService executorService,
boolean shutdownOnClose)
Configuration property: Executor service.
|
RestClientBuilder |
expect(Object value)
Sets the value for the
|
RestClientBuilder |
fileCharset(String value)
Configuration property: File charset.
|
RestClientBuilder |
forwarded(Object value)
Sets the value for the
|
RestClientBuilder |
from(Object value)
Sets the value for the
|
RestClientBuilder |
header(String key,
Object value)
Configuration property: Request headers.
|
RestClientBuilder |
headers(Map<String,Object> headers)
Sets arbitrary request headers.
|
RestClientBuilder |
host(Object value)
Sets the value for the
|
RestClientBuilder |
hostnameVerifier(HostnameVerifier hostnameVerifier)
Hostname verifier.
|
RestClientBuilder |
html()
Convenience method for specifying HTML as the transmission media type.
|
RestClientBuilder |
httpClient(org.apache.http.impl.client.CloseableHttpClient httpClient,
boolean keepHttpClientOpen)
Sets the internal
HttpClient to use for handling HTTP communications. |
RestClientBuilder |
httpClientConnectionManager(org.apache.http.conn.HttpClientConnectionManager httpClientConnectionManager)
Sets the internal
HttpClientConnectionManager . |
RestClientBuilder |
httpProcessor(org.apache.http.protocol.HttpProcessor httpprocessor) |
RestClientBuilder |
ifMatch(Object value)
Sets the value for the
|
RestClientBuilder |
ifModifiedSince(Object value)
Sets the value for the
|
RestClientBuilder |
ifNoneMatch(Object value)
Sets the value for the
|
RestClientBuilder |
ifRange(Object value)
Sets the value for the
|
RestClientBuilder |
ifUnmodifiedSince(Object value)
Sets the value for the
|
RestClientBuilder |
ignoreInvocationExceptionsOnGetters()
Configuration property: Ignore invocation errors on getters.
|
RestClientBuilder |
ignoreInvocationExceptionsOnGetters(boolean value)
Configuration property: Ignore invocation errors on getters.
|
RestClientBuilder |
ignoreInvocationExceptionsOnSetters()
Configuration property: Ignore invocation errors on setters.
|
RestClientBuilder |
ignoreInvocationExceptionsOnSetters(boolean value)
Configuration property: Ignore invocation errors on setters.
|
RestClientBuilder |
ignorePropertiesWithoutSetters(boolean value)
Configuration property: Ignore properties without setters.
|
RestClientBuilder |
ignoreRecursions()
Configuration property: Ignore recursion errors.
|
RestClientBuilder |
ignoreRecursions(boolean value)
Configuration property: Ignore recursion errors.
|
RestClientBuilder |
ignoreUnknownBeanProperties()
Configuration property: Ignore unknown properties.
|
RestClientBuilder |
ignoreUnknownBeanProperties(boolean value)
Configuration property: Ignore unknown properties.
|
RestClientBuilder |
ignoreUnknownNullBeanProperties(boolean value)
Configuration property: Ignore unknown properties with null values.
|
RestClientBuilder |
implClass(Class<?> interfaceClass,
Class<?> implClass)
Configuration property: Implementation classes.
|
RestClientBuilder |
implClasses(Map<String,Class<?>> values)
Configuration property: Implementation classes.
|
RestClientBuilder |
initialDepth(int value)
Configuration property: Initial depth.
|
RestClientBuilder |
inputStreamCharset(String value)
Configuration property: Input stream charset.
|
RestClientBuilder |
interceptors(RestCallInterceptor... value)
Configuration property: Call interceptors.
|
RestClientBuilder |
json()
Convenience method for specifying JSON as the transmission media type.
|
RestClientBuilder |
keepAliveStrategy(org.apache.http.conn.ConnectionKeepAliveStrategy keepAliveStrategy) |
RestClientBuilder |
keepHttpClientOpen(boolean value)
Configuration property: Keep HttpClient open.
|
RestClientBuilder |
keyManagers(KeyManager... keyManagers)
Key managers.
|
RestClientBuilder |
listenerP(Class<? extends ParserListener> value)
Configuration property: Parser listener.
|
RestClientBuilder |
listenerS(Class<? extends SerializerListener> value)
Configuration property: Serializer listener.
|
RestClientBuilder |
locale(Locale value)
Configuration property: Locale.
|
RestClientBuilder |
logTo(Level level,
Logger log)
Adds a
RestCallLogger to the list of interceptors on this class. |
RestClientBuilder |
marshall(Marshall value)
Configuration property: Marshall
|
RestClientBuilder |
maxConnPerRoute(int maxConnPerRoute) |
RestClientBuilder |
maxConnTotal(int maxConnTotal) |
RestClientBuilder |
maxDepth(int value)
Configuration property: Max serialization depth.
|
RestClientBuilder |
maxForwards(Object value)
Sets the value for the
|
RestClientBuilder |
maxIndent(int value)
Configuration property: Maximum indentation.
|
RestClientBuilder |
mediaType(MediaType value)
Configuration property: Media type.
|
RestClientBuilder |
msgpack()
Convenience method for specifying MessagePack as the transmission media type.
|
RestClientBuilder |
notBeanClasses(Class<?>... values)
Configuration property: Bean class exclusions.
|
RestClientBuilder |
notBeanClasses(Object... values)
Configuration property: Bean class exclusions.
|
RestClientBuilder |
notBeanClassesRemove(Class<?>... values)
Configuration property: Bean class exclusions.
|
RestClientBuilder |
notBeanClassesRemove(Object... values)
Configuration property: Bean class exclusions.
|
RestClientBuilder |
notBeanClassesReplace(Class<?>... values)
Configuration property: Bean class exclusions.
|
RestClientBuilder |
notBeanClassesReplace(Object... values)
Configuration property: Bean class exclusions.
|
RestClientBuilder |
notBeanPackages(Object... values)
Configuration property: Bean package exclusions.
|
RestClientBuilder |
notBeanPackages(String... values)
Configuration property: Bean package exclusions.
|
RestClientBuilder |
notBeanPackagesRemove(Object... values)
Configuration property: Bean package exclusions.
|
RestClientBuilder |
notBeanPackagesRemove(String... values)
Configuration property: Bean package exclusions.
|
RestClientBuilder |
notBeanPackagesReplace(Object... values)
Configuration property: Bean package exclusions.
|
RestClientBuilder |
notBeanPackagesReplace(String... values)
Configuration property: Bean package exclusions.
|
RestClientBuilder |
noTrace()
When called,
|
RestClientBuilder |
openapi()
Convenience method for specifying URL-Encoding as the transmission media type.
|
RestClientBuilder |
origin(Object value)
Sets the value for the
|
RestClientBuilder |
paramFormat(String value)
Configuration property: Parameter format.
|
RestClientBuilder |
paramFormatPlain()
Configuration property: Parameter format.
|
RestClientBuilder |
parser(Class<? extends Parser> value)
Configuration property: Parser.
|
RestClientBuilder |
parser(Parser value)
Configuration property: Parser.
|
RestClientBuilder |
partParser(Class<? extends HttpPartParser> value)
Configuration property: Part parser.
|
RestClientBuilder |
partParser(HttpPartParser value)
Configuration property: Part parser.
|
RestClientBuilder |
partSerializer(Class<? extends HttpPartSerializer> value)
Configuration property: Part serializer.
|
RestClientBuilder |
partSerializer(HttpPartSerializer value)
Configuration property: Part serializer.
|
RestClientBuilder |
plainText()
Convenience method for specifying plain-text as the transmission media type.
|
RestClientBuilder |
pojoSwaps(Class<?>... values)
Configuration property: POJO swaps.
|
RestClientBuilder |
pojoSwaps(Object... values)
Configuration property: POJO swaps.
|
RestClientBuilder |
pojoSwapsRemove(Class<?>... values)
Configuration property: POJO swaps.
|
RestClientBuilder |
pojoSwapsRemove(Object... values)
Configuration property: POJO swaps.
|
RestClientBuilder |
pojoSwapsReplace(Class<?>... values)
Configuration property: POJO swaps.
|
RestClientBuilder |
pojoSwapsReplace(Object... values)
Configuration property: POJO swaps.
|
RestClientBuilder |
pooled()
When called, the
createConnectionManager() method will return a PoolingHttpClientConnectionManager
instead of a BasicHttpClientConnectionManager . |
RestClientBuilder |
pragma(Object value)
Sets the value for the
|
RestClientBuilder |
proxy(org.apache.http.HttpHost proxy) |
RestClientBuilder |
proxyAuthenticationStrategy(org.apache.http.client.AuthenticationStrategy proxyAuthStrategy) |
RestClientBuilder |
proxyAuthorization(Object value)
Sets the value for the
|
RestClientBuilder |
publicSuffixMatcher(org.apache.http.conn.util.PublicSuffixMatcher publicSuffixMatcher) |
RestClientBuilder |
query(String key,
Object value)
Configuration property: Request query parameters.
|
RestClientBuilder |
quoteChar(char value)
Configuration property: Quote character.
|
RestClientBuilder |
range(Object value)
Sets the value for the
|
RestClientBuilder |
redirectStrategy(org.apache.http.client.RedirectStrategy redirectStrategy) |
RestClientBuilder |
referer(Object value)
Sets the value for the
|
RestClientBuilder |
removeFrom(String name,
Object value)
Removes a value from a SET, LIST, or MAP property.
|
RestClientBuilder |
requestExecutor(org.apache.http.protocol.HttpRequestExecutor requestExec) |
RestClientBuilder |
retryable(int retries,
int interval,
RetryOn retryOn)
Make HTTP calls retryable if an error response (>=400) is received.
|
RestClientBuilder |
retryHandler(org.apache.http.client.HttpRequestRetryHandler retryHandler) |
RestClientBuilder |
rootUrl(Object value)
Configuration property: Root URI.
|
RestClientBuilder |
routePlanner(org.apache.http.conn.routing.HttpRoutePlanner routePlanner) |
RestClientBuilder |
schemePortResolver(org.apache.http.conn.SchemePortResolver schemePortResolver) |
RestClientBuilder |
secureRandom(SecureRandom secureRandom)
Trust managers.
|
RestClientBuilder |
serializer(Class<? extends Serializer> value)
Configuration property: Serializer.
|
RestClientBuilder |
serializer(Serializer value)
Configuration property: Serializer.
|
RestClientBuilder |
serviceUnavailableRetryStrategy(org.apache.http.client.ServiceUnavailableRetryStrategy serviceUnavailStrategy) |
RestClientBuilder |
set(Map<String,Object> properties)
Sets multiple configuration properties on this object.
|
RestClientBuilder |
set(String name,
Object value)
Sets a configuration property on this object.
|
RestClientBuilder |
simpleJson()
Convenience method for specifying Simple JSON as the transmission media type.
|
RestClientBuilder |
sortCollections()
Configuration property: Sort arrays and collections alphabetically.
|
RestClientBuilder |
sortCollections(boolean value)
Configuration property: Sort arrays and collections alphabetically.
|
RestClientBuilder |
sortMaps()
Configuration property: Sort maps alphabetically.
|
RestClientBuilder |
sortMaps(boolean value)
Sets the
Serializer.SERIALIZER_sortMaps property on all serializers in this group. |
RestClientBuilder |
sortProperties()
Configuration property: Sort bean properties.
|
RestClientBuilder |
sortProperties(boolean value)
Configuration property: Sort bean properties.
|
RestClientBuilder |
sq()
Configuration property: Quote character.
|
RestClientBuilder |
sslContext(SSLContext sslContext) |
RestClientBuilder |
sslHostnameVerifier(HostnameVerifier hostnameVerifier) |
RestClientBuilder |
sslProtocols(String... sslProtocols)
Supported SSL protocols.
|
RestClientBuilder |
sslSocketFactory(org.apache.http.conn.socket.LayeredConnectionSocketFactory sslSocketFactory) |
RestClientBuilder |
strict()
Configuration property: Strict mode.
|
RestClientBuilder |
strict(boolean value)
Configuration property: Strict mode.
|
RestClientBuilder |
targetAuthenticationStrategy(org.apache.http.client.AuthenticationStrategy targetAuthStrategy) |
RestClientBuilder |
te(Object value)
Sets the value for the
|
RestClientBuilder |
timeZone(TimeZone value)
Configuration property: TimeZone.
|
RestClientBuilder |
trimEmptyCollections()
Configuration property: Trim empty lists and arrays.
|
RestClientBuilder |
trimEmptyCollections(boolean value)
Configuration property: Trim empty lists and arrays.
|
RestClientBuilder |
trimEmptyMaps()
Configuration property: Trim empty maps.
|
RestClientBuilder |
trimEmptyMaps(boolean value)
Configuration property: Trim empty maps.
|
RestClientBuilder |
trimNullProperties(boolean value)
Configuration property: Trim null bean property values.
|
RestClientBuilder |
trimStringsP()
Configuration property: Trim parsed strings.
|
RestClientBuilder |
trimStringsP(boolean value)
Configuration property: Trim parsed strings.
|
RestClientBuilder |
trimStringsS()
Configuration property: Trim strings.
|
RestClientBuilder |
trimStringsS(boolean value)
Configuration property: Trim strings.
|
RestClientBuilder |
trustManagers(TrustManager... trustManagers)
Trust managers.
|
RestClientBuilder |
unbuffered()
Configuration property: Unbuffered.
|
RestClientBuilder |
unbuffered(boolean value)
Configuration property: Unbuffered.
|
RestClientBuilder |
uon()
Convenience method for specifying UON as the transmission media type.
|
RestClientBuilder |
upgrade(Object value)
Sets the value for the
|
RestClientBuilder |
uriContext(UriContext value)
Configuration property: URI context bean.
|
RestClientBuilder |
uriRelativity(UriRelativity value)
Configuration property: URI relativity.
|
RestClientBuilder |
uriResolution(UriResolution value)
Configuration property: URI resolution.
|
RestClientBuilder |
urlEnc()
Convenience method for specifying URL-Encoding as the transmission media type.
|
RestClientBuilder |
useEnumNames()
Configuration property: Use enum names.
|
RestClientBuilder |
useEnumNames(boolean value)
Configuration property: Use enum names.
|
RestClientBuilder |
useInterfaceProxies(boolean value)
Configuration property: Use interface proxies.
|
RestClientBuilder |
useJavaBeanIntrospector()
Configuration property: Use Java Introspector.
|
RestClientBuilder |
useJavaBeanIntrospector(boolean value)
Configuration property: Use Java Introspector.
|
RestClientBuilder |
userAgent(Object value)
Sets the value for the
|
RestClientBuilder |
userAgent(String userAgent) |
RestClientBuilder |
userTokenHandler(org.apache.http.client.UserTokenHandler userTokenHandler) |
RestClientBuilder |
useSystemProperties() |
RestClientBuilder |
useWhitespace()
Configuration property: Use whitespace.
|
RestClientBuilder |
useWhitespace(boolean value)
Configuration property: Use whitespace.
|
RestClientBuilder |
via(Object value)
Sets the value for the
|
RestClientBuilder |
warning(Object value)
Sets the value for the
|
RestClientBuilder |
ws()
Configuration property: Use whitespace.
|
RestClientBuilder |
xml()
Convenience method for specifying XML as the transmission media type.
|
examples, excludeProperties, excludeProperties, excludeProperties, fluentSetters, fluentSetters, includeProperties, includeProperties, includeProperties, propertyNamer
build, getPropertyStore, getPropertyStoreBuilder, peek, peek
protected RestClientBuilder(PropertyStore ps, org.apache.http.impl.client.HttpClientBuilder httpClientBuilder)
ps
- Initial configuration properties for this builder.
httpClientBuilder
- The HTTP client builder to use for this REST client builder.
createHttpClientBuilder()
to instantiate it again.public RestClient build()
ContextBuilder
build
in class BeanContextBuilder
public RestClientBuilder json()
Identical to calling serializer(JsonSerializer.
.
public RestClientBuilder simpleJson()
Identical to calling serializer(SimpleJsonSerializer.
.
public RestClientBuilder xml()
Identical to calling serializer(XmlSerializer.
.
public RestClientBuilder html()
Identical to calling serializer(HtmlSerializer.
.
public RestClientBuilder plainText()
Identical to calling serializer(PlainTextSerializer.
.
public RestClientBuilder msgpack()
Identical to calling serializer(MsgPackSerializer.
.
public RestClientBuilder uon()
Identical to calling serializer(UonSerializer.
.
public RestClientBuilder urlEnc()
Identical to calling serializer(UrlEncodingSerializer.
.
public RestClientBuilder openapi()
Identical to calling serializer(OpenApiSerializer.
.
protected org.apache.http.impl.client.CloseableHttpClient createHttpClient() throws Exception
HttpClient
to be used to handle all HTTP communications with the target server.
This HTTP client is used when the HTTP client is not specified through one of the constructors or the
httpClient(CloseableHttpClient, boolean)
method.
Subclasses can override this method to provide specially-configured HTTP clients to handle stuff such as SSL/TLS certificate handling, authentication, etc.
The default implementation returns an instance of HttpClient
using the client builder returned by
createHttpClientBuilder()
.
Exception
- Error occurred.protected org.apache.http.impl.client.HttpClientBuilder createHttpClientBuilder()
HttpClientBuilder
to be used to create the HttpClient
.
Subclasses can override this method to provide their own client builder.
The predefined method returns an HttpClientBuilder
with the following settings:
createConnectionManager()
.
protected org.apache.http.conn.HttpClientConnectionManager createConnectionManager() throws KeyManagementException, NoSuchAlgorithmException
HttpClientConnectionManager
returned by createConnectionManager()
.
Subclasses can override this method to provide their own connection manager.
The default implementation returns an instance of a PoolingHttpClientConnectionManager
.
NoSuchAlgorithmException
- Unknown cryptographic algorithm.KeyManagementException
- General key management exception.public RestClientBuilder enableSSL()
Used in conjunction with the following methods for setting up SSL parameters:
public RestClientBuilder enableLaxSSL() throws KeyStoreException, NoSuchAlgorithmException
Same as calling the following:
builder
.enableSSL()
.hostnameVerifier(
KeyStoreException
- Generic keystore exception.NoSuchAlgorithmException
- Unknown cryptographic algorithm.public RestClientBuilder sslProtocols(String... sslProtocols)
This is the value passed to the SSLConnectionSocketFactory.SSLConnectionSocketFactory(SSLContext,String[],String[],HostnameVerifier)
constructor.
The default value is taken from the system property
If system property is not defined, defaults to {
.
This method is effectively ignored if enableSSL()
has not been called or the client connection manager
has been defined via httpClientConnectionManager(HttpClientConnectionManager)
.
sslProtocols
- The supported SSL protocols.public RestClientBuilder cipherSuites(String... cipherSuites)
This is the value passed to the SSLConnectionSocketFactory.SSLConnectionSocketFactory(SSLContext,String[],String[],HostnameVerifier)
constructor.
The default value is
This method is effectively ignored if enableSSL()
has not been called or the client connection manager
has been defined via httpClientConnectionManager(HttpClientConnectionManager)
.
cipherSuites
- The supported cipher suites.public RestClientBuilder hostnameVerifier(HostnameVerifier hostnameVerifier)
This is the value passed to the SSLConnectionSocketFactory.SSLConnectionSocketFactory(SSLContext,String[],String[],HostnameVerifier)
constructor.
The default value is
This method is effectively ignored if enableSSL()
has not been called or the client connection manager
has been defined via httpClientConnectionManager(HttpClientConnectionManager)
.
hostnameVerifier
- The hostname verifier.public RestClientBuilder keyManagers(KeyManager... keyManagers)
This is the value passed to the SSLContext.init(KeyManager[],TrustManager[],SecureRandom)
method.
The default value is
This method is effectively ignored if enableSSL()
has not been called or the client connection manager
has been defined via httpClientConnectionManager(HttpClientConnectionManager)
.
keyManagers
- The key managers.public RestClientBuilder trustManagers(TrustManager... trustManagers)
This is the value passed to the SSLContext.init(KeyManager[],TrustManager[],SecureRandom)
method.
The default value is
This method is effectively ignored if enableSSL()
has not been called or the client connection manager
has been defined via httpClientConnectionManager(HttpClientConnectionManager)
.
trustManagers
- The trust managers.public RestClientBuilder secureRandom(SecureRandom secureRandom)
This is the value passed to the SSLContext.init(KeyManager[],TrustManager[],SecureRandom)
method.
The default value is
This method is effectively ignored if enableSSL()
has not been called or the client connection manager
has been defined via httpClientConnectionManager(HttpClientConnectionManager)
.
secureRandom
- The random number generator.public RestClientBuilder clientVersion(String version)
version
- The version string (e.g. public RestClientBuilder logTo(Level level, Logger log)
RestCallLogger
to the list of interceptors on this class.level
- The log level to log messages at.log
- The logger to log messages to.public RestClientBuilder pooled()
createConnectionManager()
method will return a PoolingHttpClientConnectionManager
instead of a BasicHttpClientConnectionManager
.public RestClientBuilder basicAuth(String host, int port, String user, String pw)
host
- The auth scope hostname.port
- The auth scope port.user
- The username.pw
- The password.public RestClientBuilder httpClient(org.apache.http.impl.client.CloseableHttpClient httpClient, boolean keepHttpClientOpen)
HttpClient
to use for handling HTTP communications.httpClient
- The HTTP client.keepHttpClientOpen
- Don't close this client when the RestClient.close()
method is called.public RestClientBuilder httpClientConnectionManager(org.apache.http.conn.HttpClientConnectionManager httpClientConnectionManager)
HttpClientConnectionManager
.httpClientConnectionManager
- The HTTP client connection manager.public RestClientBuilder headers(Map<String,Object> headers)
headers
- The headers to set on requests.public RestClientBuilder accept(Object value)
This overrides the media type specified on the parser, but is overridden by calling
header(
value
- The new header value.public RestClientBuilder acceptCharset(Object value)
This is a shortcut for calling header(
value
- The new header value.public RestClientBuilder acceptEncoding(Object value)
This is a shortcut for calling header(
value
- The new header value.public RestClientBuilder acceptLanguage(Object value)
This is a shortcut for calling header(
value
- The new header value.public RestClientBuilder authorization(Object value)
This is a shortcut for calling header(
value
- The new header value.public RestClientBuilder cacheControl(Object value)
This is a shortcut for calling header(
value
- The new header value.public RestClientBuilder connection(Object value)
This is a shortcut for calling header(
value
- The new header value.public RestClientBuilder contentLength(Object value)
This is a shortcut for calling header(
value
- The new header value.public RestClientBuilder contentType(Object value)
This overrides the media type specified on the serializer, but is overridden by calling
header(
value
- The new header value.public RestClientBuilder date(Object value)
This is a shortcut for calling header(
value
- The new header value.public RestClientBuilder expect(Object value)
This is a shortcut for calling header(
value
- The new header value.public RestClientBuilder forwarded(Object value)
This is a shortcut for calling header(
value
- The new header value.public RestClientBuilder from(Object value)
This is a shortcut for calling header(
value
- The new header value.public RestClientBuilder host(Object value)
This is a shortcut for calling header(
value
- The new header value.public RestClientBuilder ifMatch(Object value)
This is a shortcut for calling header(
value
- The new header value.public RestClientBuilder ifModifiedSince(Object value)
This is a shortcut for calling header(
value
- The new header value.public RestClientBuilder ifNoneMatch(Object value)
This is a shortcut for calling header(
value
- The new header value.public RestClientBuilder ifRange(Object value)
This is a shortcut for calling header(
value
- The new header value.public RestClientBuilder ifUnmodifiedSince(Object value)
This is a shortcut for calling header(
value
- The new header value.public RestClientBuilder maxForwards(Object value)
This is a shortcut for calling header(
value
- The new header value.public RestClientBuilder noTrace()
This gives the opportunity for the servlet to not log errors on invalid requests. This is useful for testing purposes when you don't want your log file to show lots of errors that are simply the results of testing.
public RestClientBuilder origin(Object value)
This is a shortcut for calling header(
value
- The new header value.public RestClientBuilder pragma(Object value)
This is a shortcut for calling header(
value
- The new header value.public RestClientBuilder proxyAuthorization(Object value)
This is a shortcut for calling header(
value
- The new header value.public RestClientBuilder range(Object value)
This is a shortcut for calling header(
value
- The new header value.public RestClientBuilder referer(Object value)
This is a shortcut for calling header(
value
- The new header value.public RestClientBuilder te(Object value)
This is a shortcut for calling header(
value
- The new header value.public RestClientBuilder userAgent(Object value)
This is a shortcut for calling header(
value
- The new header value.public RestClientBuilder upgrade(Object value)
This is a shortcut for calling header(
value
- The new header value.public RestClientBuilder via(Object value)
This is a shortcut for calling header(
value
- The new header value.public RestClientBuilder warning(Object value)
This is a shortcut for calling header(
value
- The new header value.public RestClientBuilder executorService(ExecutorService executorService, boolean shutdownOnClose)
Defines the executor service to use when calling future methods on the RestCall
class.
This executor service is used to create Future
objects on the following methods:
RestCall.runFuture()
RestCall.getResponseFuture(Class)
RestCall.getResponseFuture(Type,Type...)
RestCall.getResponseAsString()
The default executor service is a single-threaded ThreadPoolExecutor
with a 30 second timeout
and a queue size of 10.
executorService
- The executor service.shutdownOnClose
- Call ExecutorService.shutdown()
when RestClient.close()
is called.public RestClientBuilder header(String key, Object value)
key
- The header name.value
- The header value.public RestClientBuilder keepHttpClientOpen(boolean value)
Don't close this client when the RestClient.close()
method is called.
value
- The new value for this property.
public RestClientBuilder interceptors(RestCallInterceptor... value)
Adds an interceptor that gets called immediately after a connection is made.
value
- The values to add to this setting.public RestClientBuilder marshall(Marshall value)
Shortcut for specifying the RestClient.RESTCLIENT_serializer
and RestClient.RESTCLIENT_parser
using the serializer and parser defined in a marshall.
value
- The values to add to this setting.public RestClientBuilder parser(Class<? extends Parser> value)
The parser to use for parsing POJOs in response bodies.
value
- The new value for this setting.
JsonParser.DEFAULT
.public RestClientBuilder parser(Parser value)
Same as parser(Parser)
except takes in a parser instance.
value
- The new value for this setting.
JsonParser.DEFAULT
.public RestClientBuilder partParser(Class<? extends HttpPartParser> value)
The parser to use for parsing POJOs from form data, query parameters, headers, and path variables.
value
- The new value for this setting.
OpenApiParser
.public RestClientBuilder partParser(HttpPartParser value)
Same as partParser(Class)
but takes in a parser instance.
value
- The new value for this setting.
OpenApiParser
.public RestClientBuilder partSerializer(Class<? extends HttpPartSerializer> value)
The serializer to use for serializing POJOs in form data, query parameters, headers, and path variables.
value
- The new value for this setting.
OpenApiSerializer
.public RestClientBuilder partSerializer(HttpPartSerializer value)
Same as partSerializer(Class)
but takes in a parser instance.
value
- The new value for this setting.
OpenApiSerializer
.public RestClientBuilder retryable(int retries, int interval, RetryOn retryOn)
retries
- The number of retries to attempt.interval
- The time in milliseconds between attempts.retryOn
- Optional object used for determining whether a retry should be attempted.
If RetryOn.DEFAULT
.public RestClientBuilder rootUrl(Object value)
When set, relative URL strings passed in through the various rest call methods (e.g. RestClient.doGet(Object)
will be prefixed with the specified root.
This root URL is ignored on those methods if you pass in a URL
, URI
, or an absolute URL string.
value
- The root URL to prefix to relative URL strings.
public RestClientBuilder query(String key, Object value)
key
- The query parameter name.value
- The query parameter value value.public RestClientBuilder serializer(Class<? extends Serializer> value)
The serializer to use for serializing POJOs in request bodies.
value
- The new value for this setting.
JsonSerializer
.public RestClientBuilder serializer(Serializer value)
Same as serializer(Class)
but takes in a serializer instance.
value
- The new value for this setting.
JsonSerializer
.public RestClientBuilder addBeanTypes(boolean value)
If
value
- The new value for this property.
public RestClientBuilder addBeanTypes()
Shortcut for calling addBeanTypes(
.
public RestClientBuilder addRootType(boolean value)
When disabled, it is assumed that the parser knows the exact Java POJO type being parsed, and therefore top-level type information that might normally be included to determine the data type will not be serialized.
value
- The new value for this property.
public RestClientBuilder addRootType()
Shortcut for calling addRootType(
.
public RestClientBuilder detectRecursions(boolean value)
Specifies that recursions should be checked for during serialization.
value
- The new value for this property.
public RestClientBuilder detectRecursions()
Shortcut for calling detectRecursions(
.
public RestClientBuilder ignoreRecursions(boolean value)
If
value
- The new value for this property.
public RestClientBuilder ignoreRecursions()
Shortcut for calling ignoreRecursions(
.
public RestClientBuilder initialDepth(int value)
The initial indentation level at the root.
value
- The new value for this property.
public RestClientBuilder listenerS(Class<? extends SerializerListener> value)
Class used to listen for errors and warnings that occur during serialization.
value
- The new value for this property.public RestClientBuilder maxDepth(int value)
Abort serialization if specified depth is reached in the POJO tree.
If this depth is exceeded, an exception is thrown.
This prevents stack overflows from occurring when trying to serialize models with recursive references.
value
- The new value for this property.
public RestClientBuilder sortCollections(boolean value)
Copies and sorts the contents of arrays and collections before serializing them.
value
- The new value for this property.
public RestClientBuilder sortCollections()
Shortcut for calling sortCollections(
.
public RestClientBuilder sortMaps(boolean value)
Serializer.SERIALIZER_sortMaps
property on all serializers in this group.
Copies and sorts the contents of maps before serializing them.
value
- The new value for this property.public RestClientBuilder sortMaps()
Shortcut for calling sortMaps(
.
public RestClientBuilder trimEmptyCollections(boolean value)
If
value
- The new value for this property.
public RestClientBuilder trimEmptyCollections()
Shortcut for calling trimEmptyCollections(
.
public RestClientBuilder trimEmptyMaps(boolean value)
If
value
- The new value for this property.
public RestClientBuilder trimEmptyMaps()
Shortcut for calling trimEmptyMaps(
.
public RestClientBuilder trimNullProperties(boolean value)
If
value
- The new value for this property.
public RestClientBuilder trimStringsS(boolean value)
If String.trim()
before being serialized.
value
- The new value for this property.
public RestClientBuilder trimStringsS()
Shortcut for calling trimStrings(
.
public RestClientBuilder uriContext(UriContext value)
Bean used for resolution of URIs to absolute or root-relative form.
value
- The new value for this property.public RestClientBuilder uriRelativity(UriRelativity value)
Defines what relative URIs are relative to when serializing URI/URL objects.
value
- The new value for this property.
UriRelativity.RESOURCE
public RestClientBuilder uriResolution(UriResolution value)
Defines the resolution level for URIs when serializing URI/URL objects.
value
- The new value for this property.
UriResolution.NONE
public RestClientBuilder maxIndent(int value)
Specifies the maximum indentation level in the serialized document.
value
- The new value for this property.
public RestClientBuilder quoteChar(char value)
This is the character used for quoting attributes and values.
value
- The new value for this property.
public RestClientBuilder sq()
Shortcut for calling quoteChar(
.
public RestClientBuilder useWhitespace(boolean value)
If
value
- The new value for this property.
public RestClientBuilder useWhitespace()
Shortcut for calling useWhitespace(
.
public RestClientBuilder ws()
Shortcut for calling useWhitespace(
.
public RestClientBuilder binaryOutputFormat(BinaryFormat value)
When using the Serializer.serializeToString(Object)
method on stream-based serializers, this defines the format to use
when converting the resulting byte array to a string.
value
- The new value for this property.
BinaryFormat.HEX
.public RestClientBuilder autoCloseStreams(boolean value)
value
- The new value for this property.
public RestClientBuilder autoCloseStreams()
Shortcut for calling autoCloseStreams(
.
public RestClientBuilder debugOutputLines(int value)
value
- The new value for this property.
public RestClientBuilder listenerP(Class<? extends ParserListener> value)
Class used to listen for errors and warnings that occur during parsing.
value
- The new value for this property.public RestClientBuilder strict(boolean value)
If
value
- The new value for this property.
public RestClientBuilder strict()
Shortcut for calling strict(
.
public RestClientBuilder trimStringsP(boolean value)
If String.trim()
before being added to
the POJO.
value
- The new value for this property.
public RestClientBuilder trimStringsP()
Shortcut for calling trimStrings(
.
public RestClientBuilder unbuffered(boolean value)
value
- The new value for this property.
public RestClientBuilder unbuffered()
Shortcut for calling unbuffered(
.
public RestClientBuilder fileCharset(String value)
The character set to use for reading
value
- The new value for this property.
public RestClientBuilder inputStreamCharset(String value)
The character set to use for converting
value
- The new value for this property.
public RestClientBuilder binaryInputFormat(BinaryFormat value)
When using the Parser.parse(Object,Class)
method on stream-based parsers and the input is a string, this defines the format to use
when converting the string into a byte array.
value
- The new value for this property.
BinaryFormat.HEX
.public RestClientBuilder paramFormat(String value)
value
- The new value for this property.public RestClientBuilder paramFormatPlain()
public RestClientBuilder beanClassVisibility(Visibility value)
BeanContextBuilder
Classes are not considered beans unless they meet the minimum visibility requirements.
For example, if the visibility is
beanClassVisibility
in class BeanContextBuilder
value
- The new value for this property.
Visibility.PUBLIC
.public RestClientBuilder beanConstructorVisibility(Visibility value)
BeanContextBuilder
Only look for constructors with the specified minimum visibility.
beanConstructorVisibility
in class BeanContextBuilder
value
- The new value for this property.
Visibility.PUBLIC
.public RestClientBuilder beanDictionary(Class<?>... values)
BeanContextBuilder
Same as BeanContextBuilder.beanDictionary(Object...)
but takes in an array of classes.
beanDictionary
in class BeanContextBuilder
values
- The values to add to this property.public RestClientBuilder beanDictionary(Object... values)
BeanContextBuilder
Adds to the list of classes that make up the bean dictionary in this bean context.
beanDictionary
in class BeanContextBuilder
values
- The values to add to this property.public RestClientBuilder beanDictionaryReplace(Class<?>... values)
BeanContextBuilder
Same as BeanContextBuilder.beanDictionary(Object...)
but replaces the existing value.
beanDictionaryReplace
in class BeanContextBuilder
values
- The new values for this property.public RestClientBuilder beanDictionaryReplace(Object... values)
BeanContextBuilder
Same as BeanContextBuilder.beanDictionary(Object...)
but replaces the existing value.
beanDictionaryReplace
in class BeanContextBuilder
values
- The new values for this property.public RestClientBuilder beanDictionaryRemove(Class<?>... values)
BeanContextBuilder
Removes from the list of classes that make up the bean dictionary in this bean context.
beanDictionaryRemove
in class BeanContextBuilder
values
- The values to remove from this property.public RestClientBuilder beanDictionaryRemove(Object... values)
BeanContextBuilder
Removes from the list of classes that make up the bean dictionary in this bean context.
beanDictionaryRemove
in class BeanContextBuilder
values
- The values to remove from this property.public RestClientBuilder beanFieldVisibility(Visibility value)
BeanContextBuilder
Only look for bean fields with the specified minimum visibility.
beanFieldVisibility
in class BeanContextBuilder
value
- The new value for this property.
Visibility.PUBLIC
.public RestClientBuilder beanFilters(Class<?>... values)
BeanContextBuilder
Same as BeanContextBuilder.beanFilters(Object...)
but takes in an array of classes.
beanFilters
in class BeanContextBuilder
values
- The values to add to this property.public RestClientBuilder beanFilters(Object... values)
BeanContextBuilder
This is a programmatic equivalent to the @Bean
annotation.
It's useful when you want to use the Bean annotation functionality, but you don't have the ability to alter
the bean classes.
beanFilters
in class BeanContextBuilder
values
- The values to add to this property.
@Bean(typeName)
.
BeanDictionaryList
containing a collection of bean classes with type name annotations.
BeanDictionaryMap
containing a mapping of type names to classes without type name annotations.
public RestClientBuilder beanFiltersReplace(Class<?>... values)
BeanContextBuilder
Same as BeanContextBuilder.beanFilters(Object...)
but replaces the existing values.
beanFiltersReplace
in class BeanContextBuilder
values
- The new values for this property.
@Bean(typeName)
.
BeanDictionaryList
containing a collection of bean classes with type name annotations.
BeanDictionaryMap
containing a mapping of type names to classes without type name annotations.
public RestClientBuilder beanFiltersReplace(Object... values)
BeanContextBuilder
Same as BeanContextBuilder.beanFilters(Object...)
but replaces the existing values.
beanFiltersReplace
in class BeanContextBuilder
values
- The new values for this property.
@Bean(typeName)
.
BeanDictionaryList
containing a collection of bean classes with type name annotations.
BeanDictionaryMap
containing a mapping of type names to classes without type name annotations.
public RestClientBuilder beanFiltersRemove(Class<?>... values)
BeanContextBuilder
Removes from the list of classes that make up the bean filters in this bean context.
beanFiltersRemove
in class BeanContextBuilder
values
- The values to remove from this property.
@Bean(typeName)
.
BeanDictionaryList
containing a collection of bean classes with type name annotations.
BeanDictionaryMap
containing a mapping of type names to classes without type name annotations.
public RestClientBuilder beanFiltersRemove(Object... values)
BeanContextBuilder
Removes from the list of classes that make up the bean filters in this bean context.
beanFiltersRemove
in class BeanContextBuilder
values
- The values to remove from this property.
@Bean(typeName)
.
BeanDictionaryList
containing a collection of bean classes with type name annotations.
BeanDictionaryMap
containing a mapping of type names to classes without type name annotations.
public RestClientBuilder beanMapPutReturnsOldValue(boolean value)
BeanContextBuilder
If BeanMap.put()
method will return old property
values.
Otherwise, it returns
beanMapPutReturnsOldValue
in class BeanContextBuilder
value
- The new value for this property.
public RestClientBuilder beanMapPutReturnsOldValue()
BeanContextBuilder
Shortcut for calling beanMapPutReturnsOldValue(
.
beanMapPutReturnsOldValue
in class BeanContextBuilder
public RestClientBuilder beanMethodVisibility(Visibility value)
BeanContextBuilder
Only look for bean methods with the specified minimum visibility.
beanMethodVisibility
in class BeanContextBuilder
value
- The new value for this property.
Visibility.PUBLIC
public RestClientBuilder beansRequireDefaultConstructor(boolean value)
BeanContextBuilder
If
Otherwise, the bean will be serialized as a string using the Object.toString()
method.
beansRequireDefaultConstructor
in class BeanContextBuilder
value
- The new value for this property.
public RestClientBuilder beansRequireDefaultConstructor()
BeanContextBuilder
Shortcut for calling beansRequireDefaultConstructor(
.
beansRequireDefaultConstructor
in class BeanContextBuilder
public RestClientBuilder beansRequireSerializable(boolean value)
BeanContextBuilder
If Serializable
interface to be considered a bean.
Otherwise, the bean will be serialized as a string using the Object.toString()
method.
beansRequireSerializable
in class BeanContextBuilder
value
- The new value for this property.
public RestClientBuilder beansRequireSerializable()
BeanContextBuilder
Shortcut for calling beansRequireSerializable(
.
beansRequireSerializable
in class BeanContextBuilder
public RestClientBuilder beansRequireSettersForGetters(boolean value)
BeanContextBuilder
If
Otherwise, they will be ignored.
beansRequireSettersForGetters
in class BeanContextBuilder
value
- The new value for this property.
public RestClientBuilder beansRequireSettersForGetters()
BeanContextBuilder
Shortcut for calling beansRequireSettersForGetters(
.
beansRequireSettersForGetters
in class BeanContextBuilder
public RestClientBuilder beansRequireSomeProperties(boolean value)
BeanContextBuilder
If
Otherwise, the bean will be serialized as a string using the Object.toString()
method.
beansRequireSomeProperties
in class BeanContextBuilder
value
- The new value for this property.
public RestClientBuilder beanTypePropertyName(String value)
BeanContextBuilder
This specifies the name of the bean property used to store the dictionary name of a bean type so that the parser knows the data type to reconstruct.
beanTypePropertyName
in class BeanContextBuilder
value
- The new value for this property.
public RestClientBuilder debug()
BeanContextBuilder
Shortcut for calling debug(
.
debug
in class BeanContextBuilder
public RestClientBuilder debug(boolean value)
BeanContextBuilder
Enables the following additional information during serialization:
BeanTraverseContext.BEANTRAVERSE_detectRecursions
.
debug
in class BeanContextBuilder
value
- The new value for this property.
public <T> RestClientBuilder example(Class<T> c, T o)
BeanContextBuilder
Specifies an example of the specified class.
example
in class BeanContextBuilder
c
- The POJO class.o
- An instance of the POJO class used for examples.public <T> RestClientBuilder exampleJson(Class<T> c, String value)
BeanContextBuilder
Specifies an example of the specified class.
exampleJson
in class BeanContextBuilder
T
- The POJO class type.c
- The POJO class.value
- The simple JSON representation of the example.public RestClientBuilder ignoreInvocationExceptionsOnGetters(boolean value)
BeanContextBuilder
If BeanRuntimeException
is thrown.
ignoreInvocationExceptionsOnGetters
in class BeanContextBuilder
value
- The new value for this property.
public RestClientBuilder ignoreInvocationExceptionsOnGetters()
BeanContextBuilder
Shortcut for calling ignoreInvocationExceptionsOnGetters(
.
ignoreInvocationExceptionsOnGetters
in class BeanContextBuilder
public RestClientBuilder ignoreInvocationExceptionsOnSetters(boolean value)
BeanContextBuilder
If
Otherwise, a BeanRuntimeException
is thrown.
ignoreInvocationExceptionsOnSetters
in class BeanContextBuilder
value
- The new value for this property.
public RestClientBuilder ignoreInvocationExceptionsOnSetters()
BeanContextBuilder
Shortcut for calling ignoreInvocationExceptionsOnSetters(
.
ignoreInvocationExceptionsOnSetters
in class BeanContextBuilder
public RestClientBuilder ignorePropertiesWithoutSetters(boolean value)
BeanContextBuilder
If
Otherwise, a BeanRuntimeException
is thrown.
ignorePropertiesWithoutSetters
in class BeanContextBuilder
value
- The new value for this property.
public RestClientBuilder ignoreUnknownBeanProperties(boolean value)
BeanContextBuilder
If
Otherwise, a BeanRuntimeException
is thrown.
ignoreUnknownBeanProperties
in class BeanContextBuilder
value
- The new value for this property.
public RestClientBuilder ignoreUnknownBeanProperties()
BeanContextBuilder
Shortcut for calling ignoreUnknownBeanProperties(
.
ignoreUnknownBeanProperties
in class BeanContextBuilder
public RestClientBuilder ignoreUnknownNullBeanProperties(boolean value)
BeanContextBuilder
If
Otherwise, a BeanRuntimeException
is thrown.
ignoreUnknownNullBeanProperties
in class BeanContextBuilder
value
- The new value for this property.
public RestClientBuilder implClass(Class<?> interfaceClass, Class<?> implClass)
BeanContextBuilder
implClass
in class BeanContextBuilder
interfaceClass
- The interface class.implClass
- The implementation class.public RestClientBuilder implClasses(Map<String,Class<?>> values)
BeanContextBuilder
For interfaces and abstract classes this method can be used to specify an implementation class for the interface/abstract class so that instances of the implementation class are used when instantiated (e.g. during a parse).
implClasses
in class BeanContextBuilder
values
- The new value for this property.public RestClientBuilder locale(Locale value)
BeanContextBuilder
Specifies a default locale for serializer and parser sessions.
locale
in class BeanContextBuilder
value
- The new value for this property.public RestClientBuilder mediaType(MediaType value)
BeanContextBuilder
Specifies a default media type value for serializer and parser sessions.
mediaType
in class BeanContextBuilder
value
- The new value for this property.public RestClientBuilder notBeanClasses(Class<?>... values)
BeanContextBuilder
List of classes that should not be treated as beans even if they appear to be bean-like.
Not-bean classes are converted to
notBeanClasses
in class BeanContextBuilder
values
- The values to add to this property.public RestClientBuilder notBeanClasses(Object... values)
BeanContextBuilder
List of classes that should not be treated as beans even if they appear to be bean-like.
Not-bean classes are converted to
notBeanClasses
in class BeanContextBuilder
values
- The values to add to this property.
public RestClientBuilder notBeanClassesReplace(Class<?>... values)
BeanContextBuilder
Not-bean classes are converted to
notBeanClassesReplace
in class BeanContextBuilder
values
- The new value for this property.public RestClientBuilder notBeanClassesReplace(Object... values)
BeanContextBuilder
Not-bean classes are converted to
notBeanClassesReplace
in class BeanContextBuilder
values
- The new value for this property.
public RestClientBuilder notBeanClassesRemove(Class<?>... values)
BeanContextBuilder
notBeanClassesRemove
in class BeanContextBuilder
values
- The values to remove from this property.public RestClientBuilder notBeanClassesRemove(Object... values)
BeanContextBuilder
notBeanClassesRemove
in class BeanContextBuilder
values
- The values to remove from this property.
public RestClientBuilder notBeanPackages(Object... values)
BeanContextBuilder
notBeanPackages
in class BeanContextBuilder
values
- The values to add to this property.
public RestClientBuilder notBeanPackages(String... values)
BeanContextBuilder
notBeanPackages
in class BeanContextBuilder
values
- The values to add to this property.public RestClientBuilder notBeanPackagesReplace(String... values)
BeanContextBuilder
notBeanPackagesReplace
in class BeanContextBuilder
values
- public RestClientBuilder notBeanPackagesReplace(Object... values)
BeanContextBuilder
notBeanPackagesReplace
in class BeanContextBuilder
values
- public RestClientBuilder notBeanPackagesRemove(String... values)
BeanContextBuilder
notBeanPackagesRemove
in class BeanContextBuilder
values
- The values to remove from this property.public RestClientBuilder notBeanPackagesRemove(Object... values)
BeanContextBuilder
notBeanPackagesRemove
in class BeanContextBuilder
values
- public RestClientBuilder pojoSwaps(Class<?>... values)
BeanContextBuilder
pojoSwaps
in class BeanContextBuilder
values
- The values to add to this property.public RestClientBuilder pojoSwaps(Object... values)
BeanContextBuilder
pojoSwaps
in class BeanContextBuilder
values
- The values to add to this property.
PojoSwap
.
SurrogateSwap
.
public RestClientBuilder pojoSwapsReplace(Class<?>... values)
BeanContextBuilder
pojoSwapsReplace
in class BeanContextBuilder
values
- The values to remove from this property.
PojoSwap
.
SurrogateSwap
.
public RestClientBuilder pojoSwapsReplace(Object... values)
BeanContextBuilder
pojoSwapsReplace
in class BeanContextBuilder
values
- The values to remove from this property.
PojoSwap
.
SurrogateSwap
.
public RestClientBuilder pojoSwapsRemove(Class<?>... values)
BeanContextBuilder
pojoSwapsRemove
in class BeanContextBuilder
values
- The values to remove from this property.
PojoSwap
.
SurrogateSwap
.
public RestClientBuilder pojoSwapsRemove(Object... values)
BeanContextBuilder
pojoSwapsRemove
in class BeanContextBuilder
values
- The values to remove from this property.
PojoSwap
.
SurrogateSwap
.
public RestClientBuilder sortProperties(boolean value)
BeanContextBuilder
When
sortProperties
in class BeanContextBuilder
value
- The new value for this property.
public RestClientBuilder sortProperties()
BeanContextBuilder
Shortcut for calling sortProperties(
.
sortProperties
in class BeanContextBuilder
public RestClientBuilder timeZone(TimeZone value)
BeanContextBuilder
timeZone
in class BeanContextBuilder
value
- The new value for this property.public RestClientBuilder useEnumNames(boolean value)
BeanContextBuilder
When enabled, enums are always serialized by name instead of using Object.toString()
.
useEnumNames
in class BeanContextBuilder
value
- The property value.public RestClientBuilder useEnumNames()
BeanContextBuilder
When enabled, enums are always serialized by name instead of using Object.toString()
.
useEnumNames
in class BeanContextBuilder
public RestClientBuilder useInterfaceProxies(boolean value)
BeanContextBuilder
If InvocationHandler
if there is no other way of instantiating them.
useInterfaceProxies
in class BeanContextBuilder
value
- The new value for this property.
public RestClientBuilder useJavaBeanIntrospector(boolean value)
BeanContextBuilder
Using the built-in Java bean introspector will not pick up fields or non-standard getters/setters.
@Bean
annotations will be ignored if you enable this setting.
useJavaBeanIntrospector
in class BeanContextBuilder
value
- The new value for this property.
public RestClientBuilder useJavaBeanIntrospector()
BeanContextBuilder
Shortcut for calling useJavaBeanIntrospector(
.
useJavaBeanIntrospector
in class BeanContextBuilder
public RestClientBuilder set(String name, Object value)
ContextBuilder
set
in class BeanContextBuilder
name
- The property name.value
- The property value.PropertyStoreBuilder.set(String, Object)
public RestClientBuilder set(Map<String,Object> properties)
ContextBuilder
set
in class BeanContextBuilder
properties
- The properties to set on this class.PropertyStoreBuilder.set(java.util.Map)
public RestClientBuilder add(Map<String,Object> properties)
ContextBuilder
add
in class BeanContextBuilder
properties
- The properties to set on this class.PropertyStoreBuilder.add(java.util.Map)
public RestClientBuilder addTo(String name, Object value)
ContextBuilder
addTo
in class BeanContextBuilder
name
- The property name.value
- The new value to add to the SET property.public RestClientBuilder addTo(String name, String key, Object value)
ContextBuilder
addTo
in class BeanContextBuilder
name
- The property name.key
- The property value map key.value
- The property value map value.public RestClientBuilder removeFrom(String name, Object value)
ContextBuilder
removeFrom
in class BeanContextBuilder
name
- The property name.value
- The property value in the SET property.public RestClientBuilder apply(PropertyStore copyFrom)
ContextBuilder
apply
in class BeanContextBuilder
copyFrom
- The factory whose settings are being copied.public RestClientBuilder applyAnnotations(AnnotationList al, VarResolverSession vrs)
ContextBuilder
applyAnnotations
in class BeanContextBuilder
al
- The list of all annotations annotated with PropertyStoreApply
.vrs
- The string resolver for resolving variables in annotation values.public RestClientBuilder applyAnnotations(Class<?> fromClass)
ContextBuilder
Applies any of the following annotations:
BeanConfig
CsvConfig
HtmlConfig
HtmlDocConfig
JsoConfig
JsonConfig
JsonSchemaConfig
MsgPackConfig
OpenApiConfig
ParserConfig
PlainTextConfig
SerializerConfig
SoapXmlConfig
UonConfig
UrlEncodingConfig
XmlConfig
Annotations are appended in the following order:
applyAnnotations
in class BeanContextBuilder
fromClass
- The class on which the annotations are defined.public RestClientBuilder applyAnnotations(Method fromMethod)
ContextBuilder
Applies any of the following annotations:
BeanConfig
CsvConfig
HtmlConfig
HtmlDocConfig
JsoConfig
JsonConfig
JsonSchemaConfig
MsgPackConfig
OpenApiConfig
ParserConfig
PlainTextConfig
SerializerConfig
SoapXmlConfig
UonConfig
UrlEncodingConfig
XmlConfig
Annotations are appended in the following orders:
applyAnnotations
in class BeanContextBuilder
fromMethod
- The method on which the annotations are defined.public RestClientBuilder redirectStrategy(org.apache.http.client.RedirectStrategy redirectStrategy)
redirectStrategy
- New property value.HttpClientBuilder.setRedirectStrategy(RedirectStrategy)
public RestClientBuilder defaultCookieSpecRegistry(org.apache.http.config.Lookup<org.apache.http.cookie.CookieSpecProvider> cookieSpecRegistry)
cookieSpecRegistry
- New property value.HttpClientBuilder.setDefaultCookieSpecRegistry(Lookup)
public RestClientBuilder requestExecutor(org.apache.http.protocol.HttpRequestExecutor requestExec)
requestExec
- New property value.HttpClientBuilder.setRequestExecutor(HttpRequestExecutor)
public RestClientBuilder sslHostnameVerifier(HostnameVerifier hostnameVerifier)
hostnameVerifier
- New property value.HttpClientBuilder.setSSLHostnameVerifier(HostnameVerifier)
public RestClientBuilder publicSuffixMatcher(org.apache.http.conn.util.PublicSuffixMatcher publicSuffixMatcher)
publicSuffixMatcher
- New property value.HttpClientBuilder.setPublicSuffixMatcher(PublicSuffixMatcher)
public RestClientBuilder sslContext(SSLContext sslContext)
sslContext
- New property value.HttpClientBuilder.setSSLContext(SSLContext)
public RestClientBuilder sslSocketFactory(org.apache.http.conn.socket.LayeredConnectionSocketFactory sslSocketFactory)
sslSocketFactory
- New property value.HttpClientBuilder.setSSLSocketFactory(LayeredConnectionSocketFactory)
public RestClientBuilder maxConnTotal(int maxConnTotal)
maxConnTotal
- New property value.HttpClientBuilder.setMaxConnTotal(int)
public RestClientBuilder maxConnPerRoute(int maxConnPerRoute)
maxConnPerRoute
- New property value.HttpClientBuilder.setMaxConnPerRoute(int)
public RestClientBuilder defaultSocketConfig(org.apache.http.config.SocketConfig config)
config
- New property value.HttpClientBuilder.setDefaultSocketConfig(SocketConfig)
public RestClientBuilder defaultConnectionConfig(org.apache.http.config.ConnectionConfig config)
config
- New property value.HttpClientBuilder.setDefaultConnectionConfig(ConnectionConfig)
public RestClientBuilder connectionTimeToLive(long connTimeToLive, TimeUnit connTimeToLiveTimeUnit)
connTimeToLive
- New property value.connTimeToLiveTimeUnit
- New property value.HttpClientBuilder.setConnectionTimeToLive(long,TimeUnit)
public RestClientBuilder connectionManager(org.apache.http.conn.HttpClientConnectionManager connManager)
connManager
- New property value.HttpClientBuilder.setConnectionManager(HttpClientConnectionManager)
public RestClientBuilder connectionManagerShared(boolean shared)
shared
- New property value.HttpClientBuilder.setConnectionManagerShared(boolean)
public RestClientBuilder connectionReuseStrategy(org.apache.http.ConnectionReuseStrategy reuseStrategy)
reuseStrategy
- New property value.HttpClientBuilder.setConnectionReuseStrategy(ConnectionReuseStrategy)
public RestClientBuilder keepAliveStrategy(org.apache.http.conn.ConnectionKeepAliveStrategy keepAliveStrategy)
keepAliveStrategy
- New property value.HttpClientBuilder.setKeepAliveStrategy(ConnectionKeepAliveStrategy)
public RestClientBuilder targetAuthenticationStrategy(org.apache.http.client.AuthenticationStrategy targetAuthStrategy)
targetAuthStrategy
- New property value.HttpClientBuilder.setTargetAuthenticationStrategy(AuthenticationStrategy)
public RestClientBuilder proxyAuthenticationStrategy(org.apache.http.client.AuthenticationStrategy proxyAuthStrategy)
proxyAuthStrategy
- New property value.HttpClientBuilder.setProxyAuthenticationStrategy(AuthenticationStrategy)
public RestClientBuilder userTokenHandler(org.apache.http.client.UserTokenHandler userTokenHandler)
userTokenHandler
- New property value.HttpClientBuilder.setUserTokenHandler(UserTokenHandler)
public RestClientBuilder disableConnectionState()
HttpClientBuilder.disableConnectionState()
public RestClientBuilder schemePortResolver(org.apache.http.conn.SchemePortResolver schemePortResolver)
schemePortResolver
- New property value.HttpClientBuilder.setSchemePortResolver(SchemePortResolver)
public RestClientBuilder userAgent(String userAgent)
userAgent
- New property value.HttpClientBuilder.setUserAgent(String)
public RestClientBuilder defaultHeaders(Collection<? extends org.apache.http.Header> defaultHeaders)
defaultHeaders
- New property value.HttpClientBuilder.setDefaultHeaders(Collection)
public RestClientBuilder addInterceptorFirst(org.apache.http.HttpResponseInterceptor itcp)
itcp
- New property value.HttpClientBuilder.addInterceptorFirst(HttpResponseInterceptor)
public RestClientBuilder addInterceptorLast(org.apache.http.HttpResponseInterceptor itcp)
itcp
- New property value.HttpClientBuilder.addInterceptorLast(HttpResponseInterceptor)
public RestClientBuilder addInterceptorFirst(org.apache.http.HttpRequestInterceptor itcp)
itcp
- New property value.HttpClientBuilder.addInterceptorFirst(HttpRequestInterceptor)
public RestClientBuilder addInterceptorLast(org.apache.http.HttpRequestInterceptor itcp)
itcp
- New property value.HttpClientBuilder.addInterceptorLast(HttpRequestInterceptor)
public RestClientBuilder disableCookieManagement()
HttpClientBuilder.disableCookieManagement()
public RestClientBuilder disableContentCompression()
HttpClientBuilder.disableContentCompression()
public RestClientBuilder disableAuthCaching()
HttpClientBuilder.disableAuthCaching()
public RestClientBuilder httpProcessor(org.apache.http.protocol.HttpProcessor httpprocessor)
httpprocessor
- New property value.HttpClientBuilder.setHttpProcessor(HttpProcessor)
public RestClientBuilder retryHandler(org.apache.http.client.HttpRequestRetryHandler retryHandler)
retryHandler
- New property value.HttpClientBuilder.setRetryHandler(HttpRequestRetryHandler)
public RestClientBuilder disableAutomaticRetries()
HttpClientBuilder.disableAutomaticRetries()
public RestClientBuilder proxy(org.apache.http.HttpHost proxy)
proxy
- New property value.HttpClientBuilder.setProxy(HttpHost)
public RestClientBuilder routePlanner(org.apache.http.conn.routing.HttpRoutePlanner routePlanner)
routePlanner
- New property value.HttpClientBuilder.setRoutePlanner(HttpRoutePlanner)
public RestClientBuilder disableRedirectHandling()
HttpClientBuilder.disableRedirectHandling()
public RestClientBuilder connectionBackoffStrategy(org.apache.http.client.ConnectionBackoffStrategy connectionBackoffStrategy)
connectionBackoffStrategy
- New property value.HttpClientBuilder.setConnectionBackoffStrategy(ConnectionBackoffStrategy)
public RestClientBuilder backoffManager(org.apache.http.client.BackoffManager backoffManager)
backoffManager
- New property value.HttpClientBuilder.setBackoffManager(BackoffManager)
public RestClientBuilder serviceUnavailableRetryStrategy(org.apache.http.client.ServiceUnavailableRetryStrategy serviceUnavailStrategy)
serviceUnavailStrategy
- New property value.HttpClientBuilder.setServiceUnavailableRetryStrategy(ServiceUnavailableRetryStrategy)
public RestClientBuilder defaultCookieStore(org.apache.http.client.CookieStore cookieStore)
cookieStore
- New property value.HttpClientBuilder.setDefaultCookieStore(CookieStore)
public RestClientBuilder defaultCredentialsProvider(org.apache.http.client.CredentialsProvider credentialsProvider)
credentialsProvider
- New property value.HttpClientBuilder.setDefaultCredentialsProvider(CredentialsProvider)
public RestClientBuilder defaultAuthSchemeRegistry(org.apache.http.config.Lookup<org.apache.http.auth.AuthSchemeProvider> authSchemeRegistry)
authSchemeRegistry
- New property value.HttpClientBuilder.setDefaultAuthSchemeRegistry(Lookup)
public RestClientBuilder contentDecoderRegistry(Map<String,org.apache.http.client.entity.InputStreamFactory> contentDecoderMap)
contentDecoderMap
- New property value.HttpClientBuilder.setContentDecoderRegistry(Map)
public RestClientBuilder defaultRequestConfig(org.apache.http.client.config.RequestConfig config)
config
- New property value.HttpClientBuilder.setDefaultRequestConfig(RequestConfig)
public RestClientBuilder useSystemProperties()
HttpClientBuilder.useSystemProperties()
public RestClientBuilder evictExpiredConnections()
HttpClientBuilder.evictExpiredConnections()
public RestClientBuilder evictIdleConnections(long maxIdleTime, TimeUnit maxIdleTimeUnit)
maxIdleTime
- New property value.maxIdleTimeUnit
- New property value.HttpClientBuilder.evictIdleConnections(long,TimeUnit)
Copyright © 2016–2019 The Apache Software Foundation. All rights reserved.