Package org.revapi
Class AnalysisResult
- java.lang.Object
-
- org.revapi.AnalysisResult
-
- All Implemented Interfaces:
AutoCloseable
public final class AnalysisResult extends Object implements AutoCloseable
Holds the result of the analysis. The outputs of the analysis are generated by the reporters the Revapi instance is configured with and as such are not directly accessible through this object.To properly close the resource acquired by the extensions during the analysis, one has to
close()
this analysis results object.- Since:
- 0.8.0
- Author:
- Lukas Krejci
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
AnalysisResult.ExtensionInstance<I>
static class
AnalysisResult.Extensions
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
static AnalysisResult
fakeFailure(Exception failure)
Similar tofakeSuccess()
, this returns a failed analysis result without the need to run any analysis.static AnalysisResult
fakeSuccess()
A factory method for users that need to report success without actually running any analysis.AnalysisResult.Extensions
getExtensions()
Exception
getFailure()
boolean
isSuccess()
void
throwIfFailed()
-
-
-
Method Detail
-
fakeSuccess
public static AnalysisResult fakeSuccess()
A factory method for users that need to report success without actually running any analysis. The returned result will be successful, but will not contain the actual configurations of extensions.- Returns:
- a "fake" successful analysis result
-
fakeFailure
public static AnalysisResult fakeFailure(Exception failure)
Similar tofakeSuccess()
, this returns a failed analysis result without the need to run any analysis.- Parameters:
failure
- the failure to report- Returns:
- a "fake" failed analysis result
-
isSuccess
public boolean isSuccess()
-
getFailure
@Nullable public Exception getFailure()
- Returns:
- the error thrown during the analysis or null if the analysis completed without failures
-
getExtensions
public AnalysisResult.Extensions getExtensions()
- Returns:
- the extension instances run during the analysis, each with its corresponding analysis context containing the configuration used for the extension
-
close
public void close() throws Exception
- Specified by:
close
in interfaceAutoCloseable
- Throws:
Exception
-
-