galovics commented on code in PR #2731:
URL: https://github.com/apache/fineract/pull/2731#discussion_r1015663181


##########
fineract-provider/src/main/java/org/apache/fineract/cob/service/InlineLoanCOBExecutorServiceImpl.java:
##########
@@ -66,7 +66,7 @@
 @Service
 @Slf4j
 @RequiredArgsConstructor
-public class InlineLoanCOBExecutorServiceImpl implements 
InlineExecutorService, InitializingBean {
+public class InlineLoanCOBExecutorServiceImpl implements 
InlineExecutorService<List<Long>>, InitializingBean {

Review Comment:
   What if we  simply don't specify the List part of the generic parameter? 
Just the Long. That way all the interface implementors will have the same List 
input type for the method.



##########
fineract-provider/src/main/java/org/apache/fineract/infrastructure/jobs/service/InlineExecutorService.java:
##########
@@ -21,7 +21,9 @@
 import org.apache.fineract.infrastructure.core.api.JsonCommand;
 import org.apache.fineract.infrastructure.core.data.CommandProcessingResult;
 
-public interface InlineExecutorService {
+public interface InlineExecutorService<T> {
 
     CommandProcessingResult executeInlineJob(JsonCommand command, String 
jobName);
+
+    void execute(T id, String jobName);

Review Comment:
   So rather this should look like:
   ```
   void execute(List<T> elements, String jobName);
   ```
   
   Plus, it'd be good to provide a way to do the same thing for a single item, 
so like we could add this:
   ```
   default void execute(T element, String jobName) {
       execute(singletonList(element), jobName)
   }
   ```
   Thoughts?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@fineract.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to