All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.codemodder.CodemodFileScanningResult Maven / Gradle / Ivy

There is a newer version: 0.98.6
Show newest version
package io.codemodder;

import io.codemodder.codetf.UnfixedFinding;
import java.util.List;

/** Represents the result of scanning a file for changes. */
public interface CodemodFileScanningResult {

  /** Creates a new instance of {@link CodemodFileScanningResult} from the given values. */
  static CodemodFileScanningResult from(
      final List changes, final List unfixedFindings) {
    return new CodemodFileScanningResult() {
      @Override
      public List changes() {
        return changes;
      }

      @Override
      public List unfixedFindings() {
        return unfixedFindings;
      }
    };
  }

  /** Creates an empty instance of {@link CodemodFileScanningResult}. */
  static CodemodFileScanningResult none() {
    return from(List.of(), List.of());
  }

  /** Creates an instance of {@link CodemodFileScanningResult} with only changes. */
  static CodemodFileScanningResult withOnlyChanges(final List changes) {
    return from(changes, List.of());
  }

  /** Returns the changes that were made to the file. */
  List changes();

  /** Returns the results of the findings that were hoping to be addressed. */
  List unfixedFindings();
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy