I'd like to change the imports of a class so that they point to a different package. Byte Buddy docs don't give much info on how one can achieve this. This is what I have so far:
public class ProxyPlugin implements net.bytebuddy.build.Plugin { public DynamicType.Builder apply(DynamicType.Builder builder, TypeDescription typeDescription) { return builder.name(typeDescription.getPackage().getName() + ".proxy." + typeDescription.getSimpleName()); } public boolean matches(TypeDescription typeDefinitions) { return true; } }
My goal is to change some package prefix names so that they have ".proxy" appended to them. Note that I only need to change method signatures since the targets are interfaces.