/** * Drop an argument from the handle at the given index, returning a new * SmartHandle. * * @param index index before which the dropped argument goes * @param newName name of the argument * @param type type of the argument * @return a new SmartHandle with the additional argument */ public SmartHandle drop(int index, String newName, Class<?> type) { return new SmartHandle(signature.insertArg(index, newName, type), MethodHandles.dropArguments(handle, index, type)); }
/** * Insert an argument into the argument list at the given index with the * given name and value. * * @param index the index at which to insert the argument * @param name the name of the new argument * @param value the value of the new argument * @return a new SmartBinder with the insert applied */ public SmartBinder insert(int index, String name, Object value) { return new SmartBinder(this, signature().insertArg(index, name, value.getClass()), binder.insert(index, value)); }
/** * Insert an argument into the argument list at the given index with the * given name and value. * * @param index the index at which to insert the argument * @param name the name of the new argument * @param value the value of the new argument * @return a new SmartBinder with the insert applied */ public SmartBinder insert(int index, String name, int value) { return new SmartBinder(this, signature().insertArg(index, name, int.class), binder.insert(index, value)); }
/** * Insert an argument into the argument list at the given index with the * given name and value. * * @param index the index at which to insert the argument * @param name the name of the new argument * @param value the value of the new argument * @return a new SmartBinder with the insert applied */ public SmartBinder insert(int index, String name, boolean value) { return new SmartBinder(this, signature().insertArg(index, name, boolean.class), binder.insert(index, value)); }
/** * Insert an argument into the argument list at the given index with the * given name and value. * * @param index the index at which to insert the argument * @param name the name of the new argument * @param value the value of the new argument * @return a new SmartBinder with the insert applied */ public SmartBinder insert(int index, String name, byte value) { return new SmartBinder(this, signature().insertArg(index, name, byte.class), binder.insert(index, value)); }
/** * Insert an argument into the argument list at the given index with the * given name and value. * * @param index the index at which to insert the argument * @param name the name of the new argument * @param value the value of the new argument * @return a new SmartBinder with the insert applied */ public SmartBinder insert(int index, String name, short value) { return new SmartBinder(this, signature().insertArg(index, name, short.class), binder.insert(index, value)); }
/** * Insert an argument into the argument list at the given index with the * given name and value. * * @param index the index at which to insert the argument * @param name the name of the new argument * @param value the value of the new argument * @return a new SmartBinder with the insert applied */ public SmartBinder insert(int index, String name, char value) { return new SmartBinder(this, signature().insertArg(index, name, char.class), binder.insert(index, value)); }
/** * Insert an argument into the argument list at the given index with the * given name and value. * * @param index the index at which to insert the argument * @param name the name of the new argument * @param value the value of the new argument * @return a new SmartBinder with the insert applied */ public SmartBinder insert(int index, String name, long value) { return new SmartBinder(this, signature().insertArg(index, name, long.class), binder.insert(index, value)); }
/** * Insert an argument into the argument list at the given index with the * given name and value. * * @param index the index at which to insert the argument * @param name the name of the new argument * @param value the value of the new argument * @return a new SmartBinder with the insert applied */ public SmartBinder insert(int index, String name, float value) { return new SmartBinder(this, signature().insertArg(index, name, float.class), binder.insert(index, value)); }
/** * Drop an argument name and type from the handle at the given index, returning a new * SmartHandle. * * @param beforeName name before which the dropped argument goes * @param newName name of the argument * @param type type of the argument * @return a new SmartHandle with the additional argument */ public SmartHandle drop(String beforeName, String newName, Class<?> type) { return new SmartHandle(signature.insertArg(beforeName, newName, type), MethodHandles.dropArguments(handle, signature.argOffset(beforeName), type)); }
/** * Insert an argument into the argument list at the given index with the * given name and value. * * @param index the index at which to insert the argument * @param name the name of the new argument * @param value the value of the new argument * @return a new SmartBinder with the insert applied */ public SmartBinder insert(int index, String name, double value) { return new SmartBinder(this, signature().insertArg(index, name, double.class), binder.insert(index, value)); }
/** * Insert an argument into the argument list at the given index with the * given name and value. * * @param index the index at which to insert the argument * @param name the name of the new argument * @param type the type to use in the new signature * @param value the value of the new argument * @return a new SmartBinder with the insert applied */ public SmartBinder insert(int index, String name, Class<?> type, Object value) { return new SmartBinder(this, signature().insertArg(index, name, type), binder.insert(index, type, value)); }
SmartHandle rewriteHandle = SmartBinder.from(lookup(), site.signature().insertArg(0, "throwable", Throwable.class)) .permute("throwable") .append("runtime", method.getImplementationClass().getRuntime())
SmartHandle rewriteHandle = SmartBinder.from(lookup(), site.signature().insertArg(0, "throwable", Throwable.class)) .permute("throwable") .append("runtime", method.getImplementationClass().getRuntime())