Package io.micronaut.http.context
Record Class ServerHttpRequestContext
java.lang.Object
java.lang.Record
io.micronaut.http.context.ServerHttpRequestContext
- Record Components:
httpRequest
- The HTTP request
- All Implemented Interfaces:
PropagatedContextElement
public record ServerHttpRequestContext(HttpRequest<?> httpRequest)
extends Record
implements PropagatedContextElement
Http request propagation.
- Since:
- 4.0.0
- Author:
- Denis Stepanov
-
Constructor Summary
ConstructorDescriptionServerHttpRequestContext
(HttpRequest<?> httpRequest) Creates an instance of aServerHttpRequestContext
record class. -
Method Summary
Modifier and TypeMethodDescriptionfinal boolean
Indicates whether some other object is "equal to" this one.static <T> Optional<HttpRequest<T>>
find()
static <T> @Nullable HttpRequest<T>
get()
final int
hashCode()
Returns a hash code value for this object.HttpRequest<?>
Returns the value of thehttpRequest
record component.final String
toString()
Returns a string representation of this record class.
-
Constructor Details
-
ServerHttpRequestContext
Creates an instance of aServerHttpRequestContext
record class.- Parameters:
httpRequest
- the value for thehttpRequest
record component
-
-
Method Details
-
get
- Type Parameters:
T
- The request body type- Returns:
HttpRequest
or null
-
find
- Type Parameters:
T
- The request body type- Returns:
- an optional
HttpRequest
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object)
. -
httpRequest
Returns the value of thehttpRequest
record component.- Returns:
- the value of the
httpRequest
record component
-