Introduce ServerResponse Kotlin extensions

Issue: SPR-15293
This commit is contained in:
Sebastien Deleuze 2017-02-27 19:35:56 +01:00
parent 710702acdc
commit 40ae8d41a4
1 changed files with 11 additions and 0 deletions

View File

@ -0,0 +1,11 @@
package org.springframework.web.reactive.function.server
import org.reactivestreams.Publisher
/**
* Extension for [ServerResponse.BodyBuilder.body] providing a `body(Publisher<T>)` variant.
*
* @author Sebastien Deleuze
* @since 5.0
*/
inline fun <reified T : Any> ServerResponse.BodyBuilder.body(publisher: Publisher<T>) = body(publisher, T::class.java)