@Override public CacheInvocationParameter[] getAllParameters(Object... values) { if (this.allParameterDetails.size() != values.length) { throw new IllegalStateException("Values mismatch, operation has " + this.allParameterDetails.size() + " parameter(s) but got " + values.length + " value(s)"); } List<CacheInvocationParameter> result = new ArrayList<>(); for (int i = 0; i < this.allParameterDetails.size(); i++) { result.add(this.allParameterDetails.get(i).toCacheInvocationParameter(values[i])); } return result.toArray(new CacheInvocationParameter[0]); }
@Override public CacheInvocationParameter[] getAllParameters(Object... values) { if (this.allParameterDetails.size() != values.length) { throw new IllegalStateException("Values mismatch, operation has " + this.allParameterDetails.size() + " parameter(s) but got " + values.length + " value(s)"); } List<CacheInvocationParameter> result = new ArrayList<>(); for (int i = 0; i < this.allParameterDetails.size(); i++) { result.add(this.allParameterDetails.get(i).toCacheInvocationParameter(values[i])); } return result.toArray(new CacheInvocationParameter[0]); }
/** * Return the {@link CacheInvocationParameter} for the parameters that are to be * used to compute the key. * <p>Per the spec, if some method parameters are annotated with * {@link javax.cache.annotation.CacheKey}, only those parameters should be part * of the key. If none are annotated, all parameters except the parameter annotated * with {@link javax.cache.annotation.CacheValue} should be part of the key. * <p>The method arguments must match the signature of the related method invocation * @param values the parameters value for a particular invocation * @return the {@link CacheInvocationParameter} instances for the parameters to be * used to compute the key */ public CacheInvocationParameter[] getKeyParameters(Object... values) { List<CacheInvocationParameter> result = new ArrayList<>(); for (CacheParameterDetail keyParameterDetail : this.keyParameterDetails) { int parameterPosition = keyParameterDetail.getParameterPosition(); if (parameterPosition >= values.length) { throw new IllegalStateException("Values mismatch, key parameter at position " + parameterPosition + " cannot be matched against " + values.length + " value(s)"); } result.add(keyParameterDetail.toCacheInvocationParameter(values[parameterPosition])); } return result.toArray(new CacheInvocationParameter[0]); }
/** * Return the {@link CacheInvocationParameter} for the parameters that are to be * used to compute the key. * <p>Per the spec, if some method parameters are annotated with * {@link javax.cache.annotation.CacheKey}, only those parameters should be part * of the key. If none are annotated, all parameters except the parameter annotated * with {@link javax.cache.annotation.CacheValue} should be part of the key. * <p>The method arguments must match the signature of the related method invocation * @param values the parameters value for a particular invocation * @return the {@link CacheInvocationParameter} instances for the parameters to be * used to compute the key */ public CacheInvocationParameter[] getKeyParameters(Object... values) { List<CacheInvocationParameter> result = new ArrayList<CacheInvocationParameter>(); for (CacheParameterDetail keyParameterDetail : this.keyParameterDetails) { int parameterPosition = keyParameterDetail.getParameterPosition(); if (parameterPosition >= values.length) { throw new IllegalStateException("Values mismatch, key parameter at position " + parameterPosition + " cannot be matched against " + values.length + " value(s)"); } result.add(keyParameterDetail.toCacheInvocationParameter(values[parameterPosition])); } return result.toArray(new CacheInvocationParameter[result.size()]); }
/** * Return the {@link CacheInvocationParameter} for the parameter holding the value * to cache. * <p>The method arguments must match the signature of the related method invocation * @param values the parameters value for a particular invocation * @return the {@link CacheInvocationParameter} instance for the value parameter */ public CacheInvocationParameter getValueParameter(Object... values) { int parameterPosition = this.valueParameterDetail.getParameterPosition(); if (parameterPosition >= values.length) { throw new IllegalStateException("Values mismatch, value parameter at position " + parameterPosition + " cannot be matched against " + values.length + " value(s)"); } return this.valueParameterDetail.toCacheInvocationParameter(values[parameterPosition]); }
@Override public CacheInvocationParameter[] getAllParameters(Object... values) { if (this.allParameterDetails.size() != values.length) { throw new IllegalStateException("Values mismatch, operation has " + this.allParameterDetails.size() + " parameter(s) but got " + values.length + " value(s)"); } List<CacheInvocationParameter> result = new ArrayList<CacheInvocationParameter>(); for (int i = 0; i < this.allParameterDetails.size(); i++) { result.add(this.allParameterDetails.get(i).toCacheInvocationParameter(values[i])); } return result.toArray(new CacheInvocationParameter[result.size()]); }
/** * Return the {@link CacheInvocationParameter} for the parameters that are to be * used to compute the key. * <p>Per the spec, if some method parameters are annotated with * {@link javax.cache.annotation.CacheKey}, only those parameters should be part * of the key. If none are annotated, all parameters except the parameter annotated * with {@link javax.cache.annotation.CacheValue} should be part of the key. * <p>The method arguments must match the signature of the related method invocation * @param values the parameters value for a particular invocation * @return the {@link CacheInvocationParameter} instances for the parameters to be * used to compute the key */ public CacheInvocationParameter[] getKeyParameters(Object... values) { List<CacheInvocationParameter> result = new ArrayList<>(); for (CacheParameterDetail keyParameterDetail : this.keyParameterDetails) { int parameterPosition = keyParameterDetail.getParameterPosition(); if (parameterPosition >= values.length) { throw new IllegalStateException("Values mismatch, key parameter at position " + parameterPosition + " cannot be matched against " + values.length + " value(s)"); } result.add(keyParameterDetail.toCacheInvocationParameter(values[parameterPosition])); } return result.toArray(new CacheInvocationParameter[0]); }
/** * Return the {@link CacheInvocationParameter} for the parameter holding the value * to cache. * <p>The method arguments must match the signature of the related method invocation * @param values the parameters value for a particular invocation * @return the {@link CacheInvocationParameter} instance for the value parameter */ public CacheInvocationParameter getValueParameter(Object... values) { int parameterPosition = this.valueParameterDetail.getParameterPosition(); if (parameterPosition >= values.length) { throw new IllegalStateException("Values mismatch, value parameter at position " + parameterPosition + " cannot be matched against " + values.length + " value(s)"); } return this.valueParameterDetail.toCacheInvocationParameter(values[parameterPosition]); }
/** * Return the {@link CacheInvocationParameter} for the parameter holding the value * to cache. * <p>The method arguments must match the signature of the related method invocation * @param values the parameters value for a particular invocation * @return the {@link CacheInvocationParameter} instance for the value parameter */ public CacheInvocationParameter getValueParameter(Object... values) { int parameterPosition = this.valueParameterDetail.getParameterPosition(); if (parameterPosition >= values.length) { throw new IllegalStateException("Values mismatch, value parameter at position " + parameterPosition + " cannot be matched against " + values.length + " value(s)"); } return this.valueParameterDetail.toCacheInvocationParameter(values[parameterPosition]); }