public static ArrayList<Message> allIncomingMessages(Thing thing) { ArrayList<Message> result = new ArrayList<Message>(); for (Port p : allPorts(thing)) { for (Message m : p.getReceives()) { if (!result.contains(m)) result.add(m); } } return result; }
public static ArrayList<Message> findIncomingMessage(Port port, String name, boolean fuzzy) { ArrayList<Message> result = new ArrayList<Message>(); for (Message t : port.getReceives()) { if (t.getName().startsWith(name)) { if (fuzzy) result.add(t); else if (t.getName().equals(name)) result.add(t); } } return result; }