Skip to content

Commit 40ae8d4

Browse files
committed
Introduce ServerResponse Kotlin extensions
Issue: SPR-15293
1 parent 710702a commit 40ae8d4

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
package org.springframework.web.reactive.function.server
2+
3+
import org.reactivestreams.Publisher
4+
5+
/**
6+
* Extension for [ServerResponse.BodyBuilder.body] providing a `body(Publisher<T>)` variant.
7+
*
8+
* @author Sebastien Deleuze
9+
* @since 5.0
10+
*/
11+
inline fun <reified T : Any> ServerResponse.BodyBuilder.body(publisher: Publisher<T>) = body(publisher, T::class.java)

0 commit comments

Comments
 (0)