Package io.codemodder

Class CodemodChange

java.lang.Object
io.codemodder.CodemodChange

public final class CodemodChange extends Object
Represents a change made to the code.
  • Method Details

    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • lineNumber

      public int lineNumber()
      The line number associated with the change. Doesn't necessarily mean the line where it starts, ends, or was discovered, but should be deterministic on consecutive runs.
    • getParameters

      public List<io.codemodder.codetf.CodeTFParameter> getParameters()
      A list of the codemod parameters that are involved in this change.
    • getDependenciesNeeded

      public List<DependencyGAV> getDependenciesNeeded()
      A list of the dependencies that are required to be added to the project in order to support this change.
    • getDescription

      public Optional<String> getDescription()
      A description of the change that is being made. If not provided, the default description will be used.
    • getFixedFindings

      public List<io.codemodder.codetf.FixedFinding> getFixedFindings()
      The fixed finding that was addressed by this change.
    • from

      public static CodemodChange from(int line, List<DependencyGAV> dependenciesNeeded)
      Builds a weave.
    • from

      public static CodemodChange from(int line, DependencyGAV dependencyNeeded)
      A CodemodChange convenience builder for weaves that only requires one new dependency. Equivalent to calling: CodemodChange.from(line, code, List.of(dependencyNeeded))
    • from

      public static CodemodChange from(int line)
      A CodemodChange convenience builder for weaves that don't require a new dependency. Equivalent to calling: CodemodChange.from(line, code, List.of())
    • from

      public static CodemodChange from(int line, io.codemodder.codetf.FixedFinding finding)
    • from

      public static CodemodChange from(int line, List<DependencyGAV> dependencyGAVS, io.codemodder.codetf.FixedFinding finding)
    • from

      public static CodemodChange from(int line, String description, io.codemodder.codetf.FixedFinding finding)
    • from

      public static CodemodChange from(int line, String description, List<io.codemodder.codetf.FixedFinding> findings)
    • from

      public static CodemodChange from(int line, Parameter parameter, String valueUsed)
    • from

      public static CodemodChange from(int line, String description)
    • toString

      public String toString()
      Overrides:
      toString in class Object