|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object akka.japi.pf.UnitMatch<I>
I
- the input type, that this PartialFunction will be applied to
This is an EXPERIMENTAL feature and is subject to change until it has received more real world testing.public class UnitMatch<I>
Version of PartialFunction
that can be built during
runtime from Java.
This is a specialized version of UnitMatch
to map java
void methods to BoxedUnit
.
Field Summary | |
---|---|
protected scala.PartialFunction<I,R> |
statements
|
Method Summary | ||
---|---|---|
scala.PartialFunction<I,R> |
asPF()
Turn this Match into a PartialFunction . |
|
static
|
create(UnitPFBuilder<F> builder)
Create a UnitMatch from the builder. |
|
static
|
match(java.lang.Class<P> type,
FI.TypedPredicate<P> predicate,
FI.UnitApply<P> apply)
Convenience function to create a UnitPFBuilder with the first
case statement added. |
|
static
|
match(java.lang.Class<P> type,
FI.UnitApply<P> apply)
Convenience function to create a UnitPFBuilder with the first
case statement added. |
|
void |
match(I i)
Convenience function to make the Java code more readable. |
|
static
|
matchAny(FI.UnitApply<java.lang.Object> apply)
Convenience function to create a UnitPFBuilder with the first
case statement added. |
|
static
|
matchEquals(P object,
FI.TypedPredicate<P> predicate,
FI.UnitApply<P> apply)
Convenience function to create a UnitPFBuilder with the first
case statement added. |
|
static
|
matchEquals(P object,
FI.UnitApply<P> apply)
Convenience function to create a UnitPFBuilder with the first
case statement added. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected final scala.PartialFunction<I,R> statements
Method Detail |
---|
public static final <F,P> UnitPFBuilder<F> match(java.lang.Class<P> type, FI.UnitApply<P> apply)
UnitPFBuilder
with the first
case statement added.
type
- a type to match the argument againstapply
- an action to apply to the argument if the type matches
UnitPFBuilder.match(Class, FI.UnitApply)
public static <F,P> UnitPFBuilder<F> match(java.lang.Class<P> type, FI.TypedPredicate<P> predicate, FI.UnitApply<P> apply)
UnitPFBuilder
with the first
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 and predicate matches
UnitPFBuilder.match(Class, FI.TypedPredicate, FI.UnitApply)
public static <F,P> UnitPFBuilder<F> matchEquals(P object, FI.UnitApply<P> apply)
UnitPFBuilder
with the first
case statement added.
object
- the object to compare equals withapply
- an action to apply to the argument if the object compares equal
UnitPFBuilder.matchEquals(Object, FI.UnitApply)
public static <F,P> UnitPFBuilder<F> matchEquals(P object, FI.TypedPredicate<P> predicate, FI.UnitApply<P> apply)
UnitPFBuilder
with the first
case statement added.
object
- the object to compare equals withpredicate
- a predicate that will be evaluated on the argument the object compares equalapply
- an action to apply to the argument if the object compares equal
UnitPFBuilder.matchEquals(Object, FI.UnitApply)
public static <F> UnitPFBuilder<F> matchAny(FI.UnitApply<java.lang.Object> apply)
UnitPFBuilder
with the first
case statement added.
apply
- an action to apply to the argument
UnitPFBuilder.matchAny(FI.UnitApply)
public static <F> UnitMatch<F> create(UnitPFBuilder<F> builder)
UnitMatch
from the builder.
builder
- a builder representing the partial function
UnitMatch
that can be reusedpublic void match(I i) throws scala.MatchError
UnitMatcher<X> matcher = UnitMatcher.create(...);
matcher.match(obj);
i
- the argument to apply the match to
scala.MatchError
- if there is no matchpublic scala.PartialFunction<I,R> asPF()
Match
into a PartialFunction
.
Match
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |