Interface QuestionSet

All Known Implementing Classes:
BaseQuestionSet, DefaultQuestionSet2, EmptyQuestionSet

public interface QuestionSet

A QuestionSet is a part of a Survey that groups together some questions that can apply a functionally similar set of changes to a PipelineDeclaration. The QuestionSet 'drives' the survey by offering Questions to the user and then plugging the answers in to update the PipelineDeclaration, via the IncrementalBuildState

  • Field Details

  • Method Details

    • getId

      String getId()
      Returns:
      a String that uniquely identifies this QuestionSet TODO this might become a name and end up being a weak identifier, as the name is probably only unique within the context of a survey
    • getTitle

      Optional<String> getTitle(Locale locale)

      A human-friendly title for this QuestionSet

    • getDescription

      Optional<String> getDescription(Locale locale)

      A human-friendly description for this QuestionSet

    • getPipelineChange

      PipelineChange getPipelineChange(IncrementalBuildState buildState, Answer answer)

      Returns a PipelineChange that is created by applying an answer a build state.

      Parameters:
      buildState - the build state to get a change to.
      answer - the answer to apply. This answer must be for a question that came back from #getNextQuestions(IncrementalBuildState) using the given build state, or weird things might happen
    • getSurvey

      Survey getSurvey()
      Returns:
      the survey to which this set belongs
    • getQuestions

      default List<Question> getQuestions()

      The list of questions that this question set contains.

      These questions should be partially ordered such that if question b comes after question a then they should be ordered so that a is before b in the list.

      Previously, there was potential for this list to change as the build state changed, and so this method was removed from the QuestionSet interface. But this possibility is being dropped with the new survey2 api in favour of a static list of questions per set, but allowing a dynamic set of question sets.

    • getName

      default String getName()