akka.japi.pf
Class FSMStopBuilder<S,D>

java.lang.Object
  extended by akka.japi.pf.FSMStopBuilder<S,D>
Type Parameters:
S - the state type
D - the data type This is an EXPERIMENTAL feature and is subject to change until it has received more real world testing.

public class FSMStopBuilder<S,D>
extends java.lang.Object

Builder used to create a partial function for FSM.onTermination(scala.PartialFunction, scala.runtime.BoxedUnit>).


Constructor Summary
FSMStopBuilder()
           
 
Method Summary
 scala.PartialFunction<FSM.StopEvent<S,D>,scala.runtime.BoxedUnit> build()
          Build a PartialFunction from this builder.
<P extends FSM.Reason>
FSMStopBuilder<S,D>
stop(java.lang.Class<P> reasonType, FI.TypedPredicate<P> predicate, FI.UnitApply3<P,S,D> apply)
          Add a case statement that matches on a reason type and a predicate.
<P extends FSM.Reason>
FSMStopBuilder<S,D>
stop(java.lang.Class<P> reasonType, FI.UnitApply3<P,S,D> apply)
          Add a case statement that matches on a reason type.
 FSMStopBuilder<S,D> stop(FSM.Reason reason, FI.UnitApply2<S,D> apply)
          Add a case statement that matches on an FSM.Reason.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FSMStopBuilder

public FSMStopBuilder()
Method Detail

stop

public FSMStopBuilder<S,D> stop(FSM.Reason reason,
                                FI.UnitApply2<S,D> apply)
Add a case statement that matches on an FSM.Reason.

Parameters:
reason - the reason for the termination
apply - an action to apply to the event and state data if there is a match
Returns:
the builder with the case statement added

stop

public <P extends FSM.Reason> FSMStopBuilder<S,D> stop(java.lang.Class<P> reasonType,
                                                       FI.UnitApply3<P,S,D> apply)
Add a case statement that matches on a reason type.

Type Parameters:
P - the reason type to match on
Parameters:
reasonType - the reason type to match on
apply - an action to apply to the reason, event and state data if there is a match
Returns:
the builder with the case statement added

stop

public <P extends FSM.Reason> FSMStopBuilder<S,D> stop(java.lang.Class<P> reasonType,
                                                       FI.TypedPredicate<P> predicate,
                                                       FI.UnitApply3<P,S,D> apply)
Add a case statement that matches on a reason type and a predicate.

Type Parameters:
P - the reason type to match on
Parameters:
reasonType - the reason type to match on
apply - an action to apply to the reason, event and state data if there is a match
predicate - a predicate that will be evaluated on the reason if the type matches
Returns:
the builder with the case statement added

build

public scala.PartialFunction<FSM.StopEvent<S,D>,scala.runtime.BoxedUnit> build()
Build a PartialFunction from this builder. After this call the builder will be reset.

Returns:
a PartialFunction for this builder.