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

org.labkey.remoteapi.SimpleGetCommand Maven / Gradle / Ivy

Go to download

The client-side library for Java developers is a separate JAR from the LabKey Server code base. It can be used by any Java program, including another Java web application.

There is a newer version: 6.2.0
Show newest version
package org.labkey.remoteapi;

import java.util.HashMap;
import java.util.Map;
import java.util.function.Supplier;

public class SimpleGetCommand extends GetCommand
{
    private Supplier> _parameterMapFactory = HashMap::new;

    public SimpleGetCommand(String controllerName, String actionName)
    {
        super(controllerName, actionName);
    }

    /**
     * Returns a new, mutable parameter map initialized with the values from the map passed to
     * {@link #setParameters(Map)} method, if any.
     * @return The parameter map to use when building the URL.
     */
    @Override
    protected Map createParameterMap()
    {
        return _parameterMapFactory.get();
    }

    /**
     * Sets the URL parameter map.
     * @param parameters The values to use when initializing the parameter map
     */
    public void setParameters(Map parameters)
    {
        _parameterMapFactory = new Supplier<>()
        {
            private final Map _parameters = new HashMap<>(parameters);

            @Override
            public Map get()
            {
                return new HashMap<>(_parameters);
            }
        };
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy