package be.cytomine.client.abst; import be.cytomine.client.*; import java.util.*; import org.json.simple.*; import java.util.Date; import org.json.simple.JSONObject; /** * Term added to an annotation by a job. Annotation can be: -algo annotation (create by a job) or -user annotation (create by a real user) * * @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 AbstractAlgoAnnotationTerm extends AbstractDomain { /** * The full class name of the domain * */ protected String clazz; /** * The domain id * */ protected Long id; /** * The date of the domain creation * */ protected Date created; /** * The date of the domain modification * */ protected Date updated; /** * When domain was removed from Cytomine * */ protected Date deleted; /** * The annotation id * */ protected Long annotationIdent; /** * The annotation class type (user or algo) * */ protected String annotationClassName; /** * Undefined * */ protected Object annotation; /** * The term id * */ protected Long term; /** * The real term id, the term added by the user previously * */ protected Long expectedTerm; /** * The reliability of the prediction * */ protected Double rate; /** * The user job id * */ protected Long user; /** * The project id * */ protected Long project; /** * * @return * The full class name of the domain */ public String getClazz() throws Exception { return clazz; } /** * * @return * The domain id */ public Long getId() throws Exception { return id; } /** * * @return * The date of the domain creation */ public Date getCreated() throws Exception { return created; } /** * * @return * The date of the domain modification */ public Date getUpdated() throws Exception { return updated; } /** * * @return * When domain was removed from Cytomine */ public Date getDeleted() throws Exception { return deleted; } /** * * @return * The annotation id */ public Long getAnnotationIdent() throws Exception { return annotationIdent; } /** * * @param annotationIdent * The annotation id */ public void setAnnotationIdent(Long annotationIdent) throws Exception { this.annotationIdent = annotationIdent; } /** * * @return * The annotation class type (user or algo) */ public String getAnnotationClassName() throws Exception { return annotationClassName; } /** * * @param annotationClassName * The annotation class type (user or algo) */ public void setAnnotationClassName(String annotationClassName) throws Exception { this.annotationClassName = annotationClassName; } /** * * @return * Undefined */ public Object getAnnotation() throws Exception { return annotation; } /** * * @param annotation * Undefined */ public void setAnnotation(Object annotation) throws Exception { this.annotation = annotation; } /** * * @return * The term id */ public Long getTerm() throws Exception { return term; } /** * * @param term * The term id */ public void setTerm(Long term) throws Exception { this.term = term; } /** * * @return * The real term id, the term added by the user previously */ public Long getExpectedTerm() throws Exception { return expectedTerm; } /** * * @param expectedTerm * The real term id, the term added by the user previously */ public void setExpectedTerm(Long expectedTerm) throws Exception { this.expectedTerm = expectedTerm; } /** * * @return * The reliability of the prediction */ public Double getRate() throws Exception { return rate; } /** * * @param rate * The reliability of the prediction */ public void setRate(Double rate) throws Exception { this.rate = rate; } /** * * @return * The user job id */ public Long getUser() throws Exception { return user; } /** * * @param user * The user job id */ public void setUser(Long user) throws Exception { this.user = user; } /** * * @return * The project id */ public Long getProject() throws Exception { return project; } /** * * @param project * The project id */ public void setProject(Long project) throws Exception { this.project = project; } public void build(Long annotationIdent, String annotationClassName, Long term, Long expectedTerm, Double rate, Long user, Long project) throws Exception { this.annotationIdent=annotationIdent; this.annotationClassName=annotationClassName; this.term=term; this.expectedTerm=expectedTerm; this.rate=rate; this.user=user; this.project=project; } public void build(JSONObject json) throws Exception { this.clazz =JSONUtils.extractJSONString(json.get("class")); this.id =JSONUtils.extractJSONLong(json.get("id")); this.created =JSONUtils.extractJSONDate(json.get("created")); this.updated =JSONUtils.extractJSONDate(json.get("updated")); this.deleted =JSONUtils.extractJSONDate(json.get("deleted")); this.annotationIdent =JSONUtils.extractJSONLong(json.get("annotationIdent")); this.annotationClassName =JSONUtils.extractJSONString(json.get("annotationClassName")); this.annotation =JSONUtils.extractJSONObject(json.get("annotation")); this.term =JSONUtils.extractJSONLong(json.get("term")); this.expectedTerm =JSONUtils.extractJSONLong(json.get("expectedTerm")); this.rate =JSONUtils.extractJSONDouble(json.get("rate")); this.user =JSONUtils.extractJSONLong(json.get("user")); this.project =JSONUtils.extractJSONLong(json.get("project")); } public JSONObject toJSON() throws Exception { JSONObject json=new JSONObject(); json.put("class",JSONUtils.formatJSON(this.clazz)); json.put("id",JSONUtils.formatJSON(this.id)); json.put("created",JSONUtils.formatJSON(this.created)); json.put("updated",JSONUtils.formatJSON(this.updated)); json.put("deleted",JSONUtils.formatJSON(this.deleted)); json.put("annotationIdent",JSONUtils.formatJSON(this.annotationIdent)); json.put("annotationClassName",JSONUtils.formatJSON(this.annotationClassName)); json.put("annotation",JSONUtils.formatJSON(this.annotation)); json.put("term",JSONUtils.formatJSON(this.term)); json.put("expectedTerm",JSONUtils.formatJSON(this.expectedTerm)); json.put("rate",JSONUtils.formatJSON(this.rate)); json.put("user",JSONUtils.formatJSON(this.user)); json.put("project",JSONUtils.formatJSON(this.project)); return json; } }