org.elder.sourcerer.EventSubscriptionUpdate Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of sourcerer-core Show documentation
Show all versions of sourcerer-core Show documentation
An opinionated framework for implementing an CQRS architecture using event sourcing
The newest version!
package org.elder.sourcerer;
public class EventSubscriptionUpdate {
public enum UpdateType {
EVENT,
CAUGHT_UP,
}
private final UpdateType updateType;
private final EventRecord event;
public EventSubscriptionUpdate(final UpdateType updateType, final EventRecord event) {
this.updateType = updateType;
this.event = event;
}
public UpdateType getUpdateType() {
return updateType;
}
public EventRecord getEvent() {
return event;
}
public static EventSubscriptionUpdate caughtUp() {
return new EventSubscriptionUpdate<>(UpdateType.CAUGHT_UP, null);
}
public static EventSubscriptionUpdate ofEvent(final EventRecord event) {
return new EventSubscriptionUpdate<>(UpdateType.EVENT, event);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy