package com.bq.oss.corbel.resources.rem.util;

import java.util.Optional;

import javax.ws.rs.core.MultivaluedMap;

import com.bq.oss.corbel.resources.rem.request.*;
import com.bq.oss.lib.queries.request.Pagination;

public class ImageRemUtil {

    public RequestParameters<CollectionParameters> getCollectionParametersWithPrefix(String prefix,
            RequestParameters<ResourceParameters> requestParameters) {

        MultivaluedMap<String, String> newParameters = requestParameters.getParams();
        newParameters.putSingle("prefix", "cachedImage." + prefix);

        return new RequestParametersImpl<>(new CollectionParametersImpl(new Pagination(1, 10), Optional.empty(), Optional.empty(),
                Optional.empty(), Optional.empty(), Optional.empty()), requestParameters.getTokenInfo(),
                requestParameters.getAcceptedMediaTypes(), requestParameters.getContentLength(), newParameters,
                requestParameters.getHeaders());

    }

}

@@ -64,24 +64,68 @@
 .Optional;%0A%0A
+import javax.ws.rs.core.MultivaluedHashMap;%0A
 import javax
@@ -510,16 +510,55 @@
 eters = 
+new MultivaluedHashMap%3CString, String%3E(
 requestP
@@ -578,16 +578,17 @@
 Params()
+)
 ;%0A      

Resolve bug with immutable map in rem-image.