!str #16993 Separate scaladsl/javadsl for FlattenStategy
`abstract class FlattenStrategy` was used in both javadsl and scaladsl, but the concrete concat for the javadsl was in javadsl.FlattenStrategy and the concrete concat for the scaladsl is in stream.FlattenStrategy. Now there are separate FlattenStategy in scaladsl and javadsl packages and conversion as we have in other places. * replace JavaConverters with explicit methods * remove asJava/asScala for FlattenStrategy
This commit is contained in:
parent
4a16067cd8
commit
666bfade1e
22 changed files with 45 additions and 82 deletions
|
|
@ -286,6 +286,9 @@ final class Flow[-In, +Out, +Mat](private[stream] override val module: Module)
|
|||
this.section[O, O2, Mat2, Mat2](attributes, Keep.right)(section)
|
||||
}
|
||||
|
||||
/** Converts this Scala DSL element to it's Java DSL counterpart. */
|
||||
def asJava: javadsl.Flow[In, Out, Mat] = new javadsl.Flow(this)
|
||||
|
||||
}
|
||||
|
||||
object Flow extends FlowApply {
|
||||
|
|
@ -627,8 +630,8 @@ trait FlowOps[+Out, +Mat] {
|
|||
* Transforms a stream of streams into a contiguous stream of elements using the provided flattening strategy.
|
||||
* This operation can be used on a stream of element type [[akka.stream.scaladsl.Source]].
|
||||
*/
|
||||
def flatten[U](strategy: akka.stream.FlattenStrategy[Out, U]): Repr[U, Mat] = strategy match {
|
||||
case _: FlattenStrategy.Concat[Out] ⇒ andThen(ConcatAll())
|
||||
def flatten[U](strategy: FlattenStrategy[Out, U]): Repr[U, Mat] = strategy match {
|
||||
case _: FlattenStrategy.Concat[Out] | _: javadsl.FlattenStrategy.Concat[Out] ⇒ andThen(ConcatAll())
|
||||
case _ ⇒
|
||||
throw new IllegalArgumentException(s"Unsupported flattening strategy [${strategy.getClass.getName}]")
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue