org.alfasoftware.astra.example.ExampleUseCase Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of astra-example Show documentation
Show all versions of astra-example Show documentation
Astra is a Java tool for analysing and refactoring Java source code. This module contains example uses.
package org.alfasoftware.astra.example;
import java.util.Arrays;
import java.util.HashSet;
import java.util.Set;
import org.alfasoftware.astra.core.matchers.MethodMatcher;
import org.alfasoftware.astra.core.refactoring.UseCase;
import org.alfasoftware.astra.core.refactoring.operations.methods.MethodInvocationRefactor;
import org.alfasoftware.astra.core.utils.ASTOperation;
public class ExampleUseCase implements UseCase {
@Override
public Set getOperations() {
return new HashSet<>(
Arrays.asList(
MethodInvocationRefactor
.from(
MethodMatcher.builder()
.withFullyQualifiedDeclaringType("org.alfasoftware.astra.example.target.FooBarInterface")
.withMethodName("doFoo")
.build())
.to(
new MethodInvocationRefactor.Changes().toNewMethodName("doBar"))
)
);
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy