Class CloseEndedAnswer

java.lang.Object
it.unimib.unimibmodules.model.CloseEndedAnswer

@Entity public class CloseEndedAnswer extends Object
Represents a closed-ended answer.
Version:
0.4.1
Author:
Davide Costantini, Lorenzo Occhipinti
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private Set<Answer>
    Answers where this close-ended answer has been selected
    private int
    The id of the close-ended answer.
    private Question
    The question to which this answer belongs.
    private String
    The text of the close-ended answer.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Creates an empty close-ended answer.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Modifies the text of the close-ended answer, setting text as the new value.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • id

      private int id
      The id of the close-ended answer.
    • text

      private String text
      The text of the close-ended answer.
    • question

      private Question question
      The question to which this answer belongs.
    • answers

      private Set<Answer> answers
      Answers where this close-ended answer has been selected
  • Constructor Details

    • CloseEndedAnswer

      public CloseEndedAnswer()
      Creates an empty close-ended answer.
  • Method Details

    • setText

      public void setText(String text) throws EmptyFieldException
      Modifies the text of the close-ended answer, setting text as the new value.
      Parameters:
      text - the new text value
      Throws:
      EmptyFieldException - if text is empty