package be.cytomine.client.abst;
import be.cytomine.client.*;
import java.util.*;
import org.json.simple.*;
import java.util.Date;
import java.util.List;
import be.cytomine.client.Search;
import be.cytomine.client.Server;
import org.json.simple.JSONObject;
/**
* Response for search request
*
* @author ClientBuilder (Loïc Rollus)
* @version 0.1
*
* DO NOT EDIT THIS FILE. THIS IS CODE IS BUILD AUTOMATICALY. ALL CHANGE WILL BE LOST AFTER NEXT GENERATION.
*
* IF YOU WANT TO EDIT A DOMAIN FILE (change method, add property,...), JUST EDIT THE CHILD FILE “YourDomain.java” instead of this file “AbstractYourDomain.java”. I WON'T BE CLEAR IF IT ALREADY EXIST.
*
*/
public abstract class AbstractSearch
extends AbstractDomain
{
/**
* Domain class
*
*/
protected String clazz;
/**
* Domain creation timestamp
*
*/
protected Date created;
/**
* Domain description text
*
*/
protected String description;
/**
* Domain id
*
*/
protected Long id;
/**
* Image (storing the domain) name. If domain is project, then null
*
*/
protected String imageName;
/**
* Domain name
*
*/
protected String name;
/**
* Project (storing the domain) name
*
*/
protected String projectName;
/**
* URL to get JSON data on the current domain
*
*/
protected String urlApi;
/**
* URL to go to the domain on the webapp (GUI)
*
*/
protected String urlGoTo;
/**
* Domain thumb (if annotation: crop, if image: thumb, if project: null)
*
*/
protected List urlImage;
/**
* Domain creator
*
*/
protected Long user;
/**
* Domain creator name (Lastname Firstname)
*
*/
protected String userfullname;
public void build()
throws Exception
{
}
public void build(JSONObject json)
throws Exception
{
this.clazz =JSONUtils.extractJSONString(json.get("class"));
this.created =JSONUtils.extractJSONDate(json.get("created"));
this.description =JSONUtils.extractJSONString(json.get("description"));
this.id =JSONUtils.extractJSONLong(json.get("id"));
this.imageName =JSONUtils.extractJSONString(json.get("imageName"));
this.name =JSONUtils.extractJSONString(json.get("name"));
this.projectName =JSONUtils.extractJSONString(json.get("projectName"));
this.urlApi =JSONUtils.extractJSONString(json.get("urlApi"));
this.urlGoTo =JSONUtils.extractJSONString(json.get("urlGoTo"));
this.urlImage =JSONUtils.extractJSONList(json.get("urlImage"));
this.user =JSONUtils.extractJSONLong(json.get("user"));
this.userfullname =JSONUtils.extractJSONString(json.get("userfullname"));
}
public JSONObject toJSON()
throws Exception
{
JSONObject json=new JSONObject();
return json;
}
public static Search listResponse(Server server, List keywords, String operator, String filter, String projects)
throws Exception
{
throw new Exception("Not yet implemented");
}
}