Package com.tonic.analysis.verifier
Class ErrorCollector.FailFastCollector
- java.lang.Object
-
- com.tonic.analysis.verifier.ErrorCollector.FailFastCollector
-
- All Implemented Interfaces:
ErrorCollector
- Enclosing interface:
- ErrorCollector
public static final class ErrorCollector.FailFastCollector extends Object implements ErrorCollector
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface com.tonic.analysis.verifier.ErrorCollector
ErrorCollector.CollectAllCollector, ErrorCollector.FailFastCollector
-
-
Constructor Summary
Constructors Constructor Description FailFastCollector()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddError(VerificationError error)Keeps the error only when no error has been recorded yet.voidaddWarning(VerificationError warning)Records a warning; warnings are never dropped and never stop verification.List<VerificationError>getErrors()List<VerificationError>getWarnings()booleanhasErrors()booleanhasWarnings()voidreset()Forgets the first error and every warning.booleanshouldStop()-
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.tonic.analysis.verifier.ErrorCollector
add
-
-
-
-
Method Detail
-
addError
public void addError(VerificationError error)
Keeps the error only when no error has been recorded yet.- Specified by:
addErrorin interfaceErrorCollector- Parameters:
error- the error to record
-
addWarning
public void addWarning(VerificationError warning)
Records a warning; warnings are never dropped and never stop verification.- Specified by:
addWarningin interfaceErrorCollector- Parameters:
warning- the warning to record
-
getErrors
public List<VerificationError> getErrors()
- Specified by:
getErrorsin interfaceErrorCollector- Returns:
- the first error as a single-element list, or an empty list
-
getWarnings
public List<VerificationError> getWarnings()
- Specified by:
getWarningsin interfaceErrorCollector- Returns:
- the recorded warnings, unmodifiable
-
hasErrors
public boolean hasErrors()
- Specified by:
hasErrorsin interfaceErrorCollector- Returns:
- true when an error has been recorded
-
hasWarnings
public boolean hasWarnings()
- Specified by:
hasWarningsin interfaceErrorCollector- Returns:
- true when at least one warning has been recorded
-
shouldStop
public boolean shouldStop()
- Specified by:
shouldStopin interfaceErrorCollector- Returns:
- true once an error has been recorded
-
reset
public void reset()
Forgets the first error and every warning.- Specified by:
resetin interfaceErrorCollector
-
-