package edu.nju.entities; import org.springframework.data.annotation.Id; import org.springframework.data.mongodb.core.mapping.Document; import java.util.ArrayList; import java.util.List; @Document public class Answer implements java.io.Serializable{ private static final long serialVersionUID = -8263451883506704407L; @Id private String id; private String item_id; private List answers; private String worker_id; private String job_id; private List attachment_location; public Answer(String item_id, List answers, String worker_id, List attachment_location,String job_id) { this.item_id = item_id; this.answers = answers; this.worker_id = worker_id; this.attachment_location = attachment_location; this.job_id=job_id; } public Answer(String item_id,String worker_id,String job_id,int optionNum){ this.item_id = item_id; this.worker_id = worker_id; this.attachment_location = new ArrayList<>(); this.job_id=job_id; this.answers=new ArrayList<>(); for(int i=0;i getAnswers() { return answers; } public void setAnswers(List answers) { this.answers = answers; } public String getWorker_id() { return worker_id; } public void setWorker_id(String worker_id) { this.worker_id = worker_id; } public List getAttachment_location() { return attachment_location; } public void setAttachment_location(List attachment_location) { this.attachment_location = attachment_location; } public String getJob_id() { return job_id; } public void setJob_id(String job_id) { this.job_id = job_id; } }