use of com.tvd12.ezyfoxserver.support.exception.EzyDuplicateRequestHandlerException in project ezyfox-server by youngmonkeys.
the class EzyRequestHandlersImplementer method implement.
public Map<String, EzyUserRequestHandler> implement(Collection<Object> controllers) {
Map<String, EzyUserRequestHandler> handlers = new HashMap<>();
for (Object controller : controllers) {
Map<String, EzyUserRequestHandler> map = implement(controller);
for (String command : map.keySet()) {
EzyUserRequestHandler handler = map.get(command);
EzyUserRequestHandler old = handlers.put(command, handler);
if (old != null && !allowOverrideCommand) {
throw new EzyDuplicateRequestHandlerException(command, old, handler);
}
}
}
return handlers;
}
Aggregations