public abstract class StatefulEntity<S,C> extends Entity<S,C>
| Modifier | Constructor and Description |
|---|---|
protected |
StatefulEntity()
Construct my default state.
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
apply(S state)
Apply my current
state. |
protected void |
apply(S state,
List<io.vlingo.symbio.Source<C>> sources)
Apply my current
state and sources. |
protected void |
apply(S state,
List<io.vlingo.symbio.Source<C>> sources,
String operation)
Apply my current
state that was modified due to the descriptive operation. |
protected void |
apply(S state,
List<io.vlingo.symbio.Source<C>> sources,
String metadataValue,
String operation)
Apply my current
state and metadataValye that was modified
due to the descriptive operation. |
protected void |
apply(S state,
io.vlingo.symbio.Source<C> source)
Apply my current
state and source. |
protected void |
apply(S state,
String operation)
Apply my current
state that was modified due to the descriptive operation. |
protected void |
apply(S state,
String metadataValue,
String operation)
Apply my current
state and metadataValye that was modified
due to the descriptive operation. |
int |
currentVersion()
Answer my currentVersion, which, if zero, indicates that the
receiver is being initially constructed or reconstituted.
|
abstract String |
id()
Answer my unique identity, which much be provided by
my concrete extender by overriding.
|
protected String |
idFrom(String separator,
String... idSegments)
Answer a representation of a number of segments as a
composite id.
|
protected abstract void |
state(S state)
Received by my extender when my current state has been applied and restored.
|
applied, applied, nextVersionpublic int currentVersion()
currentVersion in class Entity<S,C>public abstract String id()
protected void apply(S state, List<io.vlingo.symbio.Source<C>> sources, String metadataValue, String operation)
state and metadataValye that was modified
due to the descriptive operation.state - the S typed state to applysources - the List<Source> instances to applymetadataValue - the String metadata value to apply along with the stateoperation - the String descriptive name of the operation that caused the state modificationprotected void apply(S state, String metadataValue, String operation)
state and metadataValye that was modified
due to the descriptive operation.state - the S typed state to applymetadataValue - the String metadata value to apply along with the stateoperation - the String descriptive name of the operation that caused the state modificationprotected void apply(S state, List<io.vlingo.symbio.Source<C>> sources, String operation)
state that was modified due to the descriptive operation.state - the S typed state to applysources - the List<Source> instances to applyoperation - the String descriptive name of the operation that caused the state modificationprotected void apply(S state, String operation)
state that was modified due to the descriptive operation.state - the S typed state to applyoperation - the String descriptive name of the operation that caused the state modificationprotected void apply(S state, List<io.vlingo.symbio.Source<C>> sources)
state and sources.state - the S typed state to applysources - the List<Source<C>> instances to applyprotected void apply(S state, io.vlingo.symbio.Source<C> source)
state and source.state - the S typed state to applysource - the Source<C> instances to applyprotected void apply(S state)
state.state - the S typed state to applyprotected String idFrom(String separator, String... idSegments)
id() would use
this method if the its id is built from segments.separator - the String separator the insert between segmentsidSegments - the varargs String of one or more segmentsprotected abstract void state(S state)
state - the S typed stateCopyright © 2020. All rights reserved.