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

com.github.rahulsom.grooves.api.snapshots.TemporalSnapshot Maven / Gradle / Ivy

package com.github.rahulsom.grooves.api.snapshots;

import com.github.rahulsom.grooves.api.AggregateType;
import com.github.rahulsom.grooves.api.events.BaseEvent;
import com.github.rahulsom.grooves.api.snapshots.internal.BaseSnapshot;

import java.util.Date;

/**
 * Marks a class as a temporal snapshot.
 *
 * @param   The Aggregate this snapshot works over
 * @param  The type for the snapshot's {@link #getId()} field
 * @param     The type for the {@link EventT}'s id field
 * @param       The base type for events that apply to {@link AggregateT}
 *
 * @author Rahul Somasunderam
 */
public interface TemporalSnapshot<
        AggregateT extends AggregateType,
        SnapshotIdT,
        EventIdT,
        EventT extends BaseEvent>
        extends BaseSnapshot {

    Date getLastEventTimestamp();

    void setLastEventTimestamp(Date timestamp);

    @Override
    default void setLastEvent(EventT event) {
        this.setLastEventTimestamp(event.getTimestamp());
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy