T - the type of the data that is expected from the REST endpoint.public class RestSourceBuilder<T>
extends java.lang.Object
RestSource.| Modifier and Type | Field and Description |
|---|---|
protected RestSource<T> |
restSource |
| Modifier | Constructor and Description |
|---|---|
protected |
RestSourceBuilder() |
| Modifier and Type | Method and Description |
|---|---|
RestSource |
build()
Create the RestSource based on all parameters supplied on this
RestSource Builder
|
RestSourceBuilder |
consumerKey(java.lang.String consumerKey)
Set the consumer key for this request.
|
RestSourceBuilder |
consumerSecret(java.lang.String consumerSecret)
Set the consumer secret for this request.
|
RestSourceBuilder |
contentType(java.lang.String contentType)
Set the contentType for this request.
|
RestSourceBuilder |
converter(InputStreamConverter<T> converter)
Set the converter that will convert the raw data into object(s) of type T.
|
static <T> RestSourceBuilder |
create()
Create a RestSourceBuilder in order to create a
RestSource |
RestSourceBuilder |
dataString(java.lang.String dataString)
Explicitly set the datastring for this request.
|
RestSourceBuilder |
formParam(java.lang.String key,
java.lang.String value)
Add a specific form parameter
|
RestSourceBuilder |
host(java.lang.String host)
Set the host parameter for this endpoint.
|
RestSourceBuilder |
path(java.lang.String p)
Add a path element to the path that ultimately will point to the
endpoint.
|
RestSourceBuilder |
queryParam(java.lang.String key,
java.lang.String value)
Add a specific query parameter
|
RestSourceBuilder |
requestMethod(java.lang.String requestMethod)
Set the request method for this request as a
String (e.g. |
RestSourceBuilder |
timeout(int timeout)
Set the timeout value for this instance.
|
protected RestSource<T> restSource
public static <T> RestSourceBuilder create()
RestSourceT - the type of the data that is expected from the REST endpoint.public RestSourceBuilder converter(InputStreamConverter<T> converter)
converter - the Converter that will be used to convert raw
data into object(s) of type Tpublic RestSourceBuilder path(java.lang.String p)
p - the path elementpublic RestSourceBuilder requestMethod(java.lang.String requestMethod)
String (e.g. "POST", "GET")requestMethod - the requestMethod to setpublic RestSourceBuilder queryParam(java.lang.String key, java.lang.String value)
key - the key for the query parametervalue - the value for the query parameterpublic RestSourceBuilder formParam(java.lang.String key, java.lang.String value)
key - the key for the form parametervalue - the value for the form parameterpublic RestSourceBuilder dataString(java.lang.String dataString)
dataString - the dataString to setpublic RestSourceBuilder consumerKey(java.lang.String consumerKey)
consumerKey - the consumerKey to setpublic RestSourceBuilder consumerSecret(java.lang.String consumerSecret)
consumerSecret - the consumer secret to setpublic RestSourceBuilder contentType(java.lang.String contentType)
contentType - the contentType to setpublic RestSourceBuilder host(java.lang.String host)
host - the host parameter for this endpoint.public RestSourceBuilder timeout(int timeout)
timeout - the timeout valuepublic RestSource build()
RestSource