Class EventQuestionServiceImpl

java.lang.Object
ch.tocco.nice2.optional.event.impl.actions.EventQuestionServiceImpl
All Implemented Interfaces:
EventQuestionService

@Component public class EventQuestionServiceImpl extends Object implements EventQuestionService
  • Constructor Details

  • Method Details

    • getQuestionAnswer

      public Optional<Entity> getQuestionAnswer(Entity registration, Entity eventQuestion)
      Description copied from interface: EventQuestionService
      Returns an Event_question_answer for the passed registration and Event_question if existing. Otherwise an com.google.common.base.Absent<T> will be returned.
      Specified by:
      getQuestionAnswer in interface EventQuestionService
    • updateOrCreateTextQuestion

      public void updateOrCreateTextQuestion(Entity eventQuestion, Entity registration, String answer)
      Description copied from interface: EventQuestionService
      Updates or creates an Event_question_answer for the passed Registration and Event_question and sets the value of the field answer with the passed String. The type of the question has either to be text_single_line or text_multi_line. Otherwise this method won't do anything. If there is no Event_question_answer available for the passed Registration and Event_question a new one will be created.
      Specified by:
      updateOrCreateTextQuestion in interface EventQuestionService
    • updateOrCreateChoiceQuestion

      public void updateOrCreateChoiceQuestion(Entity eventQuestion, Entity registration, EntityList answers)
      Description copied from interface: EventQuestionService
      Updates or creates an Event_question_answer for the passed Registration and Event_question and adds the passed Registration_answer_options to it. the type of the question has either to be single_choice or multiple_choice. Otherwise this method won't do anything. If there is no Event_question_answer available for the passed Registration and Event_question a new one will be created. If the type of the passed Event_question is single_choice and the passed EntityList has more than one entries, only the first entry will be added.
      Specified by:
      updateOrCreateChoiceQuestion in interface EventQuestionService