[Docs] Fix wrong syntax using paradox directives (#29876)

* Fix wrong syntax using paradox directives
* Simplify collection.md - Only available for Scala, so hide most of the page for Java
This commit is contained in:
Josep Prat 2020-12-10 15:20:14 +01:00 committed by GitHub
parent 374d55cd34
commit 64c27e435b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 23 additions and 34 deletions

View file

@ -3,7 +3,7 @@ project.description: Data immutability using Project Lombok
--- ---
# Immutability using Lombok # Immutability using Lombok
A preferred best practise in Akka is to have immutable messages. Scala provides case class which makes it extremely easy A preferred best practice in Akka is to have immutable messages. Scala provides case class which makes it extremely easy
to have short and clean classes for creating immutable objects, but no such facility is easily available in Java. We can make use to have short and clean classes for creating immutable objects, but no such facility is easily available in Java. We can make use
of several third party libraries which help is achieving this. One good example is Lombok. of several third party libraries which help is achieving this. One good example is Lombok.
@ -17,28 +17,16 @@ Lombok handles the following details for you. It:
* creates correct `equals`, `hashCode` and a human-friendly `toString` * creates correct `equals`, `hashCode` and a human-friendly `toString`
* creates a constructor requiring all fields. * creates a constructor requiring all fields.
### Adding Lombok to your project ### Adding Lombok to your project
To add Lombok to a Maven project, declare it as a simple dependency: To add Lombok to a Maven project, declare it as a simple dependency:
Maven @@dependency[Maven,Gradle] {
: @@dependency { group="org.projectlombok"
<dependency> artifact="lombok"
<groupId>org.projectlombok</groupId> version=1.18.10
<artifactId>lombok</artifactId>
<version>1.18.10</version>
</dependency>
} }
Gradle
: @@dependency {
dependencies {
compileOnly 'org.projectlombok:lombok:1.18.10'
annotationProcessor 'org.projectlombok:lombok:1.18.10'
}
}
# Using lombok # Using lombok
@Value @Value
@ -82,6 +70,8 @@ getter, toString, hashCode, equals.
} }
### Integrating Lombok with an IDE ### Integrating Lombok with an IDE
Lombok integrates with popular IDEs: Lombok integrates with popular IDEs:
* To use Lombok in IntelliJ IDEA you'll need the [Lombok Plugin for IntelliJ IDEA](https://plugins.jetbrains.com/plugin/6317-lombok) and you'll also need to enable Annotation Processing (`Settings / Build,Execution,Deployment / Compiler / Annotation Processors` and tick `Enable annotation processing`) * To use Lombok in IntelliJ IDEA you'll need the [Lombok Plugin for IntelliJ IDEA](https://plugins.jetbrains.com/plugin/6317-lombok) and you'll also need to enable Annotation Processing (`Settings / Build,Execution,Deployment / Compiler / Annotation Processors` and tick `Enable annotation processing`)
* To Use Lombok in Eclipse, run `java -jar lombok.jar` (see the video at [Project Lombok](https://projectlombok.org/)). * To Use Lombok in Eclipse, run `java -jar lombok.jar` (see the video at [Project Lombok](https://projectlombok.org/)).

View file

@ -4,14 +4,15 @@
@ref[Sink operators](../index.md#sink-operators) @ref[Sink operators](../index.md#sink-operators)
@@@div { .group-scala }
## Signature ## Signature
@apidoc[Sink.collection](Sink$) { scala="#collection[T,That](implicitcbf:akka.util.ccompat.Factory[T,Thatwithscala.collection.immutable.Iterable[_]]):akka.stream.scaladsl.Sink[T,scala.concurrent.Future[That]]" } @apidoc[Sink.collection](Sink$) { scala="#collection[T,That](implicitcbf:akka.util.ccompat.Factory[T,Thatwithscala.collection.immutable.Iterable[_]]):akka.stream.scaladsl.Sink[T,scala.concurrent.Future[That]]" }
## Description ## Description
@scala[Collect values emitted from the stream into an arbitrary collection `That`. The resulting collection is available through a `Future[That]` or when the stream completes. Note that the collection boundaries are those defined in the `CanBuildFrom` associated with the chosen collection. See [The Architecture of Scala 2.13's Collections](https://docs.scala-lang.org/overviews/core/architecture-of-scala-213-collections.html) for more info. The [`seq`](seq.html) operator is a shorthand for `Sink.collection[T, Vector[T]]`.]@java[Operator only available in the Scala API. The closest operator in the Java API is [`Sink.seq`](seq.html).] Collect values emitted from the stream into an arbitrary collection `That`. The resulting collection is available through a `Future[That]` or when the stream completes. Note that the collection boundaries are those defined in the `CanBuildFrom` associated with the chosen collection. See [The Architecture of Scala 2.13's Collections](https://docs.scala-lang.org/overviews/core/architecture-of-scala-213-collections.html) for more info. The [`seq`](seq.html) operator is a shorthand for `Sink.collection[T, Vector[T]]`.
## Example ## Example
@ -22,10 +23,10 @@ Scala
## Reactive Streams semantics ## Reactive Streams semantics
@@@ @@@@div { .callout }
@@@div { .group-scala .callout }
**cancels** If too many values are collected **cancels** If too many values are collected
@@@@
@@@ @@@

View file

@ -8,9 +8,7 @@ Never emit any elements, never complete and never fail.
## Signature ## Signature
@@signature [Source.scala](/akka-stream/src/main/scala/akka/stream/scaladsl/Source.scala) { #never } @apidoc[Source.never](Source$) { scala="#never[T]:akka.stream.scaladsl.Source[T,akka.NotUsed]" java="#never()" }
@@@
## Description ## Description