@Test public void registerListener() { registry.registerListener("test", (event, payload) -> { call = true; System.out.println("setting call true"); }, true); assertTrue(registry.getRegisteredListeners().containsKey("test")); }
@Override public RegisteredListener<String, BiConsumer<MenuItemClick, Map<String, Object>>> registerListener( String name, BiConsumer<MenuItemClick, Map<String, Object>> handler, boolean override) { Preconditions.checkNotNull(name, "Null name"); Preconditions.checkNotNull(handler, "Null handler"); RegisteredListener<String, BiConsumer<MenuItemClick, Map<String, Object>>> previous = registryMap.get(name); if (previous != null && !override) { LOGGER.warning(() -> String.format("Listener with name %s already exists. If you want to override it, enable override flag", name)); return previous; } handler = processHandler(handler); RegisteredListener<String, BiConsumer<MenuItemClick, Map<String, Object>>> listener = ListenerRegistries.newRegisteredListener(name, handler); registryMap.put(name, listener); return listener; }
ClickListenerRegistry implements Function<String, BiConsumer<MenuItemClick, Map<String, Object>>>,
        ListenerRegistry<String, BiConsumer<MenuItemClick, Map<String, Object>>> { @Override public RegisteredListener<String, BiConsumer<MenuItemClick, Map<String, Object>>> registerListener( String name, BiConsumer<MenuItemClick, Map<String, Object>> handler, boolean override) { Preconditions.checkNotNull(name, "Null name"); Preconditions.checkNotNull(handler, "Null handler"); RegisteredListener<String, BiConsumer<MenuItemClick, Map<String, Object>>> previous = registryMap.get(name); if (previous != null && !override) { LOGGER.warning(() -> String.format("Listener with name %s already exists. If you want to override it, enable override flag", name)); return previous; } handler = processHandler(handler); RegisteredListener<String, BiConsumer<MenuItemClick, Map<String, Object>>> listener = ListenerRegistries.newRegisteredListener(name, handler); registryMap.put(name, listener); return listener; } }
ClickListenerRegistry implements Function<String, BiConsumer<MenuItemClick, Map<String, Object>>>,
        ListenerRegistry<String, BiConsumer<MenuItemClick, Map<String, Object>>> { @Override public RegisteredListener<String, BiConsumer<MenuItemClick, Map<String, Object>>> registerListener( String name, BiConsumer<MenuItemClick, Map<String, Object>> handler, boolean override) { Preconditions.checkNotNull(name, "Null name"); Preconditions.checkNotNull(handler, "Null handler"); RegisteredListener<String, BiConsumer<MenuItemClick, Map<String, Object>>> previous = registryMap.get(name); if (previous != null && !override) { LOGGER.warning(() -> String.format("Listener with name %s already exists. If you want to override it, enable override flag", name)); return previous; } handler = processHandler(handler); RegisteredListener<String, BiConsumer<MenuItemClick, Map<String, Object>>> listener = ListenerRegistries.newRegisteredListener(name, handler); registryMap.put(name, listener); return listener; } ClickListenerRegistry(Map<String, RegisteredListener<String, BiConsumer<MenuItemClick, Map<String, Object>>>> registryMap);  ClickListenerRegistry(); }
ClickListenerRegistry implements Function<String, BiConsumer<MenuItemClick, Map<String, Object>>>,
        ListenerRegistry<String, BiConsumer<MenuItemClick, Map<String, Object>>> { @Override public RegisteredListener<String, BiConsumer<MenuItemClick, Map<String, Object>>> registerListener( String name, BiConsumer<MenuItemClick, Map<String, Object>> handler, boolean override) { Preconditions.checkNotNull(name, "Null name"); Preconditions.checkNotNull(handler, "Null handler"); RegisteredListener<String, BiConsumer<MenuItemClick, Map<String, Object>>> previous = registryMap.get(name); if (previous != null && !override) { LOGGER.warning(() -> String.format("Listener with name %s already exists. If you want to override it, enable override flag", name)); return previous; } handler = processHandler(handler); RegisteredListener<String, BiConsumer<MenuItemClick, Map<String, Object>>> listener = ListenerRegistries.newRegisteredListener(name, handler); registryMap.put(name, listener); return listener; } ClickListenerRegistry(Map<String, RegisteredListener<String, BiConsumer<MenuItemClick, Map<String, Object>>>> registryMap);  ClickListenerRegistry(); @Override BiConsumer<MenuItemClick, Map<String, Object>> apply(String name); @Override boolean removeListener(String name); @Override Optional<RegisteredListener<String, BiConsumer<MenuItemClick, Map<String, Object>>>> getRegisteredListener(String id); @Override Map<String, RegisteredListener<String, BiConsumer<MenuItemClick, Map<String, Object>>>> getRegisteredListeners(); @Override void merge(ListenerRegistry<String, BiConsumer<MenuItemClick, Map<String, Object>>> registry); @Override void addListenerPreProcessor(UnaryOperator<BiConsumer<MenuItemClick, Map<String, Object>>> processor); @Override RegisteredListener<String, BiConsumer<MenuItemClick, Map<String, Object>>> registerListener(
            String name, BiConsumer<MenuItemClick, Map<String, Object>> handler, boolean override); @Override boolean contains(String identifier); }
ClickListenerRegistry implements Function<String, BiConsumer<MenuItemClick, Map<String, Object>>>,
        ListenerRegistry<String, BiConsumer<MenuItemClick, Map<String, Object>>> { @Override public RegisteredListener<String, BiConsumer<MenuItemClick, Map<String, Object>>> registerListener( String name, BiConsumer<MenuItemClick, Map<String, Object>> handler, boolean override) { Preconditions.checkNotNull(name, "Null name"); Preconditions.checkNotNull(handler, "Null handler"); RegisteredListener<String, BiConsumer<MenuItemClick, Map<String, Object>>> previous = registryMap.get(name); if (previous != null && !override) { LOGGER.warning(() -> String.format("Listener with name %s already exists. If you want to override it, enable override flag", name)); return previous; } handler = processHandler(handler); RegisteredListener<String, BiConsumer<MenuItemClick, Map<String, Object>>> listener = ListenerRegistries.newRegisteredListener(name, handler); registryMap.put(name, listener); return listener; } ClickListenerRegistry(Map<String, RegisteredListener<String, BiConsumer<MenuItemClick, Map<String, Object>>>> registryMap);  ClickListenerRegistry(); @Override BiConsumer<MenuItemClick, Map<String, Object>> apply(String name); @Override boolean removeListener(String name); @Override Optional<RegisteredListener<String, BiConsumer<MenuItemClick, Map<String, Object>>>> getRegisteredListener(String id); @Override Map<String, RegisteredListener<String, BiConsumer<MenuItemClick, Map<String, Object>>>> getRegisteredListeners(); @Override void merge(ListenerRegistry<String, BiConsumer<MenuItemClick, Map<String, Object>>> registry); @Override void addListenerPreProcessor(UnaryOperator<BiConsumer<MenuItemClick, Map<String, Object>>> processor); @Override RegisteredListener<String, BiConsumer<MenuItemClick, Map<String, Object>>> registerListener(
            String name, BiConsumer<MenuItemClick, Map<String, Object>> handler, boolean override); @Override boolean contains(String identifier); static final ListenerRegistry<String, BiConsumer<MenuItemClick, Map<String, Object>>> STANDARD_PREDEFINED_REGISTRY; }