#16245 fix formatting and delete usages of diamond operator
This commit is contained in:
parent
7cd4a68cee
commit
c191fc58dc
6 changed files with 29 additions and 29 deletions
|
|
@ -13,8 +13,8 @@ import scala.PartialFunction;
|
|||
*
|
||||
* @param <I> the input type, that this PartialFunction will be applied to
|
||||
* @param <R> the return type, that the results of the application will have
|
||||
* <p>
|
||||
* This is an EXPERIMENTAL feature and is subject to change until it has received more real world testing.
|
||||
*
|
||||
* This is an EXPERIMENTAL feature and is subject to change until it has received more real world testing.
|
||||
*/
|
||||
public class Match<I, R> extends AbstractMatch<I, R> {
|
||||
|
||||
|
|
|
|||
|
|
@ -9,8 +9,8 @@ package akka.japi.pf;
|
|||
*
|
||||
* @param <I> the input type, that this PartialFunction will be applied to
|
||||
* @param <R> the return type, that the results of the application will have
|
||||
* <p>
|
||||
* This is an EXPERIMENTAL feature and is subject to change until it has received more real world testing.
|
||||
*
|
||||
* This is an EXPERIMENTAL feature and is subject to change until it has received more real world testing.
|
||||
*/
|
||||
public final class PFBuilder<I, R> extends AbstractPFBuilder<I, R> {
|
||||
|
||||
|
|
|
|||
|
|
@ -6,29 +6,29 @@ package akka.japi.pf;
|
|||
|
||||
/**
|
||||
* Used for building a partial function for {@link akka.actor.Actor#receive() Actor.receive()}.
|
||||
* <p>
|
||||
*
|
||||
* There is both a match on type only, and a match on type and predicate.
|
||||
* <p>
|
||||
*
|
||||
* Inside an actor you can use it like this with Java 8 to define your receive method.
|
||||
* <p>
|
||||
* <p/>
|
||||
* Example:
|
||||
* <pre>
|
||||
*
|
||||
* @Override public Actor() {
|
||||
* receive(ReceiveBuilder.
|
||||
* match(Double.class, d -> {
|
||||
* sender().tell(d.isNaN() ? 0 : d, self());
|
||||
* }).
|
||||
* match(Integer.class, i -> {
|
||||
* sender().tell(i * 10, self());
|
||||
* }).
|
||||
* match(String.class, s -> s.startsWith("foo"), s -> {
|
||||
* sender().tell(s.toUpperCase(), self());
|
||||
* }).build()
|
||||
* );
|
||||
* @Override
|
||||
* public Actor() {
|
||||
* receive(ReceiveBuilder.
|
||||
* match(Double.class, d -> {
|
||||
* sender().tell(d.isNaN() ? 0 : d, self());
|
||||
* }).
|
||||
* match(Integer.class, i -> {
|
||||
* sender().tell(i * 10, self());
|
||||
* }).
|
||||
* match(String.class, s -> s.startsWith("foo"), s -> {
|
||||
* sender().tell(s.toUpperCase(), self());
|
||||
* }).build()
|
||||
* );
|
||||
* }
|
||||
* </pre>
|
||||
* <p>
|
||||
*
|
||||
* This is an EXPERIMENTAL feature and is subject to change until it has received more real world testing.
|
||||
*/
|
||||
public class ReceiveBuilder {
|
||||
|
|
|
|||
|
|
@ -15,8 +15,8 @@ import scala.runtime.BoxedUnit;
|
|||
* void methods to {@link scala.runtime.BoxedUnit}.
|
||||
*
|
||||
* @param <I> the input type, that this PartialFunction will be applied to
|
||||
* <p>
|
||||
* This is an EXPERIMENTAL feature and is subject to change until it has received more real world testing.
|
||||
*
|
||||
* This is an EXPERIMENTAL feature and is subject to change until it has received more real world testing.
|
||||
*/
|
||||
public class UnitMatch<I> extends AbstractMatch<I, BoxedUnit> {
|
||||
|
||||
|
|
|
|||
|
|
@ -12,8 +12,8 @@ import scala.runtime.BoxedUnit;
|
|||
* void methods to {@link scala.runtime.BoxedUnit}.
|
||||
*
|
||||
* @param <I> the input type, that this PartialFunction to be applied to
|
||||
* <p>
|
||||
* This is an EXPERIMENTAL feature and is subject to change until it has received more real world testing.
|
||||
*
|
||||
* This is an EXPERIMENTAL feature and is subject to change until it has received more real world testing.
|
||||
*/
|
||||
public final class UnitPFBuilder<I> extends AbstractPFBuilder<I, BoxedUnit> {
|
||||
|
||||
|
|
@ -47,7 +47,7 @@ public final class UnitPFBuilder<I> extends AbstractPFBuilder<I, BoxedUnit> {
|
|||
}
|
||||
|
||||
/**
|
||||
* Add a new case statement to this b uilder.
|
||||
* Add a new case statement to this builder.
|
||||
*
|
||||
* @param type a type to match the argument against
|
||||
* @param predicate a predicate that will be evaluated on the argument if the type matches
|
||||
|
|
|
|||
|
|
@ -102,7 +102,7 @@ public class InitializationDocTest {
|
|||
public void testGenericActor() {
|
||||
new JavaTestKit(system) {{
|
||||
ActorRef genericTestActor = system.actorOf(Props.create(GenericActor.class), "genericActor");
|
||||
GenericMessage<String> genericMessage = new GenericMessage<>("a");
|
||||
GenericMessage<String> genericMessage = new GenericMessage<String>("a");
|
||||
|
||||
genericTestActor.tell(genericMessage, getRef());
|
||||
expectMsgEquals("A");
|
||||
|
|
@ -113,8 +113,8 @@ public class InitializationDocTest {
|
|||
public void actorShouldNotRespondForEmptyMessage() {
|
||||
new JavaTestKit(system) {{
|
||||
ActorRef genericTestActor = system.actorOf(Props.create(GenericActorWithPredicate.class), "genericActorWithPredicate");
|
||||
GenericMessage<String> emptyGenericMessage = new GenericMessage<>("");
|
||||
GenericMessage<String> nonEmptyGenericMessage = new GenericMessage<>("a");
|
||||
GenericMessage<String> emptyGenericMessage = new GenericMessage<String>("");
|
||||
GenericMessage<String> nonEmptyGenericMessage = new GenericMessage<String>("a");
|
||||
|
||||
genericTestActor.tell(emptyGenericMessage, getRef());
|
||||
expectNoMsg();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue