Improve Kotlin extensions doc about type erasure
Since type erasure can be fixed only when using ParameterizedTypeReference based Java methods, RestOperations and WebFlux API documentation should be updated to specify which extensions are subject to type erasure, and which are not. Issue: SPR-16273
This commit is contained in:
@@ -23,7 +23,8 @@ import reactor.core.publisher.Mono
|
||||
|
||||
/**
|
||||
* Extension for [ClientResponse.bodyToMono] providing a `bodyToMono<Foo>()` variant
|
||||
* leveraging Kotlin reified type parameters.
|
||||
* leveraging Kotlin reified type parameters. This extension is not subject to type
|
||||
* erasure and retains actual generic type arguments.
|
||||
*
|
||||
* @author Sebastien Deleuze
|
||||
* @since 5.0
|
||||
@@ -33,7 +34,8 @@ inline fun <reified T : Any> ClientResponse.bodyToMono(): Mono<T> =
|
||||
|
||||
/**
|
||||
* Extension for [ClientResponse.bodyToFlux] providing a `bodyToFlux<Foo>()` variant
|
||||
* leveraging Kotlin reified type parameters.
|
||||
* leveraging Kotlin reified type parameters. This extension is not subject to type
|
||||
* erasure and retains actual generic type arguments.
|
||||
*
|
||||
* @author Sebastien Deleuze
|
||||
* @since 5.0
|
||||
@@ -43,7 +45,8 @@ inline fun <reified T : Any> ClientResponse.bodyToFlux(): Flux<T> =
|
||||
|
||||
/**
|
||||
* Extension for [ClientResponse.toEntity] providing a `toEntity<Foo>()` variant
|
||||
* leveraging Kotlin reified type parameters.
|
||||
* leveraging Kotlin reified type parameters. This extension is not subject to type
|
||||
* erasure and retains actual generic type arguments.
|
||||
*
|
||||
* @author Sebastien Deleuze
|
||||
* @since 5.0
|
||||
@@ -53,7 +56,8 @@ inline fun <reified T : Any> ClientResponse.toEntity(): Mono<ResponseEntity<T>>
|
||||
|
||||
/**
|
||||
* Extension for [ClientResponse.toEntityList] providing a `bodyToEntityList<Foo>()` variant
|
||||
* leveraging Kotlin reified type parameters.
|
||||
* leveraging Kotlin reified type parameters. This extension is not subject to type
|
||||
* erasure and retains actual generic type arguments.
|
||||
*
|
||||
* @author Sebastien Deleuze
|
||||
* @since 5.0
|
||||
|
||||
@@ -25,7 +25,8 @@ import reactor.core.publisher.Mono
|
||||
|
||||
/**
|
||||
* Extension for [WebClient.RequestBodySpec.body] providing a `body<Foo>()` variant
|
||||
* leveraging Kotlin reified type parameters.
|
||||
* leveraging Kotlin reified type parameters. This extension is not subject to type
|
||||
* erasure and retains actual generic type arguments.
|
||||
*
|
||||
* @author Sebastien Deleuze
|
||||
* @since 5.0
|
||||
@@ -36,7 +37,8 @@ inline fun <reified T : Any, S : Publisher<T>> RequestBodySpec.body(publisher: S
|
||||
|
||||
/**
|
||||
* Extension for [WebClient.ResponseSpec.bodyToMono] providing a `bodyToMono<Foo>()` variant
|
||||
* leveraging Kotlin reified type parameters.
|
||||
* leveraging Kotlin reified type parameters. This extension is not subject to type
|
||||
* erasure and retains actual generic type arguments.
|
||||
*
|
||||
* @author Sebastien Deleuze
|
||||
* @since 5.0
|
||||
@@ -47,7 +49,8 @@ inline fun <reified T : Any> WebClient.ResponseSpec.bodyToMono(): Mono<T> =
|
||||
|
||||
/**
|
||||
* Extension for [WebClient.ResponseSpec.bodyToFlux] providing a `bodyToFlux<Foo>()` variant
|
||||
* leveraging Kotlin reified type parameters.
|
||||
* leveraging Kotlin reified type parameters. This extension is not subject to type
|
||||
* erasure and retains actual generic type arguments.
|
||||
*
|
||||
* @author Sebastien Deleuze
|
||||
* @since 5.0
|
||||
|
||||
@@ -22,7 +22,8 @@ import reactor.core.publisher.Mono
|
||||
|
||||
/**
|
||||
* Extension for [ServerRequest.bodyToMono] providing a `bodyToMono<Foo>()` variant
|
||||
* leveraging Kotlin reified type parameters.
|
||||
* leveraging Kotlin reified type parameters. This extension is not subject to type
|
||||
* erasure and retains actual generic type arguments.
|
||||
*
|
||||
* @author Sebastien Deleuze
|
||||
* @since 5.0
|
||||
@@ -32,7 +33,8 @@ inline fun <reified T : Any> ServerRequest.bodyToMono(): Mono<T> =
|
||||
|
||||
/**
|
||||
* Extension for [ServerRequest.bodyToFlux] providing a `bodyToFlux<Foo>()` variant
|
||||
* leveraging Kotlin reified type parameters.
|
||||
* leveraging Kotlin reified type parameters. This extension is not subject to type
|
||||
* erasure and retains actual generic type arguments.
|
||||
*
|
||||
* @author Sebastien Deleuze
|
||||
* @since 5.0
|
||||
|
||||
@@ -22,7 +22,9 @@ import org.springframework.http.MediaType
|
||||
import reactor.core.publisher.Mono
|
||||
|
||||
/**
|
||||
* Extension for [ServerResponse.BodyBuilder.body] providing a `body(Publisher<T>)` variant.
|
||||
* Extension for [ServerResponse.BodyBuilder.body] providing a `body(Publisher<T>)`
|
||||
* variant. This extension is not subject to type erasure and retains actual generic
|
||||
* type arguments.
|
||||
*
|
||||
* @author Sebastien Deleuze
|
||||
* @since 5.0
|
||||
@@ -31,7 +33,9 @@ inline fun <reified T : Any> ServerResponse.BodyBuilder.body(publisher: Publishe
|
||||
body(publisher, object : ParameterizedTypeReference<T>() {})
|
||||
|
||||
/**
|
||||
* Extension for [ServerResponse.BodyBuilder.body] providing a `bodyToServerSentEvents(Publisher<T>)` variant.
|
||||
* Extension for [ServerResponse.BodyBuilder.body] providing a
|
||||
* `bodyToServerSentEvents(Publisher<T>)` variant. This extension is not subject to type
|
||||
* erasure and retains actual generic type arguments.
|
||||
*
|
||||
* @author Sebastien Deleuze
|
||||
* @since 5.0
|
||||
|
||||
Reference in New Issue
Block a user