gr.uom.java.xmi.diff.CandidateSplitMethodRefactoring 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 java.util.LinkedHashSet;
import java.util.Set;
import gr.uom.java.xmi.VariableDeclarationContainer;
import gr.uom.java.xmi.decomposition.UMLOperationBodyMapper;
public class CandidateSplitMethodRefactoring {
private Set splitMethods = new LinkedHashSet<>();
private Set mappers = new LinkedHashSet<>();
private VariableDeclarationContainer originalMethodBeforeSplit;
public Set getSplitMethods() {
return splitMethods;
}
public void addSplitMethod(VariableDeclarationContainer method) {
splitMethods.add(method);
}
public Set getMappers() {
return mappers;
}
public void addMapper(UMLOperationBodyMapper mapper) {
mappers.add(mapper);
}
public VariableDeclarationContainer getOriginalMethodBeforeSplit() {
return originalMethodBeforeSplit;
}
public void setOriginalMethodBeforeSplit(VariableDeclarationContainer method) {
this.originalMethodBeforeSplit = method;
}
public boolean equals(CandidateSplitMethodRefactoring candidate) {
return this.splitMethods.containsAll(candidate.splitMethods) &&
candidate.splitMethods.containsAll(this.splitMethods) &&
this.originalMethodBeforeSplit.equals(candidate.originalMethodBeforeSplit);
}
}