Package dev.dokimos.core.evaluators
Class ExactMatchEvaluator.Builder
java.lang.Object
dev.dokimos.core.evaluators.ExactMatchEvaluator.Builder
- Enclosing class:
ExactMatchEvaluator
Builder for
ExactMatchEvaluator.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()Builds the evaluator.evaluationParams(List<EvalTestCaseParam> params) Sets which test case parameters to use for the evaluation.ignoreCase(boolean ignoreCase) Sets whether the comparison ignores letter case.Sets the evaluator name.threshold(double threshold) Sets the minimum score threshold for success.trimWhitespace(boolean trimWhitespace) Sets whether leading and trailing whitespace is removed from both the actual and expected outputs before comparing them usingString.strip().
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
name
Sets the evaluator name.- Parameters:
name- the evaluator name- Returns:
- this builder
-
evaluationParams
Sets which test case parameters to use for the evaluation.- Parameters:
params- the parameters to use for the evaluation- Returns:
- this builder
-
threshold
Sets the minimum score threshold for success.- Parameters:
threshold- the threshold value- Returns:
- this builder
-
trimWhitespace
Sets whether leading and trailing whitespace is removed from both the actual and expected outputs before comparing them usingString.strip(). Whitespace inside the strings is preserved. Defaults tofalse.- Parameters:
trimWhitespace-trueto trim both outputs before comparison- Returns:
- this builder
-
ignoreCase
Sets whether the comparison ignores letter case. Defaults tofalse.- Parameters:
ignoreCase-trueto compare the outputs case-insensitively- Returns:
- this builder
-
build
Builds the evaluator.- Returns:
- a new
ExactMatchEvaluator
-