|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object akka.japi.pf.PFBuilder<I,R>
I
- the input type, that this PartialFunction will be applied toR
- the return type, that the results of the application will havepublic final class PFBuilder<I,R>
A builder for PartialFunction
.
Field Summary | |
---|---|
protected scala.PartialFunction<F,T> |
statements
|
Constructor Summary | |
---|---|
PFBuilder()
Create a PFBuilder. |
Method Summary | ||
---|---|---|
protected void |
addStatement(scala.PartialFunction<F,T> statement)
|
|
scala.PartialFunction<F,T> |
build()
Build a PartialFunction from this builder. |
|
|
match(java.lang.Class<P> type,
FI.Apply<P,R> apply)
Add a new case statement to this builder. |
|
|
match(java.lang.Class<P> type,
FI.TypedPredicate<P> predicate,
FI.Apply<P,R> apply)
Add a new case statement to this builder. |
|
PFBuilder<I,R> |
matchAny(FI.Apply<java.lang.Object,R> apply)
Add a new case statement to this builder, that matches any argument. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected scala.PartialFunction<F,T> statements
Constructor Detail |
---|
public PFBuilder()
Method Detail |
---|
public <P> PFBuilder<I,R> match(java.lang.Class<P> type, FI.Apply<P,R> apply)
type
- a type to match the argument againstapply
- an action to apply to the argument if the type matches
public <P> PFBuilder<I,R> match(java.lang.Class<P> type, FI.TypedPredicate<P> predicate, FI.Apply<P,R> apply)
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 PFBuilder<I,R> matchAny(FI.Apply<java.lang.Object,R> apply)
apply
- an action to apply to the argument
protected void addStatement(scala.PartialFunction<F,T> statement)
public scala.PartialFunction<F,T> build()
PartialFunction
from this builder.
After this call the builder will be reset.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |