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

org.labkey.remoteapi.assay.GetProtocolCommand 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.assay;

import org.json.JSONObject;
import org.labkey.remoteapi.Command;

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

public class GetProtocolCommand extends Command
{
    private String _providerName;
    private Long _protocolId;
    private Boolean _copy;

    public GetProtocolCommand(String providerName)
    {
        super("assay", "getProtocol");
        _providerName = providerName;
    }

    public GetProtocolCommand(long protocolId)
    {
        super("assay", "getProtocol");
        _protocolId = protocolId;
    }

    public GetProtocolCommand(long protocolId, boolean copy)
    {
        super("assay", "getProtocol");
        _protocolId = protocolId;
        _copy = copy;
    }

    @Override
    public Map getParameters()
    {
        Map params = new HashMap<>();
        if (_protocolId != null)
        {
            params.put("protocolId", _protocolId);
            params.put("copy", _copy);
        }
        else if (_providerName != null)
        {
            params.put("providerName", _providerName);
        }
        return params;
    }

    @Override
    protected ProtocolResponse createResponse(String text, int status, String contentType, JSONObject json)
    {
        return new ProtocolResponse(text, status, contentType, json, this);
    }

    public String getProviderName()
    {
        return _providerName;
    }

    public void setProviderName(String providerName)
    {
        _providerName = providerName;
    }

    public Long getProtocolId()
    {
        return _protocolId;
    }

    public void setProtocolId(long protocolId)
    {
        _protocolId = protocolId;
    }

    public Boolean getCopy()
    {
        return _copy;
    }

    public void setCopy(Boolean copy)
    {
        _copy = copy;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy