Package org.revapi

Class 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
    • 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 to fakeSuccess(), 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