/** * Returns a new {@link InvocationValue} representing a call to the * specified local method with the specified arguments. * * @param method the local method to invoke * @param args the arguments to pass to it * @return the created invocation */ static InvocationValue ofInvocation(String method, Value<?>... args) { final InvocationValue result = new InvocationValueImpl() .setValue(method); Stream.of(args).forEachOrdered(result::add); return result; }
/** * Returns a new {@link InvocationValue} representing a call to the * specified static method in the specified class with the specified * arguments. * * @param owner the class where the static method is located * @param method the static method to invoke * @param args the arguments to pass to it * @return the created invocation */ static InvocationValue ofInvocation(Type owner, String method, Value<?>... args) { final InvocationValue result = new InvocationValueImpl() .set(owner) .setValue(method); Stream.of(args).forEachOrdered(result::add); return result; } }
@Override public Value<String> copy() { return new InvocationValueImpl(this); }
@Override public Value<String> copy() { return new InvocationValueImpl(this); }
@Override public boolean equals(Object o) { if (this == o) return true; if (!(o instanceof InvocationValue)) return false; final InvocationValue that = (InvocationValue) o; return args.equals(that.getValues()) && (getType() != null ? getType().equals(that.getType()) : that.getType() == null ) && (getValue() != null ? getValue().equals(that.getValue()) : that.getValue() == null); }
/** * Returns a new {@link InvocationValue} representing a call to the * specified local method with the specified arguments. * * @param method the local method to invoke * @param args the arguments to pass to it * @return the created invocation */ static InvocationValue ofInvocation(String method, Value<?>... args) { final InvocationValue result = new InvocationValueImpl() .setValue(method); Stream.of(args).forEachOrdered(result::add); return result; }
/** * Returns a new {@link InvocationValue} representing a call to the * specified static method in the specified class with the specified * arguments. * * @param owner the class where the static method is located * @param method the static method to invoke * @param args the arguments to pass to it * @return the created invocation */ static InvocationValue ofInvocation(Type owner, String method, Value<?>... args) { final InvocationValue result = new InvocationValueImpl() .set(owner) .setValue(method); Stream.of(args).forEachOrdered(result::add); return result; } }
@Override public boolean equals(Object o) { if (this == o) return true; if (!(o instanceof InvocationValue)) return false; final InvocationValue that = (InvocationValue) o; return args.equals(that.getValues()) && (getType() != null ? getType().equals(that.getType()) : that.getType() == null ) && (getValue() != null ? getValue().equals(that.getValue()) : that.getValue() == null); }