Package it.unimib.unimibmodules.model
Class Answer
java.lang.Object
it.unimib.unimibmodules.model.Answer
Represents an open-ended answer.
- Version:
- 0.4.1
- Author:
- Davide Costantini
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate Set<CloseEndedAnswer>The list of close-ended answers related to this answer.private intThe id of the answer.private QuestionThe question to which this answer belongs.private SurveyThe survey to which this answer belongs.private StringThe text of the answer.private UserThe user who created the answer. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidsetCloseEndedAnswers(Set<CloseEndedAnswer> closeEndedAnswers) voidModifies the text of the answer, settingtextas the new value.
-
Field Details
-
id
private int idThe id of the answer. -
text
The text of the answer. -
user
The user who created the answer. -
survey
The survey to which this answer belongs. -
question
The question to which this answer belongs. -
closeEndedAnswers
The list of close-ended answers related to this answer.
-
-
Constructor Details
-
Answer
public Answer()Creates an empty answer.
-
-
Method Details
-
setText
Modifies the text of the answer, settingtextas the new value.- Parameters:
text- the new text value- Throws:
EmptyFieldException- if the answer is empty
-
setCloseEndedAnswers
public void setCloseEndedAnswers(Set<CloseEndedAnswer> closeEndedAnswers) throws EmptyFieldException, IncorrectSizeException
-