|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectakka.japi.pf.ReceiveBuilder
public class ReceiveBuilder
Used for building a partial function for Actor.receive().
There is both a match on type only, and a match on type and predicate.
Inside an actor you can use it like this with Java 8 to define your receive method.
| Method Summary | ||
|---|---|---|
static
|
match(java.lang.Class<P> type,
FI.TypedPredicate<P> predicate,
FI.UnitApply<P> apply)
Return a new UnitPFBuilder with a case statement added. |
|
static
|
match(java.lang.Class<P> type,
FI.UnitApply<P> apply)
Return a new UnitPFBuilder with a case statement added. |
|
static UnitPFBuilder<java.lang.Object> |
matchAny(FI.UnitApply<java.lang.Object> apply)
Return a new UnitPFBuilder with a case statement added. |
|
static
|
matchEquals(P object,
FI.TypedPredicate<P> predicate,
FI.UnitApply<P> apply)
Return a new UnitPFBuilder with a case statement added. |
|
static
|
matchEquals(P object,
FI.UnitApply<P> apply)
Return a new UnitPFBuilder with a case statement added. |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static <P> UnitPFBuilder<java.lang.Object> match(java.lang.Class<P> type,
FI.UnitApply<P> apply)
UnitPFBuilder with a case statement added.
type - a type to match the argument againstapply - an action to apply to the argument if the type matches
public static <P> UnitPFBuilder<java.lang.Object> match(java.lang.Class<P> type,
FI.TypedPredicate<P> predicate,
FI.UnitApply<P> apply)
UnitPFBuilder with a case statement added.
type - a type to match the argument againstpredicate - a predicate that will be evaluated on the argument if the type matchesapply - an action to apply to the argument if the type matches and the predicate returns true
public static <P> UnitPFBuilder<java.lang.Object> matchEquals(P object,
FI.UnitApply<P> apply)
UnitPFBuilder with a case statement added.
object - the object to compare equals withapply - an action to apply to the argument if the object compares equal
public static <P> UnitPFBuilder<java.lang.Object> matchEquals(P object,
FI.TypedPredicate<P> predicate,
FI.UnitApply<P> apply)
UnitPFBuilder with a case statement added.
object - the object to compare equals withpredicate - a predicate that will be evaluated on the argument if the object compares equalapply - an action to apply to the argument if the object compares equal
public static UnitPFBuilder<java.lang.Object> matchAny(FI.UnitApply<java.lang.Object> apply)
UnitPFBuilder with a case statement added.
apply - an action to apply to the argument
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||