@Override public int hashCode() { return ((127 * BINDING_MECHANIC.hashCode()) ^ BindingMechanic.UNIQUE.hashCode()) + ((127 * VALUE.hashCode()) ^ parameterIndex); }
@Override public String toString() { return "@" + Argument.class.getName() + "(bindingMechanic=" + BindingMechanic.UNIQUE.toString() + ", value=" + parameterIndex + ")"; } }
/** * {@inheritDoc} */ public MethodDelegationBinder.ParameterBinding<?> bind(AnnotationDescription.Loadable<Argument> annotation, MethodDescription source, ParameterDescription target, Implementation.Target implementationTarget, Assigner assigner, Assigner.Typing typing) { Argument argument = annotation.loadSilent(); if (argument.value() < 0) { throw new IllegalArgumentException("@Argument annotation on " + target + " specifies negative index"); } else if (source.getParameters().size() <= argument.value()) { return MethodDelegationBinder.ParameterBinding.Illegal.INSTANCE; } return argument.bindingMechanic().makeBinding(source.getParameters().get(argument.value()).getType(), target.getType(), argument.value(), assigner, typing, source.getParameters().get(argument.value()).getOffset()); } }