fr.fezlight.eventsystem.models.Handler Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of spring-boot-starter-event-system Show documentation
Show all versions of spring-boot-starter-event-system Show documentation
This library is dedicated for Spring Boot application and is an implementation of an event system
integrated with RabbitMQ and Spring-Modulith-Events.
The newest version!
package fr.fezlight.eventsystem.models;
import static org.springframework.util.StringUtils.hasLength;
public record Handler(String name, EventHandler eventHandler) {
public String condition() {
return eventHandler.getSubscribeEvent().condition();
}
public int retry() {
return eventHandler.getSubscribeEvent().retry();
}
public void handle(T event) {
eventHandler.handle(event);
}
@Override
public String name() {
var customName = eventHandler.getSubscribeEvent().customName();
if (hasLength(customName)) {
return customName;
}
return name;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy