public class UncheckedApiCommandBuilder<T,B extends UncheckedApiCommandBuilder> extends Object
| Constructor and Description |
|---|
UncheckedApiCommandBuilder(HttpMethodBuilder.MethodBuilder<?> methodBuilder,
URI uri,
Status responseStatus,
com.fasterxml.jackson.core.type.TypeReference<X> responseType) |
| Modifier and Type | Method and Description |
|---|---|
B |
accept(String mediaType)
Sets the value of the
Accept HTTP header. |
String |
content()
Executes the current command and returns the
HttpResponse entity
content as String. |
<X> X |
execute()
Executes the current command and maps the
HttpResponse entity to
T specified by ApiCommand.responseType. |
<X> ApiCommand<X> |
getCommand() |
B |
header(String name,
String value)
Sets a request header or removes it if
value equals null. |
B |
placeHolder(Boolean placeHolder) |
B |
queryParam(QueryParamValue qpv)
Sets a query parameter or removes it if the
value equals
null. |
B |
queryParam(String name,
List<String> value)
Sets a multi-valued query parameter or removes it if
value equals
null. |
B |
queryParam(String name,
String value)
Sets a query parameter or removes it if
value equals null
. |
B |
queryParamList(String name,
List<String> values)
Sets a multi-valued query parameter or removes it if
value equals
null. |
B |
queryParamList(String name,
String... values)
Sets a multi-valued query parameter or removes it if
value equals
null. |
B |
queryParams(Map<String,String> params)
Sets the provided query parametes.
|
org.apache.http.HttpResponse |
request()
Executes the current command and returns the native
HttpResponse. |
InputStream |
stream()
Executes the current command and returns the
HttpResponse content
InputStream. |
public UncheckedApiCommandBuilder(HttpMethodBuilder.MethodBuilder<?> methodBuilder, URI uri, Status responseStatus, com.fasterxml.jackson.core.type.TypeReference<X> responseType)
methodBuilder - the HttpMethodBuilder.MethodBuilder used for creating the
requesturi - the URI holding the absolute URLresponseStatus - the expected response StatusresponseType - the native type to which the HttpResponse will be
mapped topublic B queryParam(String name, String value)
value equals null
.name - the query parameter namevalue - the query parameter valueB instancepublic B queryParam(QueryParamValue qpv)
value equals
null.qpv - the name and the value of the query parameter.B instancepublic B queryParam(String name, List<String> value)
value equals
null.name - parameter namevalue - parameter values or nullB instancepublic B queryParamList(String name, List<String> values)
value equals
null.name - parameter namevalues - parameter values or nullB instancepublic B queryParamList(String name, String... values)
value equals
null.name - parameter namevalues - parameter values or nullB instancepublic B queryParams(Map<String,String> params)
params - a map name/value entriesB instancequeryParam(String, String)public B header(String name, String value)
value equals null.name - request header namevalue - the request header valueB instancepublic B accept(String mediaType)
Accept HTTP header.mediaType - a valid media type for the Accept HTTP headerB instancepublic <X> X execute()
throws EvrythngException
HttpResponse entity to
T specified by ApiCommand.responseType.HttpResponse entity mapped to TEvrythngExceptionApiCommand.execute()public String content() throws EvrythngException
HttpResponse entity
content as String.HttpResponse entity content as StringEvrythngExceptionApiCommand.content()public org.apache.http.HttpResponse request()
throws EvrythngException
HttpResponse.HttpResponse resulting from the requestEvrythngExceptionApiCommand.request()public InputStream stream() throws EvrythngException
HttpResponse content
InputStream.InputStream of the HttpResponseEvrythngExceptionApiCommand.stream()public <X> ApiCommand<X> getCommand()
ApiCommand instanceCopyright © 2016 EVRYTHNG Ltd London / Zurich. All rights reserved.