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

org.labkey.remoteapi.domain.CreateDomainCommand 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.domain;

import org.json.JSONObject;

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

/**
 * Command class for creating a new domain.
 * 

* The domain definition can be customized by modifying the {@link Domain} returned by {@link #getDomainDesign()}. */ public class CreateDomainCommand extends AbstractDomainUpdateCommand { private String _kind; private Map _options = new HashMap<>(); /** * Initialize command to create a domain of the specified "kind". Available domain kinds depends on the modules * installed on the target server. * @param kind the "kind" of domain to create (e.g. "IntList", "DataClass") * @param domainName name for the created domain */ public CreateDomainCommand(String kind, String domainName) { super("property", "createDomain"); _kind = kind; getDomainDesign().setName(domainName); } @Override public JSONObject getJsonObject() { JSONObject result = super.getJsonObject(); result.put("kind", _kind); result.put("options", _options); return result; } /** * @return the "kind" of domain to be created */ public String getKind() { return _kind; } /** * Set the "kind" of the domain to be created. * @param kind the "kind" of domain to create (e.g. "IntList", "DataClass") */ public void setKind(String kind) { _kind = kind; } /** * Get the 'options' map for the domain to be created. * @return domain options */ public Map getOptions() { return _options; } /** * Set options for the domain to be created. Recognized options vary based on the domain kind specified. * @param options domain options */ public void setOptions(Map options) { _options = options; } }





© 2015 - 2024 Weber Informatics LLC | Privacy Policy