io.github.zhyshko.core.configuration.HandlerConfiguration Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of BotIO Show documentation
Show all versions of BotIO Show documentation
A framework for easy Telegram Bot creation
package io.github.zhyshko.core.configuration;
import io.github.zhyshko.core.router.UpdateRouter;
import io.github.zhyshko.core.util.UpdateType;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.stereotype.Component;
import java.util.List;
import java.util.Map;
import java.util.function.Function;
import java.util.stream.Collectors;
@Component
public class HandlerConfiguration {
private List updateHandlers;
@Bean
public Map getUpdateHandlers() {
return updateHandlers.stream()
.collect(Collectors.toMap(UpdateRouter::getType, Function.identity()));
}
@Autowired
public void setUpdateHandlers(List updateHandlers) {
this.updateHandlers = updateHandlers;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy