All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.sigopt.net.ParamsBuilder Maven / Gradle / Ivy

There is a newer version: 6.3.0
Show newest version
package com.sigopt.net;

import com.sigopt.model.APIObject;

import java.util.Collection;
import java.util.HashMap;
import java.util.Map;

class ParamsBuilder {
    public static Map build(Map params) {
        Map ret = new HashMap();
        params = MapHelper.ensure(params);
        for (Map.Entry entry: params.entrySet()) {
            if (entry.getValue() == null) { continue; }
            if (entry.getValue() instanceof APIObject) {
                ret.put(entry.getKey(), APIObject.toJson(entry.getValue()));
            } else {
                ret.put(entry.getKey(), entry.getValue().toString());
            }
        }
        return ret;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy