Class ImmutableSolutionErrorModel
java.lang.Object
dev.zemco.codegame.presentation.solution.errors.ImmutableSolutionErrorModel
- All Implemented Interfaces:
ISolutionErrorModel
Immutable implementation holding details about an error in user's solution
to a
problem.- Author:
- Erik Zemčík
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns the description of the error.Returns the zero-based line position within the solution code associated with the error.
-
Constructor Details
-
ImmutableSolutionErrorModel
- Parameters:
description- description of the errorlinePosition- zero-based line position associated with the error, may benull- Throws:
IllegalArgumentException- ifdescriptionisnullor iflinePositionis notnulland is not a positive integer
-
-
Method Details
-
getDescription
Description copied from interface:ISolutionErrorModelReturns the description of the error.- Specified by:
getDescriptionin interfaceISolutionErrorModel- Returns:
- description of the error
-
getLinePosition
Description copied from interface:ISolutionErrorModelReturns the zero-based line position within the solution code associated with the error. This method may return an emptyoptionalwhen no line position is available.- Specified by:
getLinePositionin interfaceISolutionErrorModel- Returns:
- zero-based line position
-