io.fluxcapacitor.javaclient.eventsourcing.Aggregate Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of java-client Show documentation
Show all versions of java-client Show documentation
Default Java client library for interfacing with Flux Capacitor.
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));
}
}