Skip to content

Commit b6c09fa

Browse files
committed
Disambiguate BodyExtractors/Inserters Kotlin function names
1 parent 86580b2 commit b6c09fa

File tree

4 files changed

+18
-18
lines changed

4 files changed

+18
-18
lines changed

spring-webflux/src/main/kotlin/org/springframework/web/reactive/function/BodyExtractorsExtensions.kt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import kotlin.reflect.KClass
1212
* @since 5.0
1313
* @see [KT-11968](https://youtrack.jetbrains.com/issue/KT-11968)
1414
*/
15-
inline fun <reified T : Any> toMono(): BodyExtractor<Mono<T>, ReactiveHttpInputMessage> =
15+
inline fun <reified T : Any> bodyToMono(): BodyExtractor<Mono<T>, ReactiveHttpInputMessage> =
1616
BodyExtractors.toMono(T::class.java)
1717

1818
/**
@@ -22,7 +22,7 @@ inline fun <reified T : Any> toMono(): BodyExtractor<Mono<T>, ReactiveHttpInputM
2222
* @since 5.0
2323
* @see [KT-11968](https://youtrack.jetbrains.com/issue/KT-11968)
2424
*/
25-
fun <T : Any> toMono(elementClass: KClass<T>): BodyExtractor<Mono<T>, ReactiveHttpInputMessage> =
25+
fun <T : Any> bodyToMono(elementClass: KClass<T>): BodyExtractor<Mono<T>, ReactiveHttpInputMessage> =
2626
BodyExtractors.toMono(elementClass.java)
2727

2828
/**
@@ -32,7 +32,7 @@ fun <T : Any> toMono(elementClass: KClass<T>): BodyExtractor<Mono<T>, ReactiveHt
3232
* @since 5.0
3333
* @see [KT-11968](https://youtrack.jetbrains.com/issue/KT-11968)
3434
*/
35-
inline fun <reified T : Any> toFlux(): BodyExtractor<Flux<T>, ReactiveHttpInputMessage> =
35+
inline fun <reified T : Any> bodyToFlux(): BodyExtractor<Flux<T>, ReactiveHttpInputMessage> =
3636
BodyExtractors.toFlux(T::class.java)
3737

3838
/**
@@ -42,5 +42,5 @@ inline fun <reified T : Any> toFlux(): BodyExtractor<Flux<T>, ReactiveHttpInputM
4242
* @since 5.0
4343
* @see [KT-11968](https://youtrack.jetbrains.com/issue/KT-11968)
4444
*/
45-
fun <T : Any> toFlux(elementClass: KClass<T>): BodyExtractor<Flux<T>, ReactiveHttpInputMessage> =
45+
fun <T : Any> bodyToFlux(elementClass: KClass<T>): BodyExtractor<Flux<T>, ReactiveHttpInputMessage> =
4646
BodyExtractors.toFlux(elementClass.java)

spring-webflux/src/main/kotlin/org/springframework/web/reactive/function/BodyInsertersExtensions.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import org.springframework.http.server.reactive.ServerHttpResponse
1010
* @author Sebastien Deleuze
1111
* @since 5.0
1212
*/
13-
inline fun <reified T : Publisher<S>, reified S : Any> fromPublisher(publisher: T): BodyInserter<T, ReactiveHttpOutputMessage> =
13+
inline fun <reified T : Publisher<S>, reified S : Any> bodyFromPublisher(publisher: T): BodyInserter<T, ReactiveHttpOutputMessage> =
1414
BodyInserters.fromPublisher(publisher, S::class.java)
1515

1616
/**
@@ -19,5 +19,5 @@ inline fun <reified T : Publisher<S>, reified S : Any> fromPublisher(publisher:
1919
* @author Sebastien Deleuze
2020
* @since 5.0
2121
*/
22-
inline fun <reified T : Publisher<S>, reified S : Any> fromServerSentEvents(publisher: T): BodyInserter<T, ServerHttpResponse> =
22+
inline fun <reified T : Publisher<S>, reified S : Any> bodyFromServerSentEvents(publisher: T): BodyInserter<T, ServerHttpResponse> =
2323
BodyInserters.fromServerSentEvents(publisher, S::class.java)

spring-webflux/src/test/kotlin/org/springframework/web/reactive/function/BodyExtractorsExtensionsTests.kt

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,23 +15,23 @@ import org.mockito.junit.MockitoJUnitRunner
1515
class BodyExtractorsExtensionsTests {
1616

1717
@Test
18-
fun `toMono with KClass`() {
19-
assertNotNull(toMono(Foo::class))
18+
fun `bodyToMono with KClass`() {
19+
assertNotNull(bodyToMono(Foo::class))
2020
}
2121

2222
@Test
23-
fun `toMono with reified type parameter`() {
24-
assertNotNull(toMono<Foo>())
23+
fun `bodyToMono with reified type parameter`() {
24+
assertNotNull(bodyToMono<Foo>())
2525
}
2626

2727
@Test
28-
fun `toFlux with KClass`() {
29-
assertNotNull(toFlux(Foo::class))
28+
fun `bodyToFlux with KClass`() {
29+
assertNotNull(bodyToFlux(Foo::class))
3030
}
3131

3232
@Test
33-
fun `toFlux with reified type parameter`() {
34-
assertNotNull(toFlux<Foo>())
33+
fun `bodyToFlux with reified type parameter`() {
34+
assertNotNull(bodyToFlux<Foo>())
3535
}
3636

3737
class Foo

spring-webflux/src/test/kotlin/org/springframework/web/reactive/function/BodyInsertersExtensionsTests.kt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,15 @@ import org.reactivestreams.Publisher
1717
class BodyInsertersExtensionsTests {
1818

1919
@Test
20-
fun `fromPublisher with reified type parameters`() {
20+
fun `bodyFromPublisher with reified type parameters`() {
2121
val publisher = mock<Publisher<Foo>>()
22-
assertNotNull(fromPublisher(publisher))
22+
assertNotNull(bodyFromPublisher(publisher))
2323
}
2424

2525
@Test
26-
fun `fromServerSentEvents with reified type parameters`() {
26+
fun `bodyFromServerSentEvents with reified type parameters`() {
2727
val publisher = mock<Publisher<Foo>>()
28-
assertNotNull(fromServerSentEvents(publisher))
28+
assertNotNull(bodyFromServerSentEvents(publisher))
2929
}
3030

3131
class Foo

0 commit comments

Comments
 (0)