/** * Returns the current state of the parameters as an array by parameter index. Note that mutations to the array have no effect. * If you wish to mutate the parameters use {@link #getParameters()} and the {@link MutableArgumentValue} interface instead * * @return The bound {@link ArgumentValue} instances */ default Object[] getParameterValues() { return getParameters() .values() .stream() .map(ArgumentValue::getValue) .toArray(); }
@Override public Object intercept(InvocationContext context) { if (LOG.isTraceEnabled()) { if (context instanceof MethodExecutionHandle) { MethodExecutionHandle handle = (MethodExecutionHandle) context; Collection<MutableArgumentValue<?>> values = context.getParameters().values(); LOG.trace("Invoking method {}#{}(..) with arguments {}", context.getTarget().getClass().getName(), handle.getMethodName(), values.stream().map(ArgumentValue::getValue).collect(Collectors.toList())); } } Object result = context.proceed(); if (LOG.isTraceEnabled()) { if (context instanceof MethodExecutionHandle) { MethodExecutionHandle handle = (MethodExecutionHandle) context; LOG.trace("Method {}#{}(..) returned result {}", context.getTarget().getClass().getName(), handle.getMethodName(), result); } } return result; } }
/** * Returns the current state of the parameters as an array by parameter index. Note that mutations to the array have no effect. * If you wish to mutate the parameters use {@link #getParameters()} and the {@link MutableArgumentValue} interface instead * * @return The bound {@link ArgumentValue} instances */ default Map<String, Object> getParameterValueMap() { Map<String, MutableArgumentValue<?>> parameters = getParameters(); Map<String, Object> valueMap = new LinkedHashMap<>(parameters.size()); for (Map.Entry<String, MutableArgumentValue<?>> entry : parameters.entrySet()) { MutableArgumentValue<?> value = entry.getValue(); String key = entry.getKey(); valueMap.put(key, value.getValue()); } return valueMap; } }
/** * Returns the current state of the parameters as an array by parameter index. Note that mutations to the array have no effect. * If you wish to mutate the parameters use {@link #getParameters()} and the {@link MutableArgumentValue} interface instead * * @return The bound {@link ArgumentValue} instances */ default Object[] getParameterValues() { return getParameters() .values() .stream() .map(ArgumentValue::getValue) .toArray(); }
/** * Returns the current state of the parameters as an array by parameter index. Note that mutations to the array have no effect. * If you wish to mutate the parameters use {@link #getParameters()} and the {@link MutableArgumentValue} interface instead * * @return The bound {@link ArgumentValue} instances */ default Object[] getParameterValues() { return getParameters() .values() .stream() .map(ArgumentValue::getValue) .toArray(); }
/** * Returns the current state of the parameters as an array by parameter index. Note that mutations to the array have no effect. * If you wish to mutate the parameters use {@link #getParameters()} and the {@link MutableArgumentValue} interface instead * * @return The bound {@link ArgumentValue} instances */ default Map<String, Object> getParameterValueMap() { Map<String, MutableArgumentValue<?>> parameters = getParameters(); Map<String, Object> valueMap = new LinkedHashMap<>(parameters.size()); for (Map.Entry<String, MutableArgumentValue<?>> entry : parameters.entrySet()) { MutableArgumentValue<?> value = entry.getValue(); String key = entry.getKey(); valueMap.put(key, value.getValue()); } return valueMap; } }
/** * Returns the current state of the parameters as an array by parameter index. Note that mutations to the array have no effect. * If you wish to mutate the parameters use {@link #getParameters()} and the {@link MutableArgumentValue} interface instead * * @return The bound {@link ArgumentValue} instances */ default Map<String, Object> getParameterValueMap() { Map<String, MutableArgumentValue<?>> parameters = getParameters(); Map<String, Object> valueMap = new LinkedHashMap<>(parameters.size()); for (Map.Entry<String, MutableArgumentValue<?>> entry : parameters.entrySet()) { MutableArgumentValue<?> value = entry.getValue(); String key = entry.getKey(); valueMap.put(key, value.getValue()); } return valueMap; } }