EventSourcingHandler handlerAnnotation = member.getAnnotation(EventSourcingHandler.class);
Class<?> definedPayload = null;
if (handlerAnnotation != null) {
definedPayload = handlerAnnotation.eventType();
} else {
EventHandler legacyAnnotation = member.getAnnotation(EventHandler.class);
if (legacyAnnotation != null) {
definedPayload = legacyAnnotation.eventType();
}
}
return definedPayload == Void.class ? null : definedPayload;
}