/* */ package cn.cloudwalk.event.handler; /* */ /* */ import cn.cloudwalk.cwos.client.event.event.BaseEvent; /* */ import cn.cloudwalk.cwos.client.event.event.EventType; /* */ import cn.cloudwalk.cwos.client.event.handler.EventListener; /* */ import java.util.HashMap; /* */ import java.util.List; /* */ import java.util.Map; /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ public class EventHandlerMapping /* */ { /* 26 */ private final Map>>> handlerMap = new HashMap<>(); /* */ /* */ /* */ /* */ /* */ /* 32 */ private final Map>>> customHandlerMap = new HashMap<>(); /* */ /* */ /* */ /* */ /* */ /* 38 */ private final Map, String> listenerClassGroupMap = new HashMap<>(); /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ public void registerHandlers(String groupId, EventType eventType, Map> handlers) { /* 48 */ Map>> map = this.handlerMap.get(groupId); /* 49 */ if (null == map) { /* 50 */ map = new HashMap<>(); /* 51 */ map.put(eventType, handlers); /* 52 */ this.handlerMap.put(groupId, map); /* */ } else { /* 54 */ map.put(eventType, handlers); /* */ } /* */ } /* */ /* */ /* */ public Map> getServiceCodeHandlerListMap(String groupId, Class eventClass) { /* 60 */ for (EventType eventType : EventType.values()) { /* 61 */ if (eventType.getEventClass().getClass().equals(eventClass)) { /* 62 */ return getServiceCodeHandlerListMap(groupId, eventType); /* */ } /* */ } /* 65 */ throw new IllegalArgumentException("没有找到合适的事件类型"); /* */ } /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ public Map> getServiceCodeHandlerListMap(String groupId, EventType eventType) { /* 76 */ Map>> map = this.handlerMap.get(groupId); /* 77 */ if (null != map) { /* 78 */ return map.get(eventType); /* */ } /* 80 */ return null; /* */ } /* */ /* */ public Map> getServiceCodeCustomHandlerListMap(String groupId, String topic) { /* 84 */ Map>> map = this.customHandlerMap.get(groupId); /* 85 */ if (null != map) { /* 86 */ return map.get(topic); /* */ } /* 88 */ return null; /* */ } /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ public void registerCustomHandlers(String groupId, String topic, Map> handlers) { /* 99 */ Map>> map = this.customHandlerMap.get(groupId); /* 100 */ if (null == map) { /* 101 */ map = new HashMap<>(); /* 102 */ map.put(topic, handlers); /* 103 */ this.customHandlerMap.put(groupId, map); /* */ } else { /* 105 */ map.put(topic, handlers); /* */ } /* */ } /* */ /* */ public Map>>> getHandlerMap() { /* 110 */ return this.handlerMap; /* */ } /* */ /* */ public Map>>> getCustomHandlerMap() { /* 114 */ return this.customHandlerMap; /* */ } /* */ /* */ public Map, String> getListenerClassGroupMap() { /* 118 */ return this.listenerClassGroupMap; /* */ } /* */ } /* Location: D:\星中心\cw-elevator-application-V1.0.0.20211103\cw-elevator-application-V1.0.0.20211103\lib\cloudwalk-common-event-3.7.2-Brussels-SRX.jar!\cn\cloudwalk\event\handler\EventHandlerMapping.class * Java compiler version: 7 (51.0) * JD-Core Version: 1.1.3 */