Package net.starype.quiz.api.game.answer
Interface AnswerProcessor
-
- All Known Implementing Classes:
CleanSeparatorProcessor
,CleanStringProcessor
,IdentityProcessor
,RemoveSpecialCharProcessor
,TrueFalseProcessor
public interface AnswerProcessor
The 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 AnswerProcessor
combine(AnswerProcessor processor)
Combine the current processor with another one.default Answer
process(java.lang.String str)
Wrap the string into anAnswer
object and process it.Answer
process(Answer answer)
Modify the entry and store the result in a newAnswer
object.
-
-
-
Method Detail
-
process
Answer process(Answer answer)
Modify the entry and store the result in a newAnswer
object.- Parameters:
answer
- the given entry- Returns:
- a new
Answer
object storing the computed result
-
process
default Answer process(java.lang.String str)
Wrap the string into anAnswer
object and process it.- Parameters:
str
- the given string- Returns:
- a new
Answer
object 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
this
andprocessor
-
-