Interface Aggregate<T>
-
- All Known Implementing Classes:
EventSourcedModel,EventSourcingRepository.EventSourcedAggregate
public interface Aggregate<T>
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interfaceAggregate.Validator<T,E extends Exception>
-
Field Summary
Fields Modifier and Type Field Description static StringAGGREGATE_ID_METADATA_KEYstatic StringAGGREGATE_TYPE_METADATA_KEY
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description Aggregate<T>apply(Message eventMessage)default Aggregate<T>apply(Object event)default Aggregate<T>apply(Object event, Metadata metadata)default Aggregate<T>apply(Function<T,Message> eventFunction)default <E extends Exception>
Aggregate<T>assertLegal(Object command)default <E extends Exception>
Aggregate<T>assertThat(Aggregate.Validator<T,E> validator)default <E extends Exception>
Aggregate<T>ensure(Predicate<T> check, Function<T,E> errorProvider)Tget()StringlastEventId()Instanttimestamp()
-
-
-
Field Detail
-
AGGREGATE_ID_METADATA_KEY
static final String AGGREGATE_ID_METADATA_KEY
- See Also:
- Constant Field Values
-
AGGREGATE_TYPE_METADATA_KEY
static final String AGGREGATE_TYPE_METADATA_KEY
- See Also:
- Constant Field Values
-
-
Method Detail
-
get
T get()
-
lastEventId
String lastEventId()
-
timestamp
Instant timestamp()
-
assertLegal
default <E extends Exception> Aggregate<T> assertLegal(Object command) throws E extends Exception
- Throws:
E extends Exception
-
assertThat
default <E extends Exception> Aggregate<T> assertThat(Aggregate.Validator<T,E> validator) throws E extends Exception
- Throws:
E extends Exception
-
-