Package net.starype.quiz.api.game.answer
Interface AnswerProcessor
-
- All Known Implementing Classes:
CleanSeparatorProcessor,CleanStringProcessor,IdentityProcessor,RemoveSpecialCharProcessor,TrueFalseProcessor
public interface AnswerProcessorThe first step of the answer evaluation pipeline. Answer processors modify input answers to properly format them, if possible. For further information, seeAnswerEvaluator.- See Also:
AnswerEvaluator
-
-
Method Summary
Modifier and Type Method Description default AnswerProcessorcombine(AnswerProcessor processor)Combine the current processor with another one.default Answerprocess(java.lang.String str)Wrap the string into anAnswerobject and process it.Answerprocess(Answer answer)Modify the entry and store the result in a newAnswerobject.
-
-
-
Method Detail
-
process
Answer process(Answer answer)
Modify the entry and store the result in a newAnswerobject.- Parameters:
answer- the given entry- Returns:
- a new
Answerobject storing the computed result
-
process
default Answer process(java.lang.String str)
Wrap the string into anAnswerobject and process it.- Parameters:
str- the given string- Returns:
- a new
Answerobject storing the computed result - See Also:
process(Answer)
-
combine
default AnswerProcessor combine(AnswerProcessor processor)
Combine the current processor with another one.
Example:a.combine(b)will result in a processor that first processes throughb, then througha- Parameters:
processor- the other processor to combine with the current one- Returns:
- a new processor that corresponds to function composition of
thisandprocessor
-
-