@Override public boolean isCustomMethod(Method method) { return composition.findMethod(method).isPresent(); }
@Override public boolean isCustomMethod(Method method) { return composition.findMethod(method).isPresent(); }
@Override public boolean isCustomMethod(Method method) { return composition.findMethod(method).isPresent(); }
@Override public boolean isCustomMethod(Method method) { return composition.findMethod(method).isPresent(); }
@Override public boolean isCustomMethod(Method method) { return composition.findMethod(method).isPresent(); }
@Override public boolean isCustomMethod(Method method) { return composition.findMethod(method).isPresent(); }
@Override public boolean isBaseClassMethod(Method method) { Assert.notNull(method, "Method must not be null!"); return baseComposition.findMethod(method).isPresent(); }
@Override public boolean isBaseClassMethod(Method method) { Assert.notNull(method, "Method must not be null!"); return baseComposition.findMethod(method).isPresent(); }
@Override public boolean isBaseClassMethod(Method method) { Assert.notNull(method, "Method must not be null!"); return baseComposition.findMethod(method).isPresent(); }
@Override public boolean isBaseClassMethod(Method method) { Assert.notNull(method, "Method must not be null!"); return baseComposition.findMethod(method).isPresent(); }
@Override public boolean isBaseClassMethod(Method method) { Assert.notNull(method, "Method must not be null!"); return baseComposition.findMethod(method).isPresent(); }
@Override public boolean isBaseClassMethod(Method method) { Assert.notNull(method, "Method must not be null!"); return baseComposition.findMethod(method).isPresent(); }
@Override public Method getTargetClassMethod(Method method) { if (methodCache.containsKey(method)) { return methodCache.get(method); } Method result = composition.findMethod(method).orElse(method); if (!result.equals(method)) { return cacheAndReturn(method, result); } return cacheAndReturn(method, baseComposition.findMethod(method).orElse(method)); }
/** * Find the implementation method for the given {@link Method} invoked on the composite interface. * * @param method must not be {@literal null}. * @return */ public Optional<Method> findMethod(Method method) { return methodCache.computeIfAbsent(method, key -> RepositoryFragments.findMethod(InvokedMethod.of(key), methodLookup, fragments::methods)); }
@Override public Method getTargetClassMethod(Method method) { if (methodCache.containsKey(method)) { return methodCache.get(method); } Method result = composition.findMethod(method).orElse(method); if (!result.equals(method)) { return cacheAndReturn(method, result); } return cacheAndReturn(method, baseComposition.findMethod(method).orElse(method)); }
@Override public Method getTargetClassMethod(Method method) { if (methodCache.containsKey(method)) { return methodCache.get(method); } Method result = composition.findMethod(method).orElse(method); if (!result.equals(method)) { return cacheAndReturn(method, result); } return cacheAndReturn(method, baseComposition.findMethod(method).orElse(method)); }
@Override public Method getTargetClassMethod(Method method) { if (methodCache.containsKey(method)) { return methodCache.get(method); } Method result = composition.findMethod(method).orElse(method); if (!result.equals(method)) { return cacheAndReturn(method, result); } return cacheAndReturn(method, baseComposition.findMethod(method).orElse(method)); }
@Override public Method getTargetClassMethod(Method method) { if (methodCache.containsKey(method)) { return methodCache.get(method); } Method result = composition.findMethod(method).orElse(method); if (!result.equals(method)) { return cacheAndReturn(method, result); } return cacheAndReturn(method, baseComposition.findMethod(method).orElse(method)); }
@Override public Method getTargetClassMethod(Method method) { if (methodCache.containsKey(method)) { return methodCache.get(method); } Method result = composition.findMethod(method).orElse(method); if (!result.equals(method)) { return cacheAndReturn(method, result); } return cacheAndReturn(method, baseComposition.findMethod(method).orElse(method)); }
/** * Invoke a method on the repository by routing the invocation to the appropriate {@link RepositoryFragment}. * * @param method * @param args * @return * @throws Throwable */ public Object invoke(Method method, Object... args) throws Throwable { Method methodToCall = findMethod(method) // .orElseThrow(() -> new IllegalArgumentException(String.format("No fragment found for method %s", method))); ReflectionUtils.makeAccessible(methodToCall); return fragments.invoke(methodToCall, argumentConverter.apply(methodToCall, args)); }