Package org.apache.solr.handler.api
Class V2ApiUtils
- java.lang.Object
-
- org.apache.solr.handler.api.V2ApiUtils
-
public class V2ApiUtils extends Object
Utilities helpful for common V2 API declaration tasks.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voidflattenMapWithPrefix(Map<String,Object> toFlatten, Map<String,Object> destination, String additionalPrefix)static voidflattenToCommaDelimitedString(Map<String,Object> destination, List<String> toFlatten, String newKey)static StringgetMediaTypeFromWtParam(org.apache.solr.common.params.SolrParams params, String defaultMediaType)static booleanisEnabled()static voidsquashIntoNamedList(org.apache.solr.common.util.NamedList<Object> destination, Object mw)static voidsquashIntoNamedListWithoutHeader(org.apache.solr.common.util.NamedList<Object> destination, Object toSquash)static voidsquashIntoSolrResponseWithHeader(SolrQueryResponse rsp, Object mw)Convert a JacksonReflectMapWriter (typically aSolrJerseyResponse) into the NamedList on a SolrQueryResponse, including the response headerstatic voidsquashIntoSolrResponseWithoutHeader(SolrQueryResponse rsp, Object mw)Convert a JacksonReflectMapWriter (typically aSolrJerseyResponse) into the NamedList on a SolrQueryResponse, omitting the response headerstatic voidsquashObjectIntoNamedList(org.apache.solr.common.util.NamedList<Object> destination, Object o, boolean trimHeader)
-
-
-
Method Detail
-
isEnabled
public static boolean isEnabled()
-
flattenMapWithPrefix
public static void flattenMapWithPrefix(Map<String,Object> toFlatten, Map<String,Object> destination, String additionalPrefix)
-
flattenToCommaDelimitedString
public static void flattenToCommaDelimitedString(Map<String,Object> destination, List<String> toFlatten, String newKey)
-
squashIntoSolrResponseWithoutHeader
public static void squashIntoSolrResponseWithoutHeader(SolrQueryResponse rsp, Object mw)
Convert a JacksonReflectMapWriter (typically aSolrJerseyResponse) into the NamedList on a SolrQueryResponse, omitting the response header- Parameters:
rsp- the response to attach the resulting NamedList tomw- the input object to be converted into a NamedList
-
squashIntoSolrResponseWithHeader
public static void squashIntoSolrResponseWithHeader(SolrQueryResponse rsp, Object mw)
Convert a JacksonReflectMapWriter (typically aSolrJerseyResponse) into the NamedList on a SolrQueryResponse, including the response header- Parameters:
rsp- the response to attach the resulting NamedList tomw- the input object to be converted into a NamedList
-
squashIntoNamedList
public static void squashIntoNamedList(org.apache.solr.common.util.NamedList<Object> destination, Object mw)
-
squashIntoNamedListWithoutHeader
public static void squashIntoNamedListWithoutHeader(org.apache.solr.common.util.NamedList<Object> destination, Object toSquash)
-
getMediaTypeFromWtParam
public static String getMediaTypeFromWtParam(org.apache.solr.common.params.SolrParams params, String defaultMediaType)
-
-