io.vanillabp.springboot.parameters.TaskEventMethodParameter Maven / Gradle / Ivy
package io.vanillabp.springboot.parameters;
import io.vanillabp.spi.service.TaskEvent;
import io.vanillabp.spi.service.TaskEvent.Event;
import java.util.HashSet;
import java.util.Set;
public class TaskEventMethodParameter extends MethodParameter {
private final Set events;
public TaskEventMethodParameter(
final int index,
final String parameter,
final Event[] annotationParameter) {
super(index, parameter);
events = new HashSet();
for (final var event : annotationParameter) {
if (event == Event.ALL) {
events.add(Event.CREATED);
events.add(Event.CANCELED);
} else {
events.add(event);
}
}
}
public Set getEvents() {
return events;
}
}