Formatting java codes with sbt-java-formatter.

This commit is contained in:
hepin1989 2019-01-12 04:00:53 +08:00
parent 27500001ea
commit 998c5a9285
401 changed files with 19750 additions and 17450 deletions

View file

@ -4,23 +4,23 @@
package jdocs.actor;
//#timers
// #timers
import java.time.Duration;
import akka.actor.AbstractActorWithTimers;
//#timers
// #timers
public class TimerDocTest {
static
//#timers
public class MyActor extends AbstractActorWithTimers {
public
// #timers
static class MyActor extends AbstractActorWithTimers {
private static Object TICK_KEY = "TickKey";
private static final class FirstTick {
}
private static final class Tick {
}
private static final class FirstTick {}
private static final class Tick {}
public MyActor() {
getTimers().startSingleTimer(TICK_KEY, new FirstTick(), Duration.ofMillis(500));
@ -29,15 +29,19 @@ public class TimerDocTest {
@Override
public Receive createReceive() {
return receiveBuilder()
.match(FirstTick.class, message -> {
// do something useful here
getTimers().startPeriodicTimer(TICK_KEY, new Tick(), Duration.ofSeconds(1));
})
.match(Tick.class, message -> {
// do something useful here
})
.build();
.match(
FirstTick.class,
message -> {
// do something useful here
getTimers().startPeriodicTimer(TICK_KEY, new Tick(), Duration.ofSeconds(1));
})
.match(
Tick.class,
message -> {
// do something useful here
})
.build();
}
}
//#timers
// #timers
}