public abstract class BaseProfitBricksRequestBinder<T> extends Object implements MapBinder
Modifier and Type | Field and Description |
---|---|
protected com.google.common.base.Supplier<URI> |
endpointSupplier |
protected Json |
jsonBinder |
protected String |
paramName |
protected Map<String,Object> |
requestBuilder |
Modifier | Constructor and Description |
---|---|
protected |
BaseProfitBricksRequestBinder(String paramName,
Json jsonBinder,
com.google.common.base.Supplier<URI> endpointSupplier) |
Modifier and Type | Method and Description |
---|---|
<R extends HttpRequest> |
bindToRequest(R request,
Map<String,Object> postParams)
creates and binds the POST payload to the request using parameters specified.
|
<R extends HttpRequest> |
bindToRequest(R request,
Object input) |
protected abstract String |
createPayload(T payload) |
protected <R extends HttpRequest> |
createRequest(R fromRequest,
String payload) |
protected static String |
formatIfNotEmpty(String pattern,
Object param) |
protected <R extends HttpRequest> |
genRequest(String path,
R fromRequest) |
protected static String |
nullableToString(Object object) |
protected void |
putIfPresent(Map<String,Object> list,
String key,
Object value) |
protected final com.google.common.base.Supplier<URI> endpointSupplier
protected final String paramName
protected final Json jsonBinder
public <R extends HttpRequest> R bindToRequest(R request, Map<String,Object> postParams)
MapBinder
bindToRequest
in interface MapBinder
PayloadParam
public <R extends HttpRequest> R bindToRequest(R request, Object input)
bindToRequest
in interface Binder
protected <R extends HttpRequest> R createRequest(R fromRequest, String payload)
protected <R extends HttpRequest> R genRequest(String path, R fromRequest)
Copyright © 2009-2018 The Apache Software Foundation. All Rights Reserved.