Package dev.zemco.codegame.problems
Class ProblemCase
java.lang.Object
dev.zemco.codegame.problems.ProblemCase
Problem case describes a test case of a
problem, which is used to validate player solution.
Each problem consists of inputs, expected outputs,
and memory settings.
Problem cases are immutable, and may be deserialized from JSON thanks to bindings from Jackson library.
- Author:
- Erik Zemčík
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionProblemCase(List<Integer> inputs, List<Integer> expectedOutputs, ProblemCaseMemorySettings memorySettings) Creates an instance ofProblemCase. -
Method Summary
Modifier and TypeMethodDescriptionReturns outputs that are expected from player's solution during validation.Returns inputs that are available to player's solution during validation.Returnsmemory settingswhich are used to configure memory during validation.
-
Constructor Details
-
ProblemCase
public ProblemCase(List<Integer> inputs, List<Integer> expectedOutputs, ProblemCaseMemorySettings memorySettings) Creates an instance ofProblemCase.- Parameters:
inputs-listof inputs used during validationexpectedOutputs-listof outputs expected during validationmemorySettings- memory settings used during validation- Throws:
IllegalArgumentException- ifexpectedOutputsare null or empty, ifmemorySettingsare null
-
-
Method Details
-
getInputs
Returns inputs that are available to player's solution during validation.- Returns:
- unmodifiable
listof inputs
-
getExpectedOutputs
Returns outputs that are expected from player's solution during validation.- Returns:
- unmodifiable
listof expected outputs
-
getMemorySettings
Returnsmemory settingswhich are used to configure memory during validation.- Returns:
- memory settings
-