public class AttributesHelper extends Object
| Modifier and Type | Method and Description |
|---|---|
static String |
addQueryString(String oldQueryString,
String key,
String value) |
static org.mule.runtime.api.util.MultiMap<String,String> |
copyImmutableMap(org.mule.runtime.api.util.MultiMap<String,String> immutableMap,
String key,
String value) |
static String |
getAcceptedResponseMediaTypes(org.mule.runtime.api.util.MultiMap<String,String> headers)
Returns "Accept" header param values as a comma separated list.
|
static String |
getCommaSeparatedParamValues(org.mule.runtime.api.util.MultiMap<String,String> parameters,
String parameterName)
Returns a comma separated list of values for the parameter that matches the name.
|
static String |
getContentType(org.mule.runtime.api.util.MultiMap<String,String> headers)
Returns "Accept" header param value.
|
static String |
getMediaType(String mediaType)
Parses the Media Type and returns it with "type/subtype" format.
|
static String |
getParamValue(org.mule.runtime.api.util.MultiMap<String,String> parameters,
String parameterName)
Returns the value for the parameter in the map that matches the name.
|
static List<String> |
getParamValues(org.mule.runtime.api.util.MultiMap<String,String> parameters,
String parameterName)
Returns the list of values for the parameter that matches the name.
|
static org.mule.extension.http.api.HttpRequestAttributes |
replaceParams(org.mule.extension.http.api.HttpRequestAttributes attributes,
org.mule.runtime.api.util.MultiMap<String,String> headers,
org.mule.runtime.api.util.MultiMap<String,String> queryParams,
String queryString,
Map<String,String> uriParams) |
public static org.mule.runtime.api.util.MultiMap<String,String> copyImmutableMap(org.mule.runtime.api.util.MultiMap<String,String> immutableMap, String key, String value)
public static org.mule.extension.http.api.HttpRequestAttributes replaceParams(org.mule.extension.http.api.HttpRequestAttributes attributes,
org.mule.runtime.api.util.MultiMap<String,String> headers,
org.mule.runtime.api.util.MultiMap<String,String> queryParams,
String queryString,
Map<String,String> uriParams)
public static String getParamValue(org.mule.runtime.api.util.MultiMap<String,String> parameters, String parameterName) throws BadRequestException
If multiple values are allowed for the parameter, consider using getParamValues(MultiMap, String) or getCommaSeparatedParamValues(MultiMap, String) instead.
parameters - Map of parameter's name-valueparameterName - Parameter namenull if parameter is not foundUnsupportedMediaTypeException - if multiple values are present for the parameterBadRequestExceptionpublic static List<String> getParamValues(org.mule.runtime.api.util.MultiMap<String,String> parameters, String parameterName)
parameters - Map of parameter's name-valueparameterName - Parameter namepublic static String getCommaSeparatedParamValues(org.mule.runtime.api.util.MultiMap<String,String> parameters, String parameterName)
parameters - Map of parameter's name-valueparameterName - Parameter namenull if parameter is not foundpublic static String getContentType(org.mule.runtime.api.util.MultiMap<String,String> headers) throws UnsupportedMediaTypeException
headers - Map of parameter's name-valueUnsupportedMediaTypeExceptionpublic static String getMediaType(String mediaType)
mediaType - Media Typepublic static String getAcceptedResponseMediaTypes(org.mule.runtime.api.util.MultiMap<String,String> headers)
headers - Map of parameter's name-valueCopyright © 2020. All rights reserved.