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
ConstructorsConstructorDescriptionServerHttpRequestContext(HttpRequest<?> httpRequest) Creates an instance of aServerHttpRequestContextrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.static <T> Optional<HttpRequest<T>>find()static <T> @Nullable HttpRequest<T>get()final inthashCode()Returns a hash code value for this object.HttpRequest<?>Returns the value of thehttpRequestrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
ServerHttpRequestContext
Creates an instance of aServerHttpRequestContextrecord class.- Parameters:
httpRequest- the value for thehttpRequestrecord component
-
-
Method Details
-
get
- Type Parameters:
T- The request body type- Returns:
HttpRequestor 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 thehttpRequestrecord component.- Returns:
- the value of the
httpRequestrecord component
-