Guest User

Untitled

a guest
May 24th, 2018
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.92 KB | None | 0 0
  1. interface applyBuisnessRule<T> {
  2. public T execute(String jobCode) throws Exception;
  3. }
  4.  
  5. class CardvaletImpl<T> implements applyBuisnessRule<T> {
  6. private static final String Success = null;
  7.  
  8. public T execute(String jobCode) throws Exception {
  9. T result = null;
  10. // put your logic
  11. return result;
  12. }
  13. }
  14.  
  15. CardvaletImpl<String> cardvaletImpl = new CardvaletImpl<>();
  16. String result = cardvaletImpl.execute("JOBCODE");
  17.  
  18. class CardvaletImpl<T> implements applyBuisnessRule<T> {
  19. private static final String Success = null;
  20.  
  21. Map<String, Integer> myMap = new HashMap<String, Integer>(); // ****Map that i want to return from this class to caller class ***
  22. myMap.put("A",23);
  23. myMap.put("A",45);
  24.  
  25. public T execute(String jobCode) throws Exception {
  26. T result = null;
  27. // ** advise how i will put the map into object that is into result and return to the caller
  28.  
  29. }
  30. }
Add Comment
Please, Sign In to add comment