/** * Gets the configured repository for a given event type, assumed to be annotated with * * @param eventType The base type of events to extract a repository name for. */ public static String getRepositoryName(final Class<?> eventType) { EventType eventTypeData = getEventTypeAnnotation(eventType); if (eventTypeData.repositoryName() == null) { throw new IllegalArgumentException( "Provided event type does not have a configured repository name"); } return eventTypeData.repositoryName(); }
/** * Gets the configured repository for a given event type, assumed to be annotated with * * @param eventType The base type of events to extract a repository name for. */ public static String getRepositoryName(final Class<?> eventType) { EventType eventTypeData = getEventTypeAnnotation(eventType); if (eventTypeData.repositoryName() == null) { throw new IllegalArgumentException( "Provided event type does not have a configured repository name"); } return eventTypeData.repositoryName(); }
@SuppressWarnings("unchecked") public static <T> EventNormalizer<T> getNormalizer(final Class<T> eventType) { EventType eventTypeData = getEventTypeAnnotation(eventType); if (eventTypeData.normalizer() != null && !eventTypeData.normalizer().equals(EventType.NoNormalizer.class)) { return (EventNormalizer) createInstance(eventTypeData.normalizer()); } else { return null; } }
@SuppressWarnings("unchecked") public static <T> EventNormalizer<T> getNormalizer(final Class<T> eventType) { EventType eventTypeData = getEventTypeAnnotation(eventType); if (eventTypeData.normalizer() != null && !eventTypeData.normalizer().equals(EventType.NoNormalizer.class)) { return (EventNormalizer) createInstance(eventTypeData.normalizer()); } else { return null; } }