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

io.fluxcapacitor.javaclient.eventsourcing.Aggregate Maven / Gradle / Ivy

There is a newer version: 0.1015.0
Show newest version
package io.fluxcapacitor.javaclient.eventsourcing;

import lombok.Value;

import java.util.function.UnaryOperator;

@Value
public class Aggregate {
    String id;
    long sequenceNumber;
    T model;

    public Aggregate update(UnaryOperator updateFunction) {
        return new Aggregate<>(id, sequenceNumber + 1L, updateFunction.apply(model));
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy