pjfanning opened a new pull request, #1374: URL: https://github.com/apache/pekko-http/pull/1374
### Motivation The Java DSL `Trailer.addHeaders` and `Trailer.withHeaders` only accept a `scala.collection.Iterable`. Java users have no convenient way to build one, so adding several HTTP/2 trailer headers from Java means calling `addHeader` repeatedly. ### Modification - Add `java.lang.Iterable<HttpHeader>` overloads of `addHeaders` and `withHeaders` to the javadsl `Trailer` trait. They are concrete and delegate to the existing methods. - The scaladsl `Trailer` overrides the new overloads so they keep returning the scaladsl `Trailer` type. The existing Scala-typed methods are unchanged. ### Result Java users can write `Trailer.create().addHeaders(List.of(...))` and `trailer.withHeaders(list)`. ### Tests - `sbt "http-core/Test/testOnly org.apache.pekko.http.javadsl.model.TrailerTest"` - passed (new Java test for both overloads) - `sbt http-core/mimaReportBinaryIssues` - passed - `sbt http-core/scalafmt http-core/Test/javafmt` - formatted the new test ### References None - Java DSL cleanup of Scala types in public API 🤖 Generated with [Claude Code](https://claude.com/claude-code) -- 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]
