public class URLHelper
extends java.lang.Object
Constructor and Description |
---|
URLHelper(java.lang.String protocol,
java.lang.String domainName,
java.lang.String userAgentHeaderValue) |
Modifier and Type | Method and Description |
---|---|
java.lang.String |
addDetailsParam(java.lang.String urlString,
RequestExecutor.Method method,
RequestExecutor.ContentType contentTypeFormat,
ParamsMap params)
Appends the details level query param to a given URL in case exist
|
java.lang.String |
addJsonPaginationParams(java.lang.String urlString,
RequestExecutor.Method method,
RequestExecutor.ContentType contentTypeFormat,
ParamsMap params)
Add pagination params to a given URL String for POST with application/json content type.
|
java.lang.String |
createUrl(java.lang.String details)
Creates an URL String with an protocol, a domainName and some given details
|
java.lang.String |
createUrlWithParams(java.lang.String urlString,
ParamsMap paramsMap)
Appends some params to a given URL String
NOTE: this non-static version is used in SDK Mockito tests (see MambuAPIServiceTest).
|
static java.lang.String |
makeUrlWithParams(java.lang.String urlString,
ParamsMap paramsMap)
Static helper to Append URL params to a given URL String
|
java.lang.String |
userAgentHeaderValue()
Gets the user agent header value as set once with the factory initialization
|
@Inject public URLHelper(java.lang.String protocol, java.lang.String domainName, java.lang.String userAgentHeaderValue)
public java.lang.String createUrl(java.lang.String details)
details
- the extra detailspublic java.lang.String createUrlWithParams(java.lang.String urlString, ParamsMap paramsMap)
urlString
- the already created URL StringparamsMap
- the params which must be addedpublic static java.lang.String makeUrlWithParams(java.lang.String urlString, ParamsMap paramsMap)
urlString
- the already created URL StringparamsMap
- the params which must be addedpublic java.lang.String addJsonPaginationParams(java.lang.String urlString, RequestExecutor.Method method, RequestExecutor.ContentType contentTypeFormat, ParamsMap params)
urlString
- original URL stringmethod
- methodcontentTypeFormat
- content type formatparams
- input parameters. If pagination parameters are added to the URL string then they are removed from the
original params mappublic java.lang.String addDetailsParam(java.lang.String urlString, RequestExecutor.Method method, RequestExecutor.ContentType contentTypeFormat, ParamsMap params)
urlString
- the String URL where the details level will be appendedmethod
- the HTTP method of the requestcontentTypeFormat
- the content type of the requestparams
- the params of the requestpublic java.lang.String userAgentHeaderValue()