class VnfAdapterObjectMapper {

    public Map<String, Object> createVolumeGroupParams(RequestContext requestContext, GenericVnf genericVnf,
            VolumeGroup volumeGroup, String sdncVfModuleQueryResponse)
            throws JsonParseException, JsonMappingException, IOException {
        Map<String, Object> volumeGroupParams = new HashMap<>();
        final String USER_PARAM_NAME_KEY = "name";
        final String USER_PARAM_VALUE_KEY = "value";
        // sdncVfModuleQueryResponse will not be available in aLaCarte case
        if (sdncVfModuleQueryResponse != null) {
            GenericResourceApiVfModuleTopology vfModuleTop =
                    mapper.readValue(sdncVfModuleQueryResponse, GenericResourceApiVfModuleTopology.class);
            GenericResourceApiVfmoduletopologyVfModuleTopology vfModuleTopology = vfModuleTop.getVfModuleTopology();
            buildParamsMapFromSdncParams(volumeGroupParams, vfModuleTopology.getVfModuleParameters());
        }

        if (null != requestContext.getRequestParameters()
                && null != requestContext.getRequestParameters().getUserParams()) {
            List<Map<String, Object>> userParams = requestContext.getRequestParameters().getUserParams();
            for (Map<String, Object> userParamsMap : userParams) {
                if (userParamsMap.containsKey(USER_PARAM_NAME_KEY)
                        && (userParamsMap.get(USER_PARAM_NAME_KEY) instanceof String)
                        && userParamsMap.containsKey(USER_PARAM_VALUE_KEY)
                        && (userParamsMap.get(USER_PARAM_VALUE_KEY) instanceof String)) {
                    volumeGroupParams.put((String) userParamsMap.get(USER_PARAM_NAME_KEY),
                            (String) userParamsMap.get(USER_PARAM_VALUE_KEY));
                }
            }
        }
        volumeGroupParams.put("vnf_id", genericVnf.getVnfId());
        volumeGroupParams.put("vnf_name", genericVnf.getVnfName());
        volumeGroupParams.put("vf_module_id", volumeGroup.getVolumeGroupId());
        volumeGroupParams.put("vf_module_name", volumeGroup.getVolumeGroupName());

        return volumeGroupParams;
    }

}