AbstractResponseDefinitionBuilder

abstract class AbstractResponseDefinitionBuilder<P, T>(var httpStatus: <Error class: unknown class>, val headers: MutableList<<Error class: unknown class><String, String>>, var delay: <Error class: unknown class> = Duration.ZERO)

Represents a base abstraction for defining the attributes of an HTTP response in the context of request-to-response mappings. This class allows customization of the HTTP status code and headers and provides a mechanism for building concrete response definitions.

Parameters

P

The type of the request body. This determines the input type for which the response is being defined.

T

The type of the response data, which is returned to the client.

Inheritors

Constructors

Link copied to clipboard
constructor(httpStatus: <Error class: unknown class>, headers: MutableList<<Error class: unknown class><String, String>>, delay: <Error class: unknown class> = Duration.ZERO)

Properties

Link copied to clipboard
var delay: <Error class: unknown class>
Link copied to clipboard
val headers: MutableList<<Error class: unknown class><String, String>>

A mutable list of header key-value pairs to be included in the response.

Link copied to clipboard
var httpStatus: <Error class: unknown class>

The HTTP status code to be associated with the response.

Functions

Link copied to clipboard
fun delayMillis(millis: Long)

Sets a delay for the response in milliseconds.

Link copied to clipboard
fun headers(block: <Error class: unknown class>.() -> Unit)

Configures additional headers for the response using the specified lambda block.

Link copied to clipboard
fun httpStatus(status: Int)