Class QuestionEntityImpl

java.lang.Object
com.flowable.questionnaire.service.impl.entity.QuestionEntityImpl
All Implemented Interfaces:
Question, QuestionEntity

public class QuestionEntityImpl
extends java.lang.Object
implements QuestionEntity
Author:
Filip Hrisafov
  • Field Summary

    Fields 
    Modifier and Type Field Description
    protected java.util.List<Answer> answers  
    protected java.lang.String content  
    protected java.lang.String id  
    protected java.util.Map<java.lang.String,​java.lang.Object> parameters  
    protected Answer selectedAnswer  
    protected java.lang.String type  
  • Constructor Summary

    Constructors 
    Constructor Description
    QuestionEntityImpl()  
  • Method Summary

    Modifier and Type Method Description
    void addParameter​(java.lang.String parameterName, java.lang.Object parameter)  
    java.util.List<Answer> getAnswers()
    Returns a list of possible answers for this question in the exact order they should be rendered.
    java.lang.String getContent()
    The optional content of the question.
    java.lang.String getId()
    Returns the unique id of this question.
    java.util.Map<java.lang.String,​java.lang.Object> getParameters()
    The parameters that were used when answering the question.
    Answer getSelectedAnswer()
    Optionally returns the selected answer, if this question was answered already.
    java.lang.String getType()
    Returns the type (typically an enumeration) of the question.
    void setAnswers​(java.util.List<Answer> answers)  
    void setContent​(java.lang.String content)  
    void setId​(java.lang.String id)  
    void setParameters​(java.util.Map<java.lang.String,​java.lang.Object> parameters)  
    void setSelectedAnswer​(Answer selectedAnswer)  
    void setType​(java.lang.String type)  

    Methods inherited from class java.lang.Object

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

    • id

      protected java.lang.String id
    • type

      protected java.lang.String type
    • content

      protected java.lang.String content
    • parameters

      protected java.util.Map<java.lang.String,​java.lang.Object> parameters
    • answers

      protected java.util.List<Answer> answers
    • selectedAnswer

      protected Answer selectedAnswer
  • Constructor Details

  • Method Details

    • getId

      public java.lang.String getId()
      Description copied from interface: Question
      Returns the unique id of this question.
      Specified by:
      getId in interface Question
      Returns:
      the id of the question
    • setId

      public void setId​(java.lang.String id)
      Specified by:
      setId in interface QuestionEntity
    • getType

      public java.lang.String getType()
      Description copied from interface: Question
      Returns the type (typically an enumeration) of the question.
      Specified by:
      getType in interface Question
      Returns:
      the type of this question
    • setType

      public void setType​(java.lang.String type)
      Specified by:
      setType in interface QuestionEntity
    • getContent

      public java.lang.String getContent()
      Description copied from interface: Question
      The optional content of the question.
      Specified by:
      getContent in interface Question
      Returns:
      the optional content of the question object, might be null
    • setContent

      public void setContent​(java.lang.String content)
      Specified by:
      setContent in interface QuestionEntity
    • getParameters

      public java.util.Map<java.lang.String,​java.lang.Object> getParameters()
      Description copied from interface: Question
      The parameters that were used when answering the question.
      Specified by:
      getParameters in interface Question
      Returns:
      the optional parameters for the question, might be empty or even null
    • setParameters

      public void setParameters​(java.util.Map<java.lang.String,​java.lang.Object> parameters)
      Specified by:
      setParameters in interface QuestionEntity
    • addParameter

      public void addParameter​(java.lang.String parameterName, java.lang.Object parameter)
      Specified by:
      addParameter in interface QuestionEntity
    • getAnswers

      public java.util.List<Answer> getAnswers()
      Description copied from interface: Question
      Returns a list of possible answers for this question in the exact order they should be rendered.
      Specified by:
      getAnswers in interface Question
      Returns:
      the list of possible answers
    • setAnswers

      public void setAnswers​(java.util.List<Answer> answers)
      Specified by:
      setAnswers in interface QuestionEntity
    • getSelectedAnswer

      public Answer getSelectedAnswer()
      Description copied from interface: Question
      Optionally returns the selected answer, if this question was answered already.
      Specified by:
      getSelectedAnswer in interface Question
      Returns:
      the selected answer, if this question was answered, null otherwise
    • setSelectedAnswer

      public void setSelectedAnswer​(Answer selectedAnswer)
      Specified by:
      setSelectedAnswer in interface QuestionEntity