Package akka.japi.pf
Class FSMStateFunctionBuilder<S,D>
- java.lang.Object
-
- akka.japi.pf.FSMStateFunctionBuilder<S,D>
-
- Type Parameters:
S
- the state typeD
- the data type
public class FSMStateFunctionBuilder<S,D> extends java.lang.Object
Builder used to create a partial function forFSM.whenUnhandled(scala.PartialFunction<akka.actor.FSM.Event<D>, akka.actor.FSM.State<S, D>>)
.
-
-
Constructor Summary
Constructors Constructor Description FSMStateFunctionBuilder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description FSMStateFunctionBuilder<S,D>
anyEvent(FI.Apply2<java.lang.Object,D,FSM.State<S,D>> apply)
Add a case statement that matches on any type of event.scala.PartialFunction<FSM.Event<D>,FSM.State<S,D>>
build()
Build aPartialFunction
from this builder.FSMStateFunctionBuilder<S,D>
event(FI.TypedPredicate2<java.lang.Object,D> predicate, FI.Apply2<java.lang.Object,D,FSM.State<S,D>> apply)
Add a case statement that matches if the predicate matches.<P> FSMStateFunctionBuilder<S,D>
event(java.lang.Class<P> eventType, FI.Apply2<P,D,FSM.State<S,D>> apply)
Add a case statement that matches if the event type and predicate matches.<P> FSMStateFunctionBuilder<S,D>
event(java.lang.Class<P> eventType, FI.TypedPredicate2<P,D> predicate, FI.Apply2<P,D,FSM.State<S,D>> apply)
Add a case statement that matches if the event type and predicate matches.<P,Q>
FSMStateFunctionBuilder<S,D>event(java.lang.Class<P> eventType, java.lang.Class<Q> dataType, FI.Apply2<P,Q,FSM.State<S,D>> apply)
Add a case statement that matches on an event and data type.<P,Q>
FSMStateFunctionBuilder<S,D>event(java.lang.Class<P> eventType, java.lang.Class<Q> dataType, FI.TypedPredicate2<P,Q> predicate, FI.Apply2<P,Q,FSM.State<S,D>> apply)
Add a case statement that matches on an event and data type and a predicate.FSMStateFunctionBuilder<S,D>
event(java.util.List<java.lang.Object> eventMatches, FI.Apply2<java.lang.Object,D,FSM.State<S,D>> apply)
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.<Q> FSMStateFunctionBuilder<S,D>
event(java.util.List<java.lang.Object> eventMatches, java.lang.Class<Q> dataType, FI.Apply2<java.lang.Object,Q,FSM.State<S,D>> apply)
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.<P> FSMStateFunctionBuilder<S,D>
eventEquals(P event, FI.Apply2<P,D,FSM.State<S,D>> apply)
Add a case statement that matches if event compares equal.<P,Q>
FSMStateFunctionBuilder<S,D>eventEquals(P event, java.lang.Class<Q> dataType, FI.Apply2<P,Q,FSM.State<S,D>> apply)
Add a case statement that matches on the data type and if the event compares equal.
-
-
-
Method Detail
-
event
public final <P,Q> FSMStateFunctionBuilder<S,D> event(java.lang.Class<P> eventType, java.lang.Class<Q> dataType, FI.TypedPredicate2<P,Q> predicate, FI.Apply2<P,Q,FSM.State<S,D>> apply)
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> event(java.lang.Class<P> eventType, java.lang.Class<Q> dataType, FI.Apply2<P,Q,FSM.State<S,D>> apply)
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> event(java.lang.Class<P> eventType, FI.TypedPredicate2<P,D> predicate, FI.Apply2<P,D,FSM.State<S,D>> apply)
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> event(java.lang.Class<P> eventType, FI.Apply2<P,D,FSM.State<S,D>> apply)
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> event(FI.TypedPredicate2<java.lang.Object,D> predicate, FI.Apply2<java.lang.Object,D,FSM.State<S,D>> apply)
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> event(java.util.List<java.lang.Object> eventMatches, java.lang.Class<Q> dataType, FI.Apply2<java.lang.Object,Q,FSM.State<S,D>> apply)
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> event(java.util.List<java.lang.Object> eventMatches, FI.Apply2<java.lang.Object,D,FSM.State<S,D>> apply)
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> eventEquals(P event, java.lang.Class<Q> dataType, FI.Apply2<P,Q,FSM.State<S,D>> apply)
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> eventEquals(P event, FI.Apply2<P,D,FSM.State<S,D>> apply)
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> anyEvent(FI.Apply2<java.lang.Object,D,FSM.State<S,D>> apply)
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
-
-