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
  • Constructor Details

    • ReplicatedEntity

      public ReplicatedEntity()
  • Method Details

    • emptyData

      public abstract D emptyData(ReplicatedDataFactory factory)
      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

      protected final CommandContext commandContext()
      Additional context and metadata for a command handler.

      It will throw an exception if accessed from the entity constructor.

    • _internalSetCommandContext

      public void _internalSetCommandContext(Optional<CommandContext> context)
      INTERNAL API
    • effects

      protected final <R> ReplicatedEntity.Effect.Builder<D> effects()