| 24 | import java.util.Map; |
| 25 | |
| 26 | public class SharedModuleEvent implements IEvent { |
| 27 | private String to; |
| 28 | private String from; |
| 29 | private Map<String, Object> params; |
| 30 | |
| 31 | public SharedModuleEvent(String to, Object... args) { |
| 32 | try { |
| 33 | throw new Exception(); |
| 34 | } catch (Exception e) { |
| 35 | from = e.getStackTrace()[1].getClassName(); |
| 36 | } |
| 37 | this.to = to; |
| 38 | this.params = new HashMap<String, Object>(); |
| 39 | if (args.length % 2 == 0) { |
| 40 | for (int i = 0; i < args.length; i += 2) { |
| 41 | Object var = args[i]; |
| 42 | Object value = args[i + 1]; |
| 43 | params.put(var.toString(), value); |
| 44 | } |
| 45 | } |
| 46 | } |
| 47 | |
| 48 | @Override |
| 49 | public String getEvent() { |
| 50 | return ""; |
| 51 | } |
| 52 | |
| 53 | public String to() { |
| 54 | return to; |
| 55 | } |
| 56 | |
| 57 | public Map<String, Object> params() { |
| 58 | return params; |
| 59 | } |
| 60 | |
| 61 | public String from() { |
| 62 | return from; |
| 63 | } |
| 64 | |
| 65 | @Override |
| 66 | public String toString() { |
| 67 | return String.format("SharedModulesEvent{%s->%s, %d}", from, to, |
| 68 | params.size()); |
| 69 | } |
| 70 | } |
nothing calls this directly
no outgoing calls
no test coverage detected