Class BaseQuestionSet

java.lang.Object
nz.org.riskscape.wizard.BaseQuestionSet
All Implemented Interfaces:
QuestionSet
Direct Known Subclasses:
DefaultQuestionSet2, EmptyQuestionSet

public abstract class BaseQuestionSet extends Object implements QuestionSet
  • Field Details

    • name

      protected final String name
    • discriminator

      protected final String discriminator
    • id

      protected final String id
    • survey

      protected final Survey survey
  • Constructor Details

    • BaseQuestionSet

      public BaseQuestionSet(String id, Survey survey)

      Construct a question set where the id is used for the i18n look up.

    • BaseQuestionSet

      public BaseQuestionSet(String name, String discriminator, Survey survey)

      Construct a question set where the name is used for the i18n look up and the id is set as the name plus an integer disriminator, e.g. {name: reports, discriminator: 2} would give an id of reports-2

  • Method Details

    • getDescription

      public Optional<String> getDescription(Locale locale)
      Description copied from interface: QuestionSet

      A human-friendly description for this QuestionSet

      Specified by:
      getDescription in interface QuestionSet
    • getTitle

      public Optional<String> getTitle(Locale locale)
      Description copied from interface: QuestionSet

      A human-friendly title for this QuestionSet

      Specified by:
      getTitle in interface QuestionSet
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • canEqual

      protected boolean canEqual(Object other)
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • getName

      public String getName()
      Specified by:
      getName in interface QuestionSet
    • getId

      public String getId()
      Specified by:
      getId in interface QuestionSet
      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
    • getSurvey

      public Survey getSurvey()
      Specified by:
      getSurvey in interface QuestionSet
      Returns:
      the survey to which this set belongs