package be.cytomine.client.abst;
import be.cytomine.client.*;
import java.util.*;
import org.json.simple.*;
import be.cytomine.client.ImageFilter;
import be.cytomine.client.Server;
import org.json.simple.JSONObject;
/**
* An image filter applies image operations (Binary, Eosin,...)
*
* @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 AbstractImageFilter
extends AbstractDomain
{
/**
* The domain id
*
*/
protected Long id;
/**
* The filter name
*
*/
protected String name;
/**
* The URL of the processing server
*
*/
protected String processingServer;
/**
* The URL path of the filter on the processing server
*
*/
protected String baseUrl;
/**
*
* @return
* The domain id
*/
public Long getId()
throws Exception
{
return id;
}
/**
*
* @return
* The filter name
*/
public String getName()
throws Exception
{
return name;
}
/**
*
* @return
* The URL of the processing server
*/
public String getProcessingServer()
throws Exception
{
return processingServer;
}
/**
*
* @return
* The URL path of the filter on the processing server
*/
public String getBaseUrl()
throws Exception
{
return baseUrl;
}
public void build()
throws Exception
{
}
public void build(JSONObject json)
throws Exception
{
this.id =JSONUtils.extractJSONLong(json.get("id"));
this.name =JSONUtils.extractJSONString(json.get("name"));
this.processingServer =JSONUtils.extractJSONString(json.get("processingServer"));
this.baseUrl =JSONUtils.extractJSONString(json.get("baseUrl"));
}
public JSONObject toJSON()
throws Exception
{
JSONObject json=new JSONObject();
json.put("id",JSONUtils.formatJSON(this.id));
json.put("name",JSONUtils.formatJSON(this.name));
json.put("processingServer",JSONUtils.formatJSON(this.processingServer));
json.put("baseUrl",JSONUtils.formatJSON(this.baseUrl));
return json;
}
public static ImageFilter get(Server server, Long id)
throws Exception
{
String path = "/api/project/imagefilter/{id}.json?";
path = path.replace("{id}",id+"");
JSONObject json = server.doGET(path);
ImageFilter domain = new ImageFilter();
domain.build(json);
return domain;
}
public static ImageFilter list(Server server, Integer max, Integer offset)
throws Exception
{
throw new Exception("Not yet implemented");
}
}