spring-framework
5.3.39

# Package org.springframework.web.servlet.function

## Types

RouterFunctionDsl
Link copied to clipboard
class RouterFunctionDsl
Content copied to clipboard

Provide a WebMvc.fn RouterFunction Kotlin DSL created by `router { }` in order to be able to write idiomatic Kotlin code.

## Functions

attributeOrNull
Link copied to clipboard
fun ServerRequest.attributeOrNull(name: String): Any?
Content copied to clipboard

Nullable variant of ServerRequest.attribute

body
Link copied to clipboard
inline fun <T : Any> ServerRequest.body(): T
Content copied to clipboard

Extension for ServerRequest.body providing a `body<Foo>()` variant leveraging Kotlin reified type parameters. This extension is not subject to type erasure and retains actual generic type arguments.

bodyWithType
Link copied to clipboard
inline fun <T : Any> ServerResponse.BodyBuilder.bodyWithType(body: T): ServerResponse
Content copied to clipboard

Extension for ServerResponse.BodyBuilder.body providing a variant leveraging Kotlin reified type parameters.

contentLengthOrNull
Link copied to clipboard
fun ServerRequest.Headers.contentLengthOrNull(): Long?
Content copied to clipboard

Nullable variant of ServerRequest.Headers.contentLength

contentTypeOrNull
Link copied to clipboard
fun ServerRequest.Headers.contentTypeOrNull(): MediaType?
Content copied to clipboard

Nullable variant of ServerRequest.Headers.contentType

paramOrNull
Link copied to clipboard
fun ServerRequest.paramOrNull(name: String): String?
Content copied to clipboard

Nullable variant of ServerRequest.param

plus
Link copied to clipboard
operator fun <T : ServerResponse> RouterFunction<T>.plus(other: RouterFunction<T>): RouterFunction<T>
Content copied to clipboard

Equivalent to RouterFunction.and.

principalOrNull
Link copied to clipboard
fun ServerRequest.principalOrNull(): Principal?
Content copied to clipboard

Nullable variant of ServerRequest.param

remoteAddressOrNull
Link copied to clipboard
fun ServerRequest.remoteAddressOrNull(): InetSocketAddress?
Content copied to clipboard

Nullable variant of ServerRequest.remoteAddress

router
Link copied to clipboard
fun router(routes: RouterFunctionDsl.() -> Unit): RouterFunction<ServerResponse>
Content copied to clipboard

Allow to create easily a WebMvc.fn RouterFunction with a router Kotlin DSL.