All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.elder.sourcerer.EventSubscriptionUpdate Maven / Gradle / Ivy

Go to download

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