io.codemodder.DependencyUpdateResult Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of codemodder-base Show documentation
Show all versions of codemodder-base Show documentation
Base framework for writing codemods in Java
package io.codemodder;
import io.codemodder.codetf.CodeTFChangesetEntry;
import java.nio.file.Path;
import java.util.List;
import java.util.Set;
/** Represents the result of a dependency update operation. */
public interface DependencyUpdateResult {
/** The list of dependencies that were successfully injected into the project. */
List injectedPackages();
/** The list of dependencies that were already available to the given file. */
List skippedPackages();
/**
* An updated model of the changed files in the project, after the dependency update operation.
* This includes the changes that were passed in, as well as any changes that were made to the
* project as a result of our updates.
*/
List packageChanges();
/** The set of files that we attempted to update, but failed. */
Set erroredFiles();
/** An update reporting no actions and no errors. */
DependencyUpdateResult EMPTY_UPDATE = create(List.of(), List.of(), List.of(), Set.of());
static DependencyUpdateResult create(
final List injectedDependencies,
final List skippedPackages,
final List updatedChanges,
final Set erroredFiles) {
return new DefaultDependencyUpdateResult(
injectedDependencies, skippedPackages, updatedChanges, erroredFiles);
}
}