Class SecurityQuestion

java.lang.Object
io.goobi.viewer.model.security.SecurityQuestion

public class SecurityQuestion extends Object
Represents a security question with a message-key for the question text and a set of accepted answers, tracking whether the question has already been answered.
  • Constructor Details

    • SecurityQuestion

      public SecurityQuestion(String questionKey, Set<String> correctAnswers)
      Constructor.
      Parameters:
      questionKey - message key for the question text to display
      correctAnswers - set of accepted answer strings (case-insensitive)
  • Method Details

    • isAnswerCorrect

      public boolean isAnswerCorrect(String answer)
      Parameters:
      answer - user-provided answer to validate
      Returns:
      true if given answer is among correct answers; false otherwise
    • getQuestionKey

      public String getQuestionKey()
    • getCorrectAnswers

      public Set<String> getCorrectAnswers()
    • isAnswered

      public boolean isAnswered()