!str #18692 javadsl.FlowGraph.Builder.add()

* also make factories more consistent by only offering
  FlowGraph.create()
* also remove secondary (edge-based) FlowGraph.Builder DSL
* also improve naming for conversions from Graph to
  Source/Flow/BidiFlow/Sink
This commit is contained in:
Viktor Klang 2015-10-21 22:45:39 +02:00 committed by Roland Kuhn
parent 0f99a42df9
commit f29d7affbd
120 changed files with 1535 additions and 1897 deletions

View file

@ -15,14 +15,6 @@ import scala.util.Try
/** Java API */
object Sink {
val factory: SinkCreate = new SinkCreate {}
/** Adapt [[scaladsl.Sink]] for use within Java DSL */
//FIXME: Is this needed now?
def adapt[O, M](sink: scaladsl.Sink[O, M]): javadsl.Sink[O, M] =
new Sink(sink)
/**
* A `Sink` that will invoke the given function for every received element, giving it its previous
* output (or the given `zero` value) and the element as input.
@ -133,10 +125,10 @@ object Sink {
* A graph with the shape of a sink logically is a sink, this method makes
* it so also in type.
*/
def wrap[T, M](g: Graph[SinkShape[T], M]): Sink[T, M] =
def fromGraph[T, M](g: Graph[SinkShape[T], M]): Sink[T, M] =
g match {
case s: Sink[T, M] s
case other new Sink(scaladsl.Sink.wrap(other))
case other new Sink(scaladsl.Sink.fromGraph(other))
}
/**