diff options
Diffstat (limited to 'src/main/java/ftbsc/lll/proxies')
-rw-r--r-- | src/main/java/ftbsc/lll/proxies/impl/FieldProxy.java | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/main/java/ftbsc/lll/proxies/impl/FieldProxy.java b/src/main/java/ftbsc/lll/proxies/impl/FieldProxy.java index 61952b6..62525bc 100644 --- a/src/main/java/ftbsc/lll/proxies/impl/FieldProxy.java +++ b/src/main/java/ftbsc/lll/proxies/impl/FieldProxy.java @@ -7,6 +7,8 @@ import org.objectweb.asm.Type; import java.lang.reflect.Field; +import static ftbsc.lll.tools.DescriptorBuilder.nameToDescriptor; + /** * A container for information about class fields to be used * in ASM patching. @@ -87,6 +89,7 @@ public class FieldProxy extends AbstractProxy { } /** + * Sets the type of the field to the given {@link Class} object. * @param clazz the {@link Class} corresponding to the element * @return the current state of the builder */ @@ -96,6 +99,17 @@ public class FieldProxy extends AbstractProxy { } /** + * Sets the type of the field to the given type. + * @param fqn – the fully qualified name of the parameter type + * @param arrayLevel the array level + * @return the builder's state after the change + */ + public Builder setType(String fqn, int arrayLevel) { + super.setType(Type.getType(nameToDescriptor(fqn, arrayLevel))); + return this; + } + + /** * Builds a {@link FieldProxy} of the given kind. * @return the built {@link FieldProxy} */ |