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

com.github.rahulsom.grooves.queries.QuerySupport Maven / Gradle / Ivy

The newest version!
package com.github.rahulsom.grooves.queries;

import com.github.rahulsom.grooves.api.events.BaseEvent;
import com.github.rahulsom.grooves.api.snapshots.Snapshot;
import com.github.rahulsom.grooves.queries.internal.QueryExecutor;
import org.jetbrains.annotations.NotNull;
import org.reactivestreams.Publisher;

/**
 * Aggregate trait that simplifies computing temporal snapshots from events.
 *
 * @param   The aggregate over which the query executes
 * @param     The type of the Event's id field
 * @param       The type of the Event
 * @param  The type of the Snapshot's id field
 * @param    The type of the Snapshot
 *
 * @author Rahul Somasunderam
 */
public interface QuerySupport<
        AggregateT,
        EventIdT,
        EventT extends BaseEvent,
        SnapshotIdT,
        SnapshotT extends Snapshot
        >
        extends
        TemporalQuerySupport,
        VersionedQuerySupport {

    @NotNull
    @Override
    default QueryExecutor getExecutor() {
        return new QueryExecutor<>();
    }

    @NotNull
    @Override
    default Publisher findEventsBefore(@NotNull EventT event) {
        return VersionedQuerySupport.super.findEventsBefore(event);
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy