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 java.util.Map; import org.json.simple.JSONObject; /** * Response for annotation search * * @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 AbstractAnnotationListing extends AbstractDomain { /** * (If params showTerm=true) the annotationterms list id * */ protected List annotationTerms; /** * (If params showGis=true) the area size of the annotation * */ protected Double area; /** * (If params showGis=true) the area unit (pixels²=1,micron²=3) * */ protected Integer areaUnit; /** * Annotation class name * */ protected String clazz; /** * (If params showMeta=true) project annotation id * */ protected Long container; /** * (If params showMeta=true) number of comments on this annotation * */ protected Long countComments; /** * (If params showMeta=true and reviewed=false) the number of reviewed annotation from this annotation * */ protected Integer countReviewedAnnotations; /** * (If params showMeta=true) annotation create date * */ protected Date created; /** * (If params showUser=true) the username of the creator * */ protected String creator; /** * (If params showMeta=true) URL to get the crop annotation (image view that frame the annotation) * */ protected String cropURL; /** * (If params showUser=true) the firstname of the creator * */ protected String firstname; /** * (If params showMeta=true) Geometry compression rate used to simplify * */ protected Double geometryCompression; /** * Annotation id * */ protected Long id; /** * (If params showAlgo=true) the expected term (real term add by user previously) * */ protected Long idExpectedTerm; /** * (If params showAlgo=true) the predicted term for the annotation * */ protected Long idTerm; /** * (If params showMeta=true), image annotation id) * */ protected Long image; /** * (If params showMeta=true) URL to go to the image on the webapp * */ protected String imageURL; /** * (If params showUser=true) the lastname of the creator * */ protected String lastname; /** * (If params showImage=true) the image filename * */ protected String originalfilename; /** * (If params showMeta=true, only for reviewed) the annotation parent of the reviewed annotation * */ protected Long parentIdent; /** * (If params showGis=true) the perimeter size of the annotation * */ protected Double perimeter; /** * (If params showGis=true) the perimeter unit (pixels=0,mm=2,) * */ protected Double perimeterUnit; /** * (If params showMeta=true) project annotation id * */ protected Long project; /** * (If params showTerm=true) the reliability of the prediction * */ protected Double rate; /** * (If params showGis=true) the user id thatreview * */ protected Long reviewUser; /** * (If params showMeta=true) annotation is reviewed * */ protected Integer reviewed; /** * (If params showMeta=true) URL to get the small crop annotation (image view that frame the annotation) * */ protected String smallCropURL; /** * (If params showTerm=true) the term list id * */ protected List term; /** * (If params showMeta=true) annotation update date * */ protected Date updated; /** * (If params showMeta=true) URL to go to the annotation on the webapp * */ protected String url; /** * (If params showMeta=true) user id that create annotation (if reveiwed annotation, user that create the annotation that has been validated) * */ protected Long user; /** * (If params showTerm=true) the user id group by term id * */ protected Map userTerm; /** * (If params showWKT=true) the full polygon form in WKT * */ protected String wkt; /** * (If params showGis=true) the annotation centroid x * */ protected Double x; /** * (If params showGis=true) the annotation centroid y * */ protected Double y; public void build() throws Exception { } public void build(JSONObject json) throws Exception { this.annotationTerms =JSONUtils.extractJSONList(json.get("annotationTerms")); this.area =JSONUtils.extractJSONDouble(json.get("area")); this.areaUnit =JSONUtils.extractJSONInteger(json.get("areaUnit")); this.clazz =JSONUtils.extractJSONString(json.get("class")); this.container =JSONUtils.extractJSONLong(json.get("container")); this.countComments =JSONUtils.extractJSONLong(json.get("countComments")); this.countReviewedAnnotations =JSONUtils.extractJSONInteger(json.get("countReviewedAnnotations")); this.created =JSONUtils.extractJSONDate(json.get("created")); this.creator =JSONUtils.extractJSONString(json.get("creator")); this.cropURL =JSONUtils.extractJSONString(json.get("cropURL")); this.firstname =JSONUtils.extractJSONString(json.get("firstname")); this.geometryCompression =JSONUtils.extractJSONDouble(json.get("geometryCompression")); this.id =JSONUtils.extractJSONLong(json.get("id")); this.idExpectedTerm =JSONUtils.extractJSONLong(json.get("idExpectedTerm")); this.idTerm =JSONUtils.extractJSONLong(json.get("idTerm")); this.image =JSONUtils.extractJSONLong(json.get("image")); this.imageURL =JSONUtils.extractJSONString(json.get("imageURL")); this.lastname =JSONUtils.extractJSONString(json.get("lastname")); this.originalfilename =JSONUtils.extractJSONString(json.get("originalfilename")); this.parentIdent =JSONUtils.extractJSONLong(json.get("parentIdent")); this.perimeter =JSONUtils.extractJSONDouble(json.get("perimeter")); this.perimeterUnit =JSONUtils.extractJSONDouble(json.get("perimeterUnit")); this.project =JSONUtils.extractJSONLong(json.get("project")); this.rate =JSONUtils.extractJSONDouble(json.get("rate")); this.reviewUser =JSONUtils.extractJSONLong(json.get("reviewUser")); this.reviewed =JSONUtils.extractJSONInteger(json.get("reviewed")); this.smallCropURL =JSONUtils.extractJSONString(json.get("smallCropURL")); this.term =JSONUtils.extractJSONList(json.get("term")); this.updated =JSONUtils.extractJSONDate(json.get("updated")); this.url =JSONUtils.extractJSONString(json.get("url")); this.user =JSONUtils.extractJSONLong(json.get("user")); this.userTerm =JSONUtils.extractJSONMap(json.get("userTerm")); this.wkt =JSONUtils.extractJSONString(json.get("wkt")); this.x =JSONUtils.extractJSONDouble(json.get("x")); this.y =JSONUtils.extractJSONDouble(json.get("y")); } public JSONObject toJSON() throws Exception { JSONObject json=new JSONObject(); return json; } }