gr.uom.java.xmi.diff.UMLClassMoveDiff Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of refactoring-miner Show documentation
Show all versions of refactoring-miner Show documentation
RefactoringMiner is a library/API written in Java that can detect refactorings applied in the history of a Java project.
package gr.uom.java.xmi.diff;
import gr.uom.java.xmi.UMLClass;
public class UMLClassMoveDiff extends UMLClassBaseDiff {
public UMLClassMoveDiff(UMLClass originalClass, UMLClass movedClass, UMLModelDiff modelDiff) {
super(originalClass, movedClass, modelDiff);
}
public UMLClass getMovedClass() {
return nextClass;
}
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class ");
sb.append(originalClass.getName());
sb.append(" was moved to ");
sb.append(nextClass.getName());
sb.append("\n");
return sb.toString();
}
public boolean equals(Object o) {
if(this == o) {
return true;
}
if(o instanceof UMLClassMoveDiff) {
UMLClassMoveDiff classMoveDiff = (UMLClassMoveDiff)o;
return this.originalClass.equals(classMoveDiff.originalClass) && this.nextClass.equals(classMoveDiff.nextClass);
}
return false;
}
}