Add Kotlin WebClient extensions

This commit is contained in:
Sebastien Deleuze
2017-02-01 11:20:53 +01:00
parent 2c94ee2043
commit 99deb387ed

View File

@@ -0,0 +1,13 @@
package org.springframework.web.reactive.function.client
import org.reactivestreams.Publisher
/**
* Extension for [WebClient.HeaderSpec.exchange] providing a variant without explicit class
* parameter thanks to Kotlin reified type parameters.
*
* @author Sebastien Deleuze
* @since 5.0
*/
inline fun <reified T : Any, S : Publisher<T>> WebClient.HeaderSpec.exchange(publisher: S) =
exchange(publisher, T::class.java)