Class FixResultFactory


  • public final class FixResultFactory
    extends Object
    A factory for creating instances of FixResult
    Author:
    Brian Wyka
    • Method Detail

      • resolverResult

        public static FixResult resolverResult​(FileProtocol fileProtocol,
                                               com.optum.sourcehawk.enforcer.ResolverResult resolverResult,
                                               boolean dryRun)
        Create a fix result based on the file protocol and resolver result
        Parameters:
        fileProtocol - the file protocol
        resolverResult - the result of the resolver
        dryRun - whether or not this is a dry run
        Returns:
        the derived fix result
      • error

        public static FixResult error​(String repositoryPath,
                                      String message)
        Create the fix result for situations where there is an error executing the fix
        Parameters:
        repositoryPath - the repository file path
        message - the error message
        Returns:
        the fix result
      • globalError

        public static FixResult globalError​(Throwable throwable)
        Create the fix result for situations where there is an error executing the fix
        Parameters:
        throwable - the exception / error which occurred
        Returns:
        the fix result
      • noResolver

        public static FixResult noResolver​(String repositoryPath,
                                           String fileEnforcer)
        Create the fix result for situations when there is no resolver to fix the enforcer error
        Parameters:
        repositoryPath - the repository file path
        fileEnforcer - the file enforcer
        Returns:
        the fix result
      • fileNotFound

        public static FixResult fileNotFound​(FileProtocol fileProtocol)
        Generate a fix result for situations where the file is not found
        Parameters:
        fileProtocol - the file protocol
        Returns:
        the file not found fix result