/** * Creates a method signature, with the given raw string that contains the * method name and descriptor concatenated. * * @param nameAndDescriptor The method name and descriptor * @return The new method signature */ public static MethodSignature of(final String nameAndDescriptor) { int methodIndex = nameAndDescriptor.indexOf('('); return of(nameAndDescriptor.substring(0, methodIndex), nameAndDescriptor.substring(methodIndex)); }
/** * Gets, or creates should it not exist, a method mapping of the * given obfuscated name, and descriptor. * * @param obfuscatedName The obfuscated name of the method mapping * @param obfuscatedDescriptor The obfuscated descriptor of the method mapping * @return The method mapping */ default MethodMapping getOrCreateMethodMapping(final String obfuscatedName, final String obfuscatedDescriptor) { return this.getOrCreateMethodMapping(MethodSignature.of(obfuscatedName, obfuscatedDescriptor)); }
/** * Creates a new method mapping, attached to this class mapping, using * the given obfuscated method name and descriptor. * * @param obfuscatedName The obfuscated method name * @param obfuscatedDescriptor The obfuscated method descriptor * @return The method mapping */ default MethodMapping createMethodMapping(final String obfuscatedName, final String obfuscatedDescriptor) { return this.createMethodMapping(MethodSignature.of(obfuscatedName, obfuscatedDescriptor)); }