Class FSMStateFunctionBuilder<S,D,E>
java.lang.Object
org.apache.pekko.persistence.fsm.japi.pf.FSMStateFunctionBuilder<S,D,E>
- Type Parameters:
S- the state typeD- the data typeE- the domain event type
Deprecated.
use EventSourcedBehavior since Akka 2.6.0
Builder used to create a partial function for
FSM.whenUnhandled(scala.PartialFunction<org.apache.pekko.actor.FSM.Event<D>, org.apache.pekko.actor.FSM.State<S, D>>).-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionDeprecated.Add a case statement that matches on any type of event.scala.PartialFunction<PersistentFSM.Event<D>,PersistentFSM.State<S, D, E>> build()Deprecated.Build aPartialFunctionfrom this builder.<P,Q> FSMStateFunctionBuilder<S, D, E> Deprecated.Add a case statement that matches on an event and data type.final <P,Q> FSMStateFunctionBuilder<S, D, E> event(Class<P> eventType, Class<Q> dataType, Predicate2<P, Q> predicate, Function2<P, Q, PersistentFSM.State<S, D, E>> apply) Deprecated.Add a case statement that matches on an event and data type and a predicate.<P> FSMStateFunctionBuilder<S,D, E> Deprecated.Add a case statement that matches if the event type and predicate matches.<P> FSMStateFunctionBuilder<S,D, E> event(Class<P> eventType, Predicate2<P, D> predicate, Function2<P, D, PersistentFSM.State<S, D, E>> apply) Deprecated.Add a case statement that matches if the event type and predicate matches.<Q> FSMStateFunctionBuilder<S,D, E> event(List<Object> eventMatches, Class<Q> dataType, Function2<Object, Q, PersistentFSM.State<S, D, E>> apply) Deprecated.Add a case statement that matches on the data type and if any of the event types in the list match or any of the event instances in the list compares equal.Deprecated.Add a case statement that matches if any of the event types in the list match or any of the event instances in the list compares equal.Deprecated.Add a case statement that matches if the predicate matches.<P,Q> FSMStateFunctionBuilder<S, D, E> eventEquals(P event, Class<Q> dataType, Function2<P, Q, PersistentFSM.State<S, D, E>> apply) Deprecated.Add a case statement that matches on the data type and if the event compares equal.<P> FSMStateFunctionBuilder<S,D, E> eventEquals(P event, Function2<P, D, PersistentFSM.State<S, D, E>> apply) Deprecated.Add a case statement that matches if event compares equal.
-
Constructor Details
-
FSMStateFunctionBuilder
public FSMStateFunctionBuilder()Deprecated.
-
-
Method Details
-
event
public final <P,Q> FSMStateFunctionBuilder<S,D, eventE> (Class<P> eventType, Class<Q> dataType, Predicate2<P, Q> predicate, Function2<P, Q, PersistentFSM.State<S, D, E>> apply) Deprecated.Add a case statement that matches on an event and data type and a predicate.- Type Parameters:
P- the event type to match onQ- the data type to match on- Parameters:
eventType- the event type to match ondataType- the data type to match onpredicate- a predicate to evaluate on the matched typesapply- an action to apply to the event and state data if there is a match- Returns:
- the builder with the case statement added
-
event
public <P,Q> FSMStateFunctionBuilder<S,D, eventE> (Class<P> eventType, Class<Q> dataType, Function2<P, Q, PersistentFSM.State<S, D, E>> apply) Deprecated.Add a case statement that matches on an event and data type.- Type Parameters:
P- the event type to match onQ- the data type to match on- Parameters:
eventType- the event type to match ondataType- the data type to match onapply- an action to apply to the event and state data if there is a match- Returns:
- the builder with the case statement added
-
event
public <P> FSMStateFunctionBuilder<S,D, eventE> (Class<P> eventType, Predicate2<P, D> predicate, Function2<P, D, PersistentFSM.State<S, D, E>> apply) Deprecated.Add a case statement that matches if the event type and predicate matches.- Parameters:
eventType- the event type to match onpredicate- a predicate that will be evaluated on the data and the eventapply- an action to apply to the event and state data if there is a match- Returns:
- the builder with the case statement added
-
event
public <P> FSMStateFunctionBuilder<S,D, eventE> (Class<P> eventType, Function2<P, D, PersistentFSM.State<S, D, E>> apply) Deprecated.Add a case statement that matches if the event type and predicate matches.- Parameters:
eventType- the event type to match onapply- an action to apply to the event and state data if there is a match- Returns:
- the builder with the case statement added
-
event
public FSMStateFunctionBuilder<S,D, eventE> (Predicate2<Object, D> predicate, Function2<Object, D, PersistentFSM.State<S, D, E>> apply) Deprecated.Add a case statement that matches if the predicate matches.- Parameters:
predicate- a predicate that will be evaluated on the data and the eventapply- an action to apply to the event and state data if there is a match- Returns:
- the builder with the case statement added
-
event
public <Q> FSMStateFunctionBuilder<S,D, eventE> (List<Object> eventMatches, Class<Q> dataType, Function2<Object, Q, PersistentFSM.State<S, D, E>> apply) Deprecated.Add a case statement that matches on the data type and if any of the event types in the list match or any of the event instances in the list compares equal.- Type Parameters:
Q- the data type to match on- Parameters:
eventMatches- a list of types or instances to match againstdataType- the data type to match onapply- an action to apply to the event and state data if there is a match- Returns:
- the builder with the case statement added
-
event
public FSMStateFunctionBuilder<S,D, eventE> (List<Object> eventMatches, Function2<Object, D, PersistentFSM.State<S, D, E>> apply) Deprecated.Add a case statement that matches if any of the event types in the list match or any of the event instances in the list compares equal.- Parameters:
eventMatches- a list of types or instances to match againstapply- an action to apply to the event and state data if there is a match- Returns:
- the builder with the case statement added
-
eventEquals
public <P,Q> FSMStateFunctionBuilder<S,D, eventEqualsE> (P event, Class<Q> dataType, Function2<P, Q, PersistentFSM.State<S, D, E>> apply) Deprecated.Add a case statement that matches on the data type and if the event compares equal.- Type Parameters:
Q- the data type to match on- Parameters:
event- an event to compare equal againstdataType- the data type to match onapply- an action to apply to the event and state data if there is a match- Returns:
- the builder with the case statement added
-
eventEquals
public <P> FSMStateFunctionBuilder<S,D, eventEqualsE> (P event, Function2<P, D, PersistentFSM.State<S, D, E>> apply) Deprecated.Add a case statement that matches if event compares equal.- Parameters:
event- an event to compare equal againstapply- an action to apply to the event and state data if there is a match- Returns:
- the builder with the case statement added
-
anyEvent
public FSMStateFunctionBuilder<S,D, anyEventE> (Function2<Object, D, PersistentFSM.State<S, D, E>> apply) Deprecated.Add a case statement that matches on any type of event.- Parameters:
apply- an action to apply to the event and state data- Returns:
- the builder with the case statement added
-
build
Deprecated.Build aPartialFunctionfrom this builder. After this call the builder will be reset.- Returns:
- a PartialFunction for this builder.
-