Package kalix.javasdk.replicatedentity
Class ReplicatedEntity<D extends kalix.replicatedentity.ReplicatedData>
Object
kalix.javasdk.replicatedentity.ReplicatedEntity<D>
- Type Parameters:
D
- The replicated data type for this entity.
- Direct Known Subclasses:
ReplicatedCounterEntity
,ReplicatedCounterMapEntity
,ReplicatedMapEntity
,ReplicatedMultiMapEntity
,ReplicatedRegisterEntity
,ReplicatedRegisterMapEntity
,ReplicatedSetEntity
,ReplicatedVoteEntity
public abstract class ReplicatedEntity<D extends kalix.replicatedentity.ReplicatedData>
extends Object
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic interface
An Effect is a description of what Kalix needs to do after the command is handled. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
_internalSetCommandContext
(Optional<CommandContext> context) INTERNAL APIprotected final CommandContext
Additional context and metadata for a command handler.protected final <R> ReplicatedEntity.Effect.Builder<D>
effects()
abstract D
emptyData
(ReplicatedDataFactory factory) Implement by returning the initial empty replicated data object.
-
Constructor Details
-
ReplicatedEntity
public ReplicatedEntity()
-
-
Method Details
-
emptyData
Implement by returning the initial empty replicated data object. This object will be passed into the command handlers.Also known as the "zero" or "neutral" state.
The initial data cannot be
null
.- Parameters:
factory
- the factory to create the initial empty replicated data object
-
commandContext
Additional context and metadata for a command handler.It will throw an exception if accessed from the entity constructor.
-
_internalSetCommandContext
INTERNAL API -
effects
-