예제 #1
0
 private static void getAllReceiveMessages(Source input, List<ReceiveMessage> result) {
   if (input instanceof SimpleSource) {
     result.add(((SimpleSource) input).getMessage());
   } else if (input instanceof SourceComposition) {
     SourceComposition composition = (SourceComposition) input;
     for (Source s : composition.getSources()) {
       getAllReceiveMessages(s, result);
     }
   }
 }
예제 #2
0
 public static List<ReceiveMessage> allReceiveMessages(Source input) {
   List<ReceiveMessage> result = new ArrayList<>();
   getAllReceiveMessages(input, result);
   return result;
 }