|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.linkedin.restli.internal.common.QueryParamsDataMap
public class QueryParamsDataMap
A utility class for parsing query parameters map into a DataMap. Complex objects are represented by dot-delimited and possibly indexed parameter names. * @author adubman
| Method Summary | |
|---|---|
static void |
addSortedParams(com.linkedin.jersey.api.uri.UriBuilder uriBuilder,
com.linkedin.data.DataMap params)
Same as above, but taking a DataMap representation of query parameters |
static void |
addSortedParams(com.linkedin.jersey.api.uri.UriBuilder uriBuilder,
java.util.Map<java.lang.String,java.util.List<java.lang.String>> params)
Helper method to add the provided query params multimap to the provided UriBuilder, sorting both keys and values within the list for each key. |
static java.lang.String |
dataMapToQueryString(com.linkedin.data.DataMap dataMap,
URLEscaper.Escaping escaping)
Helper method to convert a DataMap into a string by concatenating key-value pairs with "&", sorted by both key and value. |
static ComplexResourceKey<?,?> |
fixUpComplexKeySingletonArray(ComplexResourceKey<?,?> complexResourceKey)
Because of backwards compatibility concerns, array fields of the key component of a ComplexResourceKeys in a get request will be represented in the request url in the old
style. |
static com.linkedin.data.DataMap |
parseDataMapKeys(java.util.Map<java.lang.String,java.util.List<java.lang.String>> queryParameters)
Parse a multi-map representing query parameters into a DataMap, as follows. |
static java.util.Map<java.lang.String,java.util.List<java.lang.String>> |
queryString(com.linkedin.data.DataMap dataMap)
Create a map of query string parameters (name, value) from the provided DataMap, in the same manner as parseDataMapKeys() below created a DataMap from a map of query parameters. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static java.lang.String dataMapToQueryString(com.linkedin.data.DataMap dataMap,
URLEscaper.Escaping escaping)
public static java.util.Map<java.lang.String,java.util.List<java.lang.String>> queryString(com.linkedin.data.DataMap dataMap)
dataMap - a dataMap
public static com.linkedin.data.DataMap parseDataMapKeys(java.util.Map<java.lang.String,java.util.List<java.lang.String>> queryParameters)
throws PathSegment.PathSegmentSyntaxException
queryParameters - the query parameters
PathSegment.PathSegmentSyntaxException
public static void addSortedParams(com.linkedin.jersey.api.uri.UriBuilder uriBuilder,
java.util.Map<java.lang.String,java.util.List<java.lang.String>> params)
uriBuilder - params -
public static void addSortedParams(com.linkedin.jersey.api.uri.UriBuilder uriBuilder,
com.linkedin.data.DataMap params)
uriBuilder - params - public static ComplexResourceKey<?,?> fixUpComplexKeySingletonArray(ComplexResourceKey<?,?> complexResourceKey)
ComplexResourceKeys in a get request will be represented in the request url in the old
style. That is, if an array field has the name "a", and contains [1,2] the part of the url
representing the serialized array will look like "a=1&a=2". However, if the array is a
singleton it will just be represented by "a=1". Therefore it is not possible to distinguish
between a single value itself and an array containing a single value.
The purpose of this function is to fix up the singleton array problem by checking to see whether the given
ComplexKey's key part has an array component, and, if so and the data for that field is NOT a dataList,
placing the data into a dataList.
complexResourceKey - The complex key to be fixed.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||