Class EventSourcedEntityEffectsRunner<S>
- java.lang.Object
-
- com.akkaserverless.javasdk.testkit.impl.EventSourcedEntityEffectsRunner<S>
-
public abstract class EventSourcedEntityEffectsRunner<S> extends java.lang.ObjectExtended by generated code, not meant for user extension
-
-
Constructor Summary
Constructors Constructor Description EventSourcedEntityEffectsRunner(com.akkaserverless.javasdk.eventsourcedentity.EventSourcedEntity<S> entity)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description java.util.List<java.lang.Object>getAllEvents()SgetState()protected abstract ShandleEvent(S state, java.lang.Object event)protected <R> EventSourcedResult<R>interpretEffects(java.util.function.Supplier<com.akkaserverless.javasdk.eventsourcedentity.EventSourcedEntity.Effect<R>> effect)creates a command context to run the commands, then creates an event context to run the events, and finally, creates a command context to run the side effects.
-
-
-
Constructor Detail
-
EventSourcedEntityEffectsRunner
public EventSourcedEntityEffectsRunner(com.akkaserverless.javasdk.eventsourcedentity.EventSourcedEntity<S> entity)
-
-
Method Detail
-
handleEvent
protected abstract S handleEvent(S state, java.lang.Object event)
- Returns:
- The current state of the entity after applying the event
-
getState
public S getState()
- Returns:
- The current state of the entity
-
getAllEvents
public java.util.List<java.lang.Object> getAllEvents()
- Returns:
- All events emitted by command handlers of this entity up to now
-
interpretEffects
protected <R> EventSourcedResult<R> interpretEffects(java.util.function.Supplier<com.akkaserverless.javasdk.eventsourcedentity.EventSourcedEntity.Effect<R>> effect)
creates a command context to run the commands, then creates an event context to run the events, and finally, creates a command context to run the side effects. It cleans each context after each run.- Returns:
- the result of the side effects
-
-