/** * Event type used for integration tests. */ @EventType(repositoryName = "testrepo") public class TestEventType { private String value; private TestEventType() { } public TestEventType(final String value) { this.value = value; } public void setValue(final String value) { this.value = value; } public String getValue() { return value; } }
/** * 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; } }
/** * 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; } }
/** * Event type used for integration tests. */ @EventType(repositoryName = "testrepo") public class TestEventType { private String value; private TestEventType() { } public TestEventType(final String value) { this.value = value; } public void setValue(final String value) { this.value = value; } public String getValue() { return value; } }