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 int
The id of the answer.private Question
The question to which this answer belongs.private Survey
The survey to which this answer belongs.private String
The text of the answer.private User
The user who created the answer. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
setCloseEndedAnswers
(Set<CloseEndedAnswer> closeEndedAnswers) void
Modifies the text of the answer, settingtext
as 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, settingtext
as 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
-