Module one.jpro.platform.auth.core
Record Class Request
java.lang.Object
java.lang.Record
one.jpro.platform.auth.core.http.impl.Request
public record Request(String method, String uri, String version, List<Header> headers, byte[] body)
extends Record
This class represents discrete HTTP requests with request line, headers, and body.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbyte[]body()Returns the value of thebodyrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.booleanChecks if the request has a header with the specified name and value.Retrieves the value of the specified header.headers()Returns the value of theheadersrecord component.method()Returns the value of themethodrecord component.final StringtoString()Returns a string representation of this record class.uri()Returns the value of theurirecord component.version()Returns the value of theversionrecord component.
-
Constructor Details
-
Request
Creates an instance of aRequestrecord class.- Parameters:
method- the value for themethodrecord componenturi- the value for theurirecord componentversion- the value for theversionrecord componentheaders- the value for theheadersrecord componentbody- the value for thebodyrecord component
-
-
Method Details
-
header
Retrieves the value of the specified header.- Parameters:
name- The name of the header.- Returns:
- The value of the header, or null if the header is not found.
-
hasHeader
Checks if the request has a header with the specified name and value.- Parameters:
name- The name of the header.value- The value of the header.- Returns:
- true if the request has a header with the specified name and value, false otherwise.
-
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). -
method
Returns the value of themethodrecord component.- Returns:
- the value of the
methodrecord component
-
uri
Returns the value of theurirecord component.- Returns:
- the value of the
urirecord component
-
version
Returns the value of theversionrecord component.- Returns:
- the value of the
versionrecord component
-
headers
Returns the value of theheadersrecord component.- Returns:
- the value of the
headersrecord component
-
body
public byte[] body()Returns the value of thebodyrecord component.- Returns:
- the value of the
bodyrecord component
-