Interface CtRenameRefactoring<T extends CtNamedElement>

All Superinterfaces:
CtRefactoring
All Known Implementing Classes:
AbstractRenameRefactoring, CtRenameGenericVariableRefactoring, CtRenameLocalVariableRefactoring

public interface CtRenameRefactoring<T extends CtNamedElement> extends CtRefactoring
The kind of refactoring, which renames a `target` element to the `newName`
Usage:
 CtVariable someVariable = ...
 new SomeRenameRefactoring().setTarget(someVariable).setNewName("mutchBetterName").refactor();
 
  • Method Details

    • getTarget

      T getTarget()
      Returns:
      target model element, which has to be refactored.
    • setTarget

      CtRenameRefactoring<T> setTarget(T target)
      Parameters:
      target - the model element, which has to be refactored.
      Returns:
      this to support fluent API
    • getNewName

      String getNewName()
      Returns:
      the required name of the `target` model element
    • setNewName

      CtRenameRefactoring<T> setNewName(String newName)
      Parameters:
      newName - the required name of the `target` model element
      Returns:
      this to support fluent API