Package io.cloudstate.javasupport.crdt
Interface CrdtContext
-
- All Superinterfaces:
Context,EntityContext
- All Known Subinterfaces:
CommandContext,CrdtCreationContext,StreamCancelledContext,StreamedCommandContext<Output>,SubscriptionContext
public interface CrdtContext extends EntityContext
Root context for all CRDT contexts.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description <T extends Crdt>
java.util.Optional<T>state(java.lang.Class<T> crdtClass)The current CRDT, if it's been created.-
Methods inherited from interface io.cloudstate.javasupport.Context
serviceCallFactory
-
Methods inherited from interface io.cloudstate.javasupport.EntityContext
entityId
-
-
-
-
Method Detail
-
state
<T extends Crdt> java.util.Optional<T> state(java.lang.Class<T> crdtClass) throws java.lang.IllegalStateException
The current CRDT, if it's been created.- Parameters:
crdtClass- The type of the CRDT that is expected.- Returns:
- The current CRDT, or empty if none has been created yet.
- Throws:
java.lang.IllegalStateException- If the current CRDT does not match the passed incrdtClasstype.
-
-