object BehaviorBuilder
- Source
- BehaviorBuilder.scala
- Alphabetic
- By Inheritance
- BehaviorBuilder
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Value Members
- def create[T]: BehaviorBuilder[T]
-
def
message[T, M <: T](type: Class[M], test: Predicate[M], handler: Function2[ActorContext[T], M, Behavior[T]]): BehaviorBuilder[T]
Start a new behavior chain starting with this predicated case.
Start a new behavior chain starting with this predicated case.
- T
type of behavior to create
- M
type of message to match
- type
type of message to match
- test
a predicate that will be evaluated on the argument if the type matches
- handler
action to apply if the type matches and the predicate returns true
- returns
a new behavior with the specified handling appended
-
def
message[T, M <: T](type: Class[M], handler: Function2[ActorContext[T], M, Behavior[T]]): BehaviorBuilder[T]
Start a new behavior chain starting with this case.
Start a new behavior chain starting with this case.
- T
type of behavior to create
- M
type of message to match
- type
type of message to match
- handler
action to apply if the type matches
- returns
a new behavior with the specified handling appended
-
def
messageEquals[T](msg: T, handler: Function[ActorContext[T], Behavior[T]]): BehaviorBuilder[T]
Start a new behavior chain starting with a handler for equal messages.
Start a new behavior chain starting with a handler for equal messages.
- T
type of behavior to create
- msg
the message to compare to
- handler
action to apply when the message matches
- returns
a new behavior with the specified handling appended
-
def
messageUnchecked[T, M <: T](type: Class[_ <: T], handler: Function2[ActorContext[T], M, Behavior[T]]): BehaviorBuilder[T]
Start a new behavior chain starting with a handler without compile time type check.
Start a new behavior chain starting with a handler without compile time type check.
Should normally not be used, but when matching on class with generic type argument it can be useful, e.g.
List.class
and(List<String> list) -> {...}
- type
type of message to match
- handler
action to apply when the type matches
- returns
a new behavior with the specified handling appended
-
def
signal[T, M <: Signal](type: Class[M], test: Predicate[M], handler: Function2[ActorContext[T], M, Behavior[T]]): BehaviorBuilder[T]
Start a new behavior chain starting with this predicated signal case.
Start a new behavior chain starting with this predicated signal case.
- T
type of behavior to create
- M
type of signal to match
- type
type of signals to match
- test
a predicate that will be evaluated on the argument if the type matches
- handler
action to apply if the type matches and the predicate returns true
- returns
a new behavior with the specified handling appended
-
def
signal[T, M <: Signal](type: Class[M], handler: Function2[ActorContext[T], M, Behavior[T]]): BehaviorBuilder[T]
Start a new behavior chain starting with this signal case.
Start a new behavior chain starting with this signal case.
- T
type of behavior to create
- M
type of signal to match
- type
type of signal to match
- handler
action to apply if the type matches
- returns
a new behavior with the specified handling appended
-
def
signalEquals[T](signal: Signal, handler: Function[ActorContext[T], Behavior[T]]): BehaviorBuilder[T]
Start a new behavior chain starting with a handler for this specific signal.
Start a new behavior chain starting with a handler for this specific signal.
- T
type of behavior to create
- signal
the signal to compare to
- handler
action to apply when the message matches
- returns
a new behavior with the specified handling appended
-
def
signalUnchecked[T, M <: Signal](type: Class[_ <: Signal], handler: Function2[ActorContext[T], M, Behavior[T]]): BehaviorBuilder[T]
Start a new behavior chain starting with this unchecked signal case.
Start a new behavior chain starting with this unchecked signal case.
Should normally not be used, but when matching on class with generic type argument it can be useful, e.g.
GenMsg.class
and(ActorContext
ctx, GenMsg<String> list) -> {...} - type
type of signal to match
- handler
action to apply when the type matches
- returns
a new behavior with the specified handling appended