diff --git a/src/main/java/ftbsc/lll/proxies/impl/MethodProxy.java b/src/main/java/ftbsc/lll/proxies/impl/MethodProxy.java index 3710d36..a1306f7 100644 --- a/src/main/java/ftbsc/lll/proxies/impl/MethodProxy.java +++ b/src/main/java/ftbsc/lll/proxies/impl/MethodProxy.java @@ -171,6 +171,19 @@ public class MethodProxy extends AbstractProxy { return this; } + /** + * Sets the type of the method to the given descriptor, + * and extracts return and parameter types from it. + * @param descr the descriptor + * @return the builder's state after the change + */ + public Builder setDescriptor(String descr) { + super.setDescriptor(descr); + this.parameters.addAll(Arrays.asList(Type.getArgumentTypes(descr))); + this.returnType = Type.getReturnType(descr); + return this; + } + /** * Builds a {@link MethodProxy} of the given kind. * @return the built {@link MethodProxy}