@Test public void shouldPopulateListKeyIndexIfLinkedList() throws Exception { final Class<? extends Annotation> expected = ReadThroughMultiCache.class; final Method targetMethod = new Mirror().on(AnnotationDataDummy.class).reflect().method("populateListKey05") .withArgs(LinkedList.class); data.setKeyIndexes(Collections.singleton(0)); builder.populate(data, null, expected, targetMethod); assertEquals(0, data.getListIndexInKeys()); assertEquals(0, data.getListIndexInMethodArgs()); }
private Integer getListIndexInKeys(final Class<?>[] keyMethodParamTypes, final Method targetMethod) { Integer listIndexInKeys = null; for (int i = 0; i < keyMethodParamTypes.length; i++) { if (isList(keyMethodParamTypes[i])) { if (listIndexInKeys != null) { throw new InvalidAnnotationException( "There are more than one method's parameter annotated by @ParameterValueKeyProvider that is list " + targetMethod.toString()); } listIndexInKeys = i; } } return listIndexInKeys; }
ListKeyIndexBuilder extends AbstractDataBuilder { private Integer getListIndexInKeys(final Class<?>[] keyMethodParamTypes, final Method targetMethod) { Integer listIndexInKeys = null; for (int i = 0; i < keyMethodParamTypes.length; i++) { if (isList(keyMethodParamTypes[i])) { if (listIndexInKeys != null) { throw new InvalidAnnotationException( "There are more than one method's parameter annotated by @ParameterValueKeyProvider that is list " + targetMethod.toString()); } listIndexInKeys = i; } } return listIndexInKeys; } }
ListKeyIndexBuilder extends AbstractDataBuilder { private Integer getListIndexInKeys(final Class<?>[] keyMethodParamTypes, final Method targetMethod) { Integer listIndexInKeys = null; for (int i = 0; i < keyMethodParamTypes.length; i++) { if (isList(keyMethodParamTypes[i])) { if (listIndexInKeys != null) { throw new InvalidAnnotationException( "There are more than one method's parameter annotated by @ParameterValueKeyProvider that is list " + targetMethod.toString()); } listIndexInKeys = i; } } return listIndexInKeys; }  }
ListKeyIndexBuilder extends AbstractDataBuilder { private Integer getListIndexInKeys(final Class<?>[] keyMethodParamTypes, final Method targetMethod) { Integer listIndexInKeys = null; for (int i = 0; i < keyMethodParamTypes.length; i++) { if (isList(keyMethodParamTypes[i])) { if (listIndexInKeys != null) { throw new InvalidAnnotationException( "There are more than one method's parameter annotated by @ParameterValueKeyProvider that is list " + targetMethod.toString()); } listIndexInKeys = i; } } return listIndexInKeys; }   }
ListKeyIndexBuilder extends AbstractDataBuilder { private Integer getListIndexInKeys(final Class<?>[] keyMethodParamTypes, final Method targetMethod) { Integer listIndexInKeys = null; for (int i = 0; i < keyMethodParamTypes.length; i++) { if (isList(keyMethodParamTypes[i])) { if (listIndexInKeys != null) { throw new InvalidAnnotationException( "There are more than one method's parameter annotated by @ParameterValueKeyProvider that is list " + targetMethod.toString()); } listIndexInKeys = i; } } return listIndexInKeys; }    }