public class

RestClientBuilder

extends Object
java.lang.Object
   ↳ com.microstrategy.webapi.restApi.RestClientBuilder
Known Direct Subclasses

Class Overview

Builder pattern for creating a RestClient

Summary

Fields
protected String body
protected Integer connectTimeout
protected Map<String, List<String>> headers
protected boolean isTLSEnabled
protected String mediaType
protected MethodTypes methodTypes
protected Integer readTimeout
protected SimpleResponseWrapper responseWrapper
protected String url
Public Constructors
RestClientBuilder()
Public Methods
RestClientBuilder addheader(String key, String value)
adds individual header key-value
RestClientBuilder body(String body)
RestClient build()
RestClientBuilder connectTimeout(int connectTimeout)
Set http connect timeout
RestClientBuilder headers(Map<String, List<String>> headers)
RestClientBuilder mediaType(MediaTypes mediaType)
Set media type using Enum
RestClientBuilder mediaType(String mediaType)
Set media type using String value
RestClientBuilder methodTypes(MethodTypes methodTypes)
RestClientBuilder readTimeout(int readTimeout)
Set http read timeout
RestClientBuilder responseWrapper(SimpleResponseWrapper responseWrapper)
Caller can provide its own implementation of SimpleResponseWrapper
String toString()
RestClientBuilder url(String url)
[Expand]
Inherited Methods
From class java.lang.Object

Fields

protected String body

protected Integer connectTimeout

protected Map<String, List<String>> headers

protected boolean isTLSEnabled

protected String mediaType

protected MethodTypes methodTypes

protected Integer readTimeout

protected SimpleResponseWrapper responseWrapper

protected String url

Public Constructors

public RestClientBuilder ()

Public Methods

public RestClientBuilder addheader (String key, String value)

adds individual header key-value

public RestClientBuilder body (String body)

public RestClient build ()

public RestClientBuilder connectTimeout (int connectTimeout)

Set http connect timeout

public RestClientBuilder headers (Map<String, List<String>> headers)

public RestClientBuilder mediaType (MediaTypes mediaType)

Set media type using Enum

public RestClientBuilder mediaType (String mediaType)

Set media type using String value

Parameters
mediaType Any valid "accept" header value

public RestClientBuilder methodTypes (MethodTypes methodTypes)

public RestClientBuilder readTimeout (int readTimeout)

Set http read timeout

public RestClientBuilder responseWrapper (SimpleResponseWrapper responseWrapper)

Caller can provide its own implementation of SimpleResponseWrapper

public String toString ()

public RestClientBuilder url (String url)