He-Pin commented on code in PR #1374:
URL: https://github.com/apache/pekko-http/pull/1374#discussion_r4376978303
##########
http-core/src/main/scala/org/apache/pekko/http/javadsl/model/Trailer.scala:
##########
@@ -32,6 +34,20 @@ trait Trailer {
* Returns a copy of this trailer with new headers.
*/
def withHeaders(headers: Iterable[HttpHeader]): Trailer
+
+ /**
+ * Java API: Returns a copy of this trailer with the given headers added to
the list of headers.
+ *
+ * @since 2.0.0
+ */
+ def addHeaders(headers: java.lang.Iterable[HttpHeader]): Trailer =
addHeaders(headers.asScala)
Review Comment:
`_<: java.lang.Iterable[HttpHeader]`
##########
http-core/src/main/scala/org/apache/pekko/http/javadsl/model/Trailer.scala:
##########
@@ -32,6 +34,20 @@ trait Trailer {
* Returns a copy of this trailer with new headers.
*/
def withHeaders(headers: Iterable[HttpHeader]): Trailer
+
+ /**
+ * Java API: Returns a copy of this trailer with the given headers added to
the list of headers.
+ *
+ * @since 2.0.0
+ */
+ def addHeaders(headers: java.lang.Iterable[HttpHeader]): Trailer =
addHeaders(headers.asScala)
+
+ /**
+ * Java API: Returns a copy of this trailer with new headers.
+ *
+ * @since 2.0.0
+ */
+ def withHeaders(headers: java.lang.Iterable[HttpHeader]): Trailer =
withHeaders(headers.asScala)
}
Review Comment:
`_<:`
##########
http-core/src/main/scala/org/apache/pekko/http/scaladsl/model/Trailer.scala:
##########
@@ -37,6 +39,16 @@ class Trailer(@ApiMayChange val headers: Seq[(String,
String)]) extends jm.Trail
* Java API
*/
override def withHeaders(headers: Iterable[jm.HttpHeader]): Trailer =
Trailer(Seq.empty).addHeaders(headers)
+
+ /**
+ * Java API
+ */
+ override def addHeaders(headers: java.lang.Iterable[jm.HttpHeader]): Trailer
= addHeaders(headers.asScala)
+
+ /**
+ * Java API
+ */
+ override def withHeaders(headers: java.lang.Iterable[jm.HttpHeader]):
Trailer = withHeaders(headers.asScala)
Review Comment:
`_<:*`
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]