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

@ -9,31 +9,31 @@ import java.util.stream.Stream;
import akka.NotUsed;
import akka.japi.Pair;
import akka.stream.javadsl.*;
//#asPublisher-import
// #asPublisher-import
import static akka.stream.javadsl.AsPublisher.*;
//#asPublisher-import
// #asPublisher-import
public class MigrationsJava {
public static void main(String[] args) {
//#expand-continually
// #expand-continually
Flow.of(Integer.class).expand(in -> Stream.iterate(in, i -> i).iterator());
//#expand-continually
//#expand-state
Flow.of(Integer.class).expand(in ->
Stream.iterate(new Pair<>(in, 0),
p -> new Pair<>(in, p.second() + 1)).iterator());
//#expand-state
//#asPublisher
Sink.asPublisher(WITH_FANOUT); // instead of Sink.asPublisher(true)
Sink.asPublisher(WITHOUT_FANOUT); // instead of Sink.asPublisher(false)
//#asPublisher
// #expand-continually
// #expand-state
Flow.of(Integer.class)
.expand(
in ->
Stream.iterate(new Pair<>(in, 0), p -> new Pair<>(in, p.second() + 1)).iterator());
// #expand-state
//#async
// #asPublisher
Sink.asPublisher(WITH_FANOUT); // instead of Sink.asPublisher(true)
Sink.asPublisher(WITHOUT_FANOUT); // instead of Sink.asPublisher(false)
// #asPublisher
// #async
Flow<Integer, Integer, NotUsed> flow = Flow.of(Integer.class).map(n -> n + 1);
Source.range(1, 10).via(flow.async());
//#async
// #async
}
}